-
Notifications
You must be signed in to change notification settings - Fork 206
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
CumulativeIntegral
throws error when integrated over a reduced Field
#4078
Comments
A little more direct MWE: julia> c = Field{Nothing, Nothing, Center}(grid);
julia> ∫c = CumulativeIntegral(c, dims=3)
ERROR: UndefVarError: `Δzᵃᵃᶜ` not defined
Stacktrace:
[1] metric_function
@ ~/Projects/dev/Oceananigans.jl/src/AbstractOperations/grid_metrics.jl:31 [inlined]
[2] Oceananigans.AbstractOperations.GridMetricOperation(L::Tuple{…}, metric::Function, grid::RectilinearGrid{…})
@ Oceananigans.AbstractOperations ~/Projects/dev/Oceananigans.jl/src/AbstractOperations/grid_metrics.jl:78
[3] *(Lc::Tuple{…}, a::Field{…}, m::typeof(Oceananigans.Operators.Δz))
@ Oceananigans.AbstractOperations ~/Projects/dev/Oceananigans.jl/src/AbstractOperations/binary_operations.jl:122
[4] *
@ ~/Projects/dev/Oceananigans.jl/src/AbstractOperations/binary_operations.jl:126 [inlined]
[5] (Accumulation{…})(field::Field{…}; dims::Int64, reverse::Bool, condition::Nothing, mask::Int64)
@ Oceananigans.AbstractOperations ~/Projects/dev/Oceananigans.jl/src/AbstractOperations/metric_field_reductions.jl:170
[6] top-level scope
@ REPL[73]:1
Some type information was truncated. Use `show(err)` to see complete types. The issue I think is that because |
Yes, although for non immersed grids we don't have that problem and this should work, no? Also, a quick note. While julia> Average(Field(CumulativeIntegral(c, dims=3)), dims=(1, 2))
Average of 4×4×4 Field{Center, Center, Center} on RectilinearGrid on CPU over dims (1, 2)
└── operand: 4×4×4 Field{Center, Center, Center} on RectilinearGrid on CPU
└── grid: 4×4×4 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo |
Yes I think if you want to make some special cases for grids work then you can extend this constructor?
|
Is this correct? I was playing around with |
It appears there's a bug with
CumulativeIntegral
when used on reducedField
s.MWE:
The same thing happens when using
Integral
instead ofAverage
.The text was updated successfully, but these errors were encountered: