Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
94ff144a
Commit
94ff144a
authored
Jul 03, 2020
by
steffen.schotthoefer
Browse files
small change
parent
2bc77794
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/src/main.cpp
View file @
94ff144a
...
...
@@ -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 );
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment