-
Notifications
You must be signed in to change notification settings - Fork 190
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
Some problems with ImmersedBoundaryGrids
#3742
Comments
My bad. It was a trivial issue. I ll close this issue |
What was the code? We can improve the error message |
Oh, right, I see what the problem was; I was trying to set a field using a function that had a typo, so the set! errored here Oceananigans.jl/src/Fields/set!.jl Lines 44 to 46 in 2bba4bb
However, the catch itself errored here Oceananigans.jl/src/Fields/set!.jl Lines 46 to 55 in 2bba4bb
because node_names is not defined for immersed grids. So, the error that the catch was spitting out was not related to the actual error I had. I guess it's a matter of defining the node_names for immersed boundary grids |
Ok, I think that should just pass to the underlying grid |
sorry can you also produce the code that made the error |
I got it julia> using Oceananigans
Precompiling Oceananigans
1 dependency successfully precompiled in 11 seconds. 139 already precompiled.
julia> grid = RectilinearGrid(size=1, x=(0, 1), topology=(Periodic, Flat, Flat))
1×1×1 RectilinearGrid{Float64, Periodic, Flat, Flat} on CPU with 1×0×0 halo
├── Periodic x ∈ [0.0, 1.0) regularly spaced with Δx=1.0
├── Flat y
└── Flat z
julia> grid = ImmersedBoundaryGrid(grid, GridFittedBoundary(x -> true))
warning: /Users/gregorywagner/.julia/packages/KernelAbstractions/MAxUm/src/cpu.jl:118:0: loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering
1×1×1 ImmersedBoundaryGrid{Float64, Periodic, Flat, Flat} on CPU with 1×0×0 halo:
├── immersed_boundary: GridFittedBoundary{Field{Center, Center, Center, Nothing, RectilinearGrid{Float64, Periodic, Flat, Flat, Float64, Float64, Float64, OffsetArrays.OffsetVector{Float64, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, Nothing, Nothing, CPU}, Tuple{Colon, Colon, Colon}, OffsetArrays.OffsetArray{Bool, 3, Array{Bool, 3}}, Bool, FieldBoundaryConditions{BoundaryCondition{Oceananigans.BoundaryConditions.Periodic, Nothing}, BoundaryCondition{Oceananigans.BoundaryConditions.Periodic, Nothing}, Nothing, Nothing, Nothing, Nothing, BoundaryCondition{Oceananigans.BoundaryConditions.Flux, Nothing}}, Nothing, Oceananigans.Fields.FieldBoundaryBuffers{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}}}
├── underlying_grid: 1×1×1 RectilinearGrid{Float64, Periodic, Flat, Flat} on CPU with 1×0×0 halo
├── Periodic x ∈ [0.0, 1.0) regularly spaced with Δx=1.0
├── Flat y
└── Flat z
julia> c = CenterField(grid)
1×1×1 Field{Center, Center, Center} on ImmersedBoundaryGrid on CPU
├── grid: 1×1×1 ImmersedBoundaryGrid{Float64, Periodic, Flat, Flat} on CPU with 1×0×0 halo
├── boundary conditions: FieldBoundaryConditions
│ └── west: Periodic, east: Periodic, south: Nothing, north: Nothing, bottom: Nothing, top: Nothing, immersed: ZeroFlux
└── data: 3×1×1 OffsetArray(::Array{Float64, 3}, 0:2, 1:1, 1:1) with eltype Float64 with indices 0:2×1:1×1:1
└── max=-Inf, min=Inf, mean=NaN
julia> f(x) = not_defined
f (generic function with 1 method)
julia> set!(c, f)
ERROR: MethodError: no method matching ξname(::ImmersedBoundaryGrid{Float64, Periodic, Flat, Flat, RectilinearGrid{…}, GridFittedBoundary{…}, Nothing, Nothing, CPU}) |
I hit these issues when setting a field on an immersed boundary grid.
The text was updated successfully, but these errors were encountered: