-
Notifications
You must be signed in to change notification settings - Fork 7
Matter: Port Matter classes (with unit tests) #94
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
Conversation
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
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.
Thanks for this PR Juliana.
It looks pretty good but I have some comments. I know there are a fair few of them but I think most of them should be easy to resolve and the more complicated ones I will try and look at myself.
For the GRChombo HDF5 files you have generated for the tests, where is the code you used to create them? I couldn't find a relevant branch in the GRChombo repo.
I don't think the Tests/MatterWeyl4Test/GRChomboEMTensorTest.h5
file is needed/used so could you remove it as well?
Would you also be able to fix the commit history by applying the fixup
s?
Source/Matter/EMTensor.hpp
Outdated
/// 3 components for the momentum density: m_11, m_22, m_33 | ||
/// 6 components for the stress energy tensor (symmetric): s_11, s_12 etc. | ||
static inline const amrex::Vector<std::string> extra_var_names = { | ||
"m_11, m_22, m_33, s_11, s_12, s_13, s_22, s_23, s_33"}; |
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.
Yes. We have always used Si and Sij but here that naming might be confusing. We could use J instead, so then it would be J1,J2,J3, S11, S12 etc. Maybe let's leave this for the naming tidy up as it would be best to be consistent throughout the code.
Source/Matter/EMTensor.impl.hpp
Outdated
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 would be good. I always found the passing of intervals in the constructor a bit ugly and confusing.
5e527e5
to
2b7a3ce
Compare
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
1c36aac
to
a44ef5d
Compare
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
1 similar comment
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
50c4e2b
to
dcf4ae8
Compare
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
Hi all - I think I have addressed everyone's comments now (and the lint checks have finally passed). Could you please review this PR again and double check that you are happy with everything? Main changes are:
|
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.
Thanks for making the changes, Juliana. Just a couple more minor changes.
da3ee70
to
47a3a61
Compare
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
47a3a61
to
20562ea
Compare
Hi @mirenradia - I believe I have addressed all your comments now. Can you please take another look at this PR? Thanks! |
This commit adds: - a set_up function to add the energy density, momemtum density and spatial stress-energy tensor as components of derive_lst - compute_mf a wrapper to the compute function which is called by AMReX whenever a derived variable needs to be calculated.
This commit will: - introduce a set_up function that adds "Weyl4_Re" and "Weyl4_Im" to the derive_lst for matter classes. - wrap the compute function inside compute_mf which is called by AMReX whenever the derived variable are needed.
This commit will: - introduce a set_up function for adding "Ham", "Mom1", "Mom2", and "Mom3" (or alternatively "Ham" and "Mom" normalized) to the derive_lst - introduce a compute_mf wrapper that will calculate the above whenever required by AMReX.
This commit will: - Call compute_mf to calculate derived varables - Refactor the HDF5 output to be consistent with the other unit tests (and update the relevent HDF5 files).
This commit will: - Pull out the test for rho from the MatterWeyl4 unit test into its own test case - Test the outputted values of rho calculated by EMTensor against values calculated by GRChombo - Test the outputted values of chi calculated by ChiRelaxation against values calculated by GRChombo - Add the GRChombo .h5 files for comparison - Add these two new test cases to the list in TestCases.hpp
This commit will: - Add an #if statement around HDF5 parts so they are not compiled if USE_HDF5=FALSE - Also, fix Lint errors
This commit will: - fix the bug in GRChombo with the gauge calculation in MatterCCZ4
This commit will: - Add the definition of phi and Pi to the common header file - Refactor the tests to use these definitions. I noticed that the BSSN Matter test and the chi relaxation test were using different initial conditions from the other so I had to update the HDF5 file outputs as well.
This commit will also: - Rename G_newton to G_Newton in the BSSN Matter test
This commit will: - Switch ordering of naming convention, so MatterCCZ4RHS becomes CCZ4RHSWithMatter, MatterConstraints becomes ConstraintsWithMatter, MatterWeyl4 becomes Weyl4WithMatter Matter: Remove matter object from constructor I forgot to remove the matter object in the constructor for CCZ4RHSWithMatter!
There is now a separate branch for the ChiRelaxation class
This will update the naming convention of emtensor_t: - The trace of the spatial stress energy tensor is now trS - The spatial stress energy tensor itself is now S - The momentum vector is now j
20562ea
to
8c30fcb
Compare
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
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 am happy with this PR, I made two minor suggestions for you to consider @julianakwan but I don't feel strongly about them, so whatever you think! Let's get this merged and do the tidy up!
This will: - Remove the calculations of emtensor and add_matter_rhs without the potential and incorporate them into a single function
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
This will: - Remove the calculations of emtensor and add_matter_rhs without the potential and incorporate them into a single function
Now the choice of which components are stored is decided by the template parameter em_tensor_parts. The choice is more limited as we now assume that if you want the momentum density, you will also want the energy density and similarly if you want the stress tensor, you want everything else too.
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
I have incorporated the changes to the |
I'm fine with this. I think @KAClough suggested |
I'm happy with EMTensorOptions - I didn't like Parts either. Options is nice as it shows you have options to pick! I would like to make it allDensities, thanks @mirenradia for remembering this. But we can also do that in the tidy up, it is not crucial. Let's merge this! |
This PR modifies the following files which are ignored by .lint-ignore:
Please consider removing the corresponding patterns from .lint-ignore so that these files can be linted. |
This PR completes my port of the
Matter
classes and closes #10 . It includes:MatterCCZ4
ScalarField
andDefaultPotential
classesWeyl4_Re
andWeyl4_Im
for aMatter
classMatter
classesNewMatterConstraints
to justMatterConstraints
.Matter
directory from the list of ignored files in.lint_ignore