-
Notifications
You must be signed in to change notification settings - Fork 186
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
Be careful of using end
in forcing functions and boundary conditions
#838
Comments
I think we are moving towards hiding the "discrete form" of boundary condition functions and forcing functions beneath an abstraction layer. When this change is complete, we can write some documentation on how to use the "discrete form"s if needed that includes this information. |
A few additional thoughts: This problem could be solved if we ever figure out how to adapt fields to work on the GPU (#746). We can then define A second solution is to define a thin wrapper |
That would be nice, especially #746, but on the topic of defining I can't think of a possible use case but might still be good to add a recommendation against using |
Yea agree that it might be considered an "abuse of abstraction" to define Maybe what we need is a section in the docs about working with underlying discrete data structures that includes a practical discussion about halos and the staggered grid, with examples. And we'll recommend using continuous interfaces as much as possible to avoid mistakes. |
I agree with this now. This is better fixed with documentation. It should not be surprising that |
An alternative solution is to supply our own syntax for working with the boundary of fields, similar to https://github.com/JuliaArrays/EndpointRanges.jl/blob/master/src/EndpointRanges.jl For example, we can define
This will work best if we generalize |
We could solve this by unwrapping field data into a |
This is documented. |
The docstrings for forcing functions and boundary functions with
i, j, k
signatures should tell users not to useend
as it'll reach into the halo regions when they probably meantgrid.Nz
, etc.cc @sandreza
The text was updated successfully, but these errors were encountered: