Skip to content
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

Merged
merged 10 commits into from
Jul 9, 2021
Merged

plug in InitUserMeshBlockData #557

merged 10 commits into from
Jul 9, 2021

Conversation

Yurlungur
Copy link
Collaborator

@Yurlungur Yurlungur commented Jul 9, 2021

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 of Mesh::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, and FillDerived.

I also hook it in to the calculate_pi example to show it works.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • CI has been triggered on Darwin for performance regression tests.
  • (@lanl.gov employees) Update copyright on changed files

@Yurlungur Yurlungur added the enhancement New feature or request label Jul 9, 2021
@Yurlungur Yurlungur self-assigned this Jul 9, 2021
@Yurlungur
Copy link
Collaborator Author

@par-hermes format

@Yurlungur
Copy link
Collaborator Author

I have checked that this fits our needs downstream.

Copy link
Collaborator

@brryan brryan left a 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.

@Yurlungur
Copy link
Collaborator Author

Oh good call, @brryan . Yes documentation should be added.

docs/amr.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@jlippuner jlippuner left a 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.

src/application_input.hpp Outdated Show resolved Hide resolved
@Yurlungur Yurlungur enabled auto-merge July 9, 2021 20:34
@Yurlungur Yurlungur merged commit 0e9a1d2 into develop Jul 9, 2021
@Yurlungur Yurlungur deleted the jmm/user-meshblock-data branch December 15, 2022 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants