-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support complex numbers in PartialDerivatives #6107
Conversation
26aa312
to
37d9973
Compare
0e20438
to
a4bbc8f
Compare
@nilsdeppe or @wthrowe would one of you take this one? |
SPECTRE_TEST_CASE("Unit.Numerical.DiscontinuousGalerkin.ApplyMassMatrix", | ||
"[NumericalAlgorithms][Unit]") { | ||
template <typename DataType> | ||
void test_apply_mass_matrix() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this in the anonymous namespace.
0.0, // overwrite output with result | ||
result, // result | ||
matrix.rows()); // rows of result | ||
add_to_result ? 1.0 : 0.0, // overwrite output with result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment.
input, // input | ||
matrix.columns(), // rows of input | ||
std::complex{add_to_result ? 1.0 : 0.0, | ||
0.0}, // overwrite output with result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix comment.
imaginary_part = std::complex<double>(0., static_cast<double>(i) + 3); | ||
for (size_t d = 0; d < Dim; ++d) { | ||
imaginary_part *= | ||
std::complex<double>(0., static_cast<double>(d) + 2) * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be real? Multiplying by an imaginary number makes imaginary_part
real half the time. Same thing a couple more times below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a fixup for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Squash.
@nilsdeppe I think you said you wanted to take a final look at this?
691bb97
to
9c37796
Compare
a2adda9
to
38c8f31
Compare
Also added an extra commit at the end to add complex support to |
38c8f31
to
71d9d58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wthrowe can you look at the last commit too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll grumble about improper use of detail namespaces, but I'll allow it.
Proposed changes
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments