-
Notifications
You must be signed in to change notification settings - Fork 33
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 constant derivative boundary condition and expose GenericBC
#884
Add constant derivative boundary condition and expose GenericBC
#884
Conversation
…FillGhost or WithFluxes
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 a nice improvement. Thanks for adding it. Assuming everything works, I'm in favor. 👍
This at least partially closes #376 |
I used this in a downstream code that does CT using a vector potential (which requires a constant derivative boundary condition to give outflow boundary conditions for B, while the other conserved variables have an outflow boundary condtion) and everything seems to work well. |
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.
LGTM, this is nice to have. I think the if constexpr
change would be worthwhile performance-wise if you agree and don't mind doing that before merge.
I thought about whether we should have a bunch more functions like ConstantInnerX1
etc. but I'm not sure that's a good idea. As in your use case different variables often have different BCs. Maybe the right way to do this would be to tag variables with their boundary conditions in their metadata, and use that to construct a BC function at runtime? Not a task for this PR of course.
I have a plan for this... metadata is one option, per-package BCs would be another. I've been meaning to refactor the code to add this forever, but I keep putting it off... |
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.
LGTM 💯
PR Summary
This PR adds:
GenericBC
to use sparse packs and allow for the selection of which variables to apply boundary conditions onGenericBC
to a header so that downstream codes can compose the generic boundary conditions for subsets of variables. This should make it easier to create user defined boundary conditions that behave differently for different variables, e.g.MeshData
levelApplyBoundaryConditions
tasks, and removes some unused code.PR Checklist