You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An important missing component of our user interface is a function-based API for extracting properties from models. For example, we often write
u, v, w = model.velocities
when we really should write something like
u, v, w =velocity_field(model)
A major advantage of a function-based interface is that it is more robust to changes to the underlying model implementation. For example, we will eventually need a VectorField implementation for velocities (eg for the cubed sphere, or non-orthogonal grids). We'll be sorry that we've written u, v, w = model.velocities everywhere when we need to change model.velocities to model.velocity_field. But with a function-based interface we only have to change velocity_field(model) = model.velocities to velocity_field(model) = model.velocity_field.
A few other functions besides velocity_field that we might want are
tracers(model)
free_surface_displacement(model)
kinematic_pressure(model)
buoyancy(model)
viscosity(model) and diffusivities(model) might be nice too. One challenge there is figuring out what to do when the viscosity or diffusivities are really tensors rather than scalars (eg we need VectorField but we also may need TensorField...)
The text was updated successfully, but these errors were encountered:
glwagner
changed the title
Function interface for extracting properties from HydrostaticFreeSurfaceModel and NonhydrostaticModel
Function interface for extracting properties from models
Jan 19, 2022
I'm closing this issue because I'm judging that it's not of current, timely relevance to Oceananigans development. If you would like to make it a higher priority or if you think the issue was closed in error please feel free to re-open.
An important missing component of our user interface is a function-based API for extracting properties from models. For example, we often write
when we really should write something like
A major advantage of a function-based interface is that it is more robust to changes to the underlying model implementation. For example, we will eventually need a
VectorField
implementation for velocities (eg for the cubed sphere, or non-orthogonal grids). We'll be sorry that we've writtenu, v, w = model.velocities
everywhere when we need to changemodel.velocities
tomodel.velocity_field
. But with a function-based interface we only have to changevelocity_field(model) = model.velocities
tovelocity_field(model) = model.velocity_field
.A few other functions besides
velocity_field
that we might want aretracers(model)
free_surface_displacement(model)
kinematic_pressure(model)
buoyancy(model)
viscosity(model)
anddiffusivities(model)
might be nice too. One challenge there is figuring out what to do when the viscosity or diffusivities are really tensors rather than scalars (eg we needVectorField
but we also may needTensorField
...)The text was updated successfully, but these errors were encountered: