-
Notifications
You must be signed in to change notification settings - Fork 192
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
Add m1 analytic data & couple GreyM1 to fixed hydro #6453
base: develop
Are you sure you want to change the base?
Conversation
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.
Haven't looked through the entirety of the second commit yet, because it has 1600+ lines of changes. It looks like it's doing several things (updating the executable, reorganizing the boundary conditions, adding new analytic data). Are they separate enough that they could be split into separate commits, at least for review purposes?
@@ -11,6 +11,7 @@ | |||
#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" | |||
#include "DataStructures/Tensor/Tensor.hpp" | |||
#include "DataStructures/Variables.hpp" | |||
#include "M1HydroCoupling.hpp" |
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.
Full path.
const Scalar<DataVector>& lorentz, | ||
const Scalar<DataVector>& sqrt_det_spatial_metric | ||
|
||
) { |
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.
Formatting.
const Scalar<DataVector>& lorentz, | ||
const Scalar<DataVector>& sqrt_det_spatial_metric | ||
|
||
) { |
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.
Formatting.
tmpl::pair<evolution::initial_data::InitialData, initial_data_list>, | ||
tmpl::pair<ImexTimeStepper, TimeSteppers::imex_time_steppers>, | ||
|
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.
Fixing the alphabetization is good, but we generally use POSIX sorting where all lowercase letters are after all uppercase, so this should put evolution::initial_data::InitialData
at the end.
@@ -108,6 +108,7 @@ struct TimeDerivativeTerms { | |||
extrinsic_curvature, spatial_metric, emissivity, absorption_opacity, | |||
scattering_opacity, tilde_j, tilde_h_normal, tilde_h_spatial, | |||
spatial_velocity, lorentz, sqrt_det_spatial_metric)); | |||
return {true}; |
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.
Squash into appropriate commit.
I'll do some more reorganizing later this week. Are you ok if I split into commits that don't independently compile, and then squash them together at the end of review? |
Yes, if it's too interconnected the split can be just during the review. |
7c24d0a
to
3ba9bdd
Compare
3ba9bdd
to
6cae38e
Compare
ping, I have reorganized the commits. |
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.
Thank you, much less daunting split up like that.
const double sharpness = -0.03; | ||
return Scalar<DataVector>{ | ||
(inner_value - outer_value) / M_PI * | ||
atan((sqrt(square(x)) - sphere_radius) / sharpness) + |
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.
sqrt(square(x))
-> x
(this is only called on non-negative values).
const double outer_value, | ||
const double sphere_radius) { | ||
// the closer to 0 this becomes, the sharper the discontinuity | ||
const double sharpness = -0.03; |
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.
Is it worth making this a parameter?
#undef EBIN | ||
#undef GENERATE_LIST | ||
|
||
// template class HomogeneousSphere; |
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.
Remove.
tmpl::list<TAG(data) < Frame::Inertial, NTYPE(data) < EBIN(data)> >> \ | ||
/*meta*/) const; | ||
|
||
#define temp_list \ |
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.
TEMP_LIST
for macros (in a few places)
static constexpr Options::String help = { | ||
"A homogeneous sphere emitting and absorbing neutrinos."}; | ||
|
||
// The sphere radius. |
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.
//
-> ///
|
||
// All components of momentum density should be zero for this problem | ||
CHECK(min(get<0>(tilde_s)) == 0.0); | ||
CHECK(min(get<0>(tilde_s)) == max(get<0>(tilde_s))); |
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 believe get<0>(tilde_s) == 0.0
works. Similar in a few other places.
@@ -26,3 +26,31 @@ def constant_m1_tildeS(x, t, mean_velocity, comoving_energy_density): | |||
|
|||
|
|||
# End Functions for testing ConstantM1.cpp | |||
|
|||
|
|||
def homogen_sphere_m1_tildeE( |
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.
The C++ part of this comparison test is missing. These should also be moved from AnalyticSolutions to AnalyticData.
#include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" | ||
#include "Evolution/TypeTraits.hpp" | ||
#include "NumericalAlgorithms/Spectral/Mesh.hpp" | ||
#include "Options/String.hpp" |
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.
Check the includes. Some (like this one) seem suspicious.
@@ -0,0 +1,242 @@ | |||
// Distributed under the MIT License. |
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.
This is just moving things into a cpp file without functionality changes, correct?
initial_data_evo_tags{}); | ||
}); | ||
|
||
const auto initial_data_hydro_vars = call_with_dynamic_type< |
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.
Combine the two calls to call_with_dynamic_type
, just because I suspect it may be expensive to compile. You can return a pair and use structured bindings to keep the variables as they are now.
Proposed changes
This PR adds the homogeneous sphere GreyM1 test problem, couples the fluid to a fixed hydro background, and allows the user to specify the M1Grey initial data in the yaml file.
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