-
Notifications
You must be signed in to change notification settings - Fork 246
Open
Labels
Description
It's not a Field
. The docstring for the struct admits as much:
Oceananigans.jl/src/Fields/background_fields.jl
Lines 33 to 41 in 7a4b3f0
""" | |
BackgroundField{F, P} | |
Temporary container for storing information about `BackgroundFields`. | |
""" | |
struct BackgroundField{F, P} | |
func:: F | |
parameters :: P | |
end |
and this temporary struct is always thrown away to build a "real" field:
Oceananigans.jl/src/Fields/background_fields.jl
Lines 63 to 64 in 7a4b3f0
regularize_background_field(LX, LY, LZ, f::BackgroundField{<:Function}, grid, clock) = | |
FunctionField{LX, LY, LZ}(f.func, grid; clock=clock, parameters=f.parameters) |
The problem is that the name leads to confusing patterns like
B_field = BackgroundField(constant_stratification, parameters=(; ĝ, N² = 1e-5)) |
where B_field
is not a field. Indeed, later on when we need a "real" field we have to write
B∞ = model.background_fields.tracers.b |
Can we think of a better name? For example BackgroundFieldInfo
is one. That's sorta clumsy though. Maybe we can come up with something more concise and elegant.
cc @tomchor @hdrake @liuchihl because you are using this feature