Oceananigans.jl icon indicating copy to clipboard operation
Oceananigans.jl copied to clipboard

`BackgroundField` is a confusing name

Open glwagner opened this issue 9 months ago โ€ข 2 comments

It's not a Field. The docstring for the struct admits as much:

https://github.com/CliMA/Oceananigans.jl/blob/7a4b3f04e402be70d45fcb775a4dedef087f3bb0/src/Fields/background_fields.jl#L33-L41

and this temporary struct is always thrown away to build a "real" field:

https://github.com/CliMA/Oceananigans.jl/blob/7a4b3f04e402be70d45fcb775a4dedef087f3bb0/src/Fields/background_fields.jl#L63-L64

The problem is that the name leads to confusing patterns like

https://github.com/CliMA/Oceananigans.jl/blob/7a4b3f04e402be70d45fcb775a4dedef087f3bb0/examples/tilted_bottom_boundary_layer.jl#L98

where B_field is not a field. Indeed, later on when we need a "real" field we have to write

https://github.com/CliMA/Oceananigans.jl/blob/7a4b3f04e402be70d45fcb775a4dedef087f3bb0/examples/tilted_bottom_boundary_layer.jl#L178

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

glwagner avatar May 06 '24 15:05 glwagner

Maybe just BackgroundFieldDefinition?

hdrake avatar May 06 '24 21:05 hdrake

Not bad...

glwagner avatar May 06 '24 23:05 glwagner