-
Notifications
You must be signed in to change notification settings - Fork 37
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
plug in InitUserMeshBlockData #557
Conversation
@par-hermes format |
…nto jmm/user-meshblock-data
I have checked that this fits our needs downstream. |
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 to me. Only comment is would it be worth mentioning this usage of InitUserMeshBlockData
in e.g. ~/github/parthenon/docs/amr.md
? From the existing documentation it's not immediately apparent (to me at least) that InitUserMeshBlockData
is called after every remeshing step.
Oh good call, @brryan . Yes documentation should be added. |
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 great! I just have a small suggestion to rename the function to avoid potential confusion with MeshBlockData
, but I'll defer to your judgement.
PR Summary
As discussed in the call today and on the Matrix channel, there's a need for initializing variables and setting grid quantities once per re-meshing, but not more frequently than that. To enable this, I re-enable
InitUserMeshBlockData
, which is set in the application input object. This is now called at the beginning ofMesh::Initialize
before anything else.Mesh::Initialize
is called at the beginning of a simulation and upon each remeshing. This means data set in this function is expected to remain constant except when remeshing, and is available to problem generators, boundary conditions, andFillDerived
.I also hook it in to the
calculate_pi
example to show it works.PR Checklist