-
Notifications
You must be signed in to change notification settings - Fork 250
materialize DefaultBoundaryCondition from bcs in Field constructor
#4762
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
base: main
Are you sure you want to change the base?
Conversation
|
I guess we cannot really |
FieldBoundaryConditions in Field constructorDefaultBoundaryCondition from bcs in Field constructor
…anigans.jl into ss/build-fields-with-default
|
As part of this PR, I have removed the |
| end | ||
|
|
||
| DefaultBoundaryCondition() = DefaultBoundaryCondition(NoFluxBoundaryCondition()) | ||
| struct DefaultBoundaryCondition end |
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.
why did you change this design?
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.
As part of this PR, I have removed the
boundary_conditioninside theDefaultBoundaryCondition.
In my opinion, the default is uniquely defined and should depend on location and grid; user-defined BCs should be explicitly specified rather than changing a default globally (which is not even possible becauseFaceandCenterlocations do not accept the same bcs so this approach could very well lead to error)
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 thought to remove it for this reason and in particular because validate_boundary_conditions is only grid and location dependent (not model dependent), so it basically forces a limited default choice. But of course, I am open to discuss about it and keep this feature if this is the consensus 😅
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 guess, what do you think about models / situations in which "no flux" is irrelevant. For example a model that has no derivatives.
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.
We could have the default be a nothing like on Faces, this would then be general.
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.
That isn't general because models with gradients require NoFluxBoundaryCondition() as a default.
No, this is ok --- only prognostic fields can have field dependencies, and those are built separately inside the model constructor. This PR applies to auxiliary fields only. |
| north = DefaultBoundaryCondition(), | ||
| bottom = DefaultBoundaryCondition(), | ||
| top = DefaultBoundaryCondition(), | ||
| immersed = DefaultBoundaryCondition()) = |
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 feel this PR removes a nice feature that I designed for changing the default boundary condition. Note that this code is meant to be applicable to a wide class of models --- not just NonhydrostaticModel and HydrostaticFreeSurfaceModel.
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.
Also, this PR makes the previous code more useful...
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.
Ok, I can keep the default in the DefaultBoundaryCondition. I guess having it or not is not really the scope of this PR
|
This last commit should have allowed the possibility of choosing a general default without needing to use a field internal to bcs = FieldBoundaryConditions(FluxBoundaryCondition(10))will have the same effect |
this PR should allow the pattern described in #4758, for example:
closes #4758