Commit 94ff144a authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

small change

parent 2bc77794
......@@ -17,29 +17,29 @@
int main( int argc, char** argv ) {
MPI_Init( &argc, &argv );
//
// QGaussLegendreTensorized quad( 4 );
// SphericalHarmonics testBase( 2 );
//
// double x, y, z, w;
// Vector moment = testBase.ComputeSphericalBasis( 0, 1, 0 );
// // 9 basis moments if degree = 2
//
// Vector results( moment.size(), 0.0 );
//
// for( unsigned idx_quad = 0; idx_quad < quad.GetNq(); idx_quad++ ) {
// x = quad.GetPoints()[idx_quad][0];
// y = quad.GetPoints()[idx_quad][1];
// z = quad.GetPoints()[idx_quad][2];
// w = quad.GetWeights()[idx_quad];
// moment = testBase.ComputeSphericalBasis( x, y, z );
//
// for( unsigned idx_sys = 0; idx_sys < 9; idx_sys++ ) {
// results[idx_sys] += w * moment[idx_sys] * moment[idx_sys];
// // std::cout << idx_quad << ": " << results[0] << "\n";
// }
// }
// std::cout << "moment integration:\n " << results << "\n";
QGaussLegendreTensorized quad( 4 );
SphericalHarmonics testBase( 2 );
double x, y, z, w;
Vector moment = testBase.ComputeSphericalBasis( 0, 1, 0 );
// 9 basis moments if degree = 2
Vector results( moment.size(), 0.0 );
for( unsigned idx_quad = 0; idx_quad < quad.GetNq(); idx_quad++ ) {
x = quad.GetPoints()[idx_quad][0];
y = quad.GetPoints()[idx_quad][1];
z = quad.GetPoints()[idx_quad][2];
w = quad.GetWeights()[idx_quad];
moment = testBase.ComputeSphericalBasis( x, y, z );
for( unsigned idx_sys = 0; idx_sys < 9; idx_sys++ ) {
results[idx_sys] += w * moment[idx_sys];
// std::cout << idx_quad << ": " << results[0] << "\n";
}
}
std::cout << "moment integration:\n " << results << "\n";
//
// // Normalized integration
// Vector resultsNormal( moment.size(), 0.0 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment