-
Notifications
You must be signed in to change notification settings - Fork 216
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
Missing information in docstring for BoundaryAdjacentMean
#4183
Comments
Not sure what happened with the docstring, I'll open a PR to fix that |
This was meant for use in open boundaries (but I think could be used for other stuff), like:
We need to store the value otherwise, it would have to be computed at every boundary point, and I don't know how else you would do that (other than a 1-element array)? I guess the other option is to make it a mutable struct and then adapt to a non-mutabel version but that seems un-neccesarily complicated.
This is a good point, I only used it for wall normal velocity so the integral is the wall normal momentum flux, but then when it got renamed to be general for any field flux field should have been changed to just integral or something. I'll change this. |
But it doesn't have to be stored in |
I guess we could make some other thing like: struct ComputedBoundaryVelocity{V, C}
value::V
operator::C
end then we put this in the condition and have an update boundary condition that puts the result of |
Why can't Where do we compute the value of |
The condition gets computed in |
My point is that the example: julia> bam = BoundaryAdjacentMean(grid, :east)
BoundaryAdjacentMean: (0.0)
julia> bam(:east, cf)
-1.5612511283791264e-18 is bad. The example show the creation of an operator The problem could very simply be solved by using a different syntax like However, I would like to back up and look at the whole workflow that is being implemented, to see if there are additional opportunities to make this code better. It would help to have links to the code so I don't have to search through the source to find the name of a function like |
The function signature in the docstring is missing, and the docstring ends with the phrase "Updated by calling"...
Maybe something was accidentally deleted?
Oceananigans.jl/src/Models/boundary_mean.jl
Lines 12 to 15 in d2e9e27
I was also confused about the purpose of this object. The user interface seems to allow the generation of an operator that can act on any field. But what should this operator used for?
I'm also perplexed by the property names. One property is
flux_field
. But what doesBoundaryAdjacentMean
have to do with fluxes?Oceananigans.jl/src/Models/boundary_mean.jl
Line 51 in d2e9e27
It's also problematic to me that
value
needs to be aRef
or stored at all. This creates ambiguity about how the operator is supposed to be used, one can either call the operator and store the value manually, or call it without explicitly storing the value. Probably for the sake of clarity it is better not to store the result in aRef
. This will reduce bugs in downstream code by constraining how this feature is used, which will help the community by allowing people to make progress faster.Can you clean this up @jagoosw ?
The text was updated successfully, but these errors were encountered: