-
Notifications
You must be signed in to change notification settings - Fork 191
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
General parser function for external fields #5349
General parser function for external fields #5349
Conversation
d3ad8be
to
ff36f1b
Compare
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 a lot for this PR! It will help to make things more maintainable when all grid parsing is done through the same function.
One question I have, do you think it would be possible to reduce the amount of code duplication in the two overloads of ComputeExternalFieldOnGridUsingParser
? One suggestion would be to make the edge_lengths
and face_areas
arguments std::optional
with default values of std::nullopt
. That way if they are not given the lx
, Sx
, ... variables could just remain uninitialized and things like if(lx && ...)
would return false
.
64dbd99
to
9981ec7
Compare
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. I just have a question about the index change for the z-direction in 1d. See below.
I'm struggling to get clang-tidy build to compile. Working on it. |
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 only remaining clang-tidy
issues I see are these ones.
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! Thanks for the contribution!
This feature replaces the InitializeExternalFieldsOnGridUsingParser with a more general function ComputeExternalFieldOnGridUsingParser. The new function takes parsed functions with four dimensions (x,y,z,t), so that it can be used to evaluate functions throughout the simulation, for example time-dependent external fields.
The function ComputeExternalFieldOnGridUsingParser has optional edge length and face areas.