Operators
Difference operators
Oceananigans.Operators.δx!
— Method.δx!(g::RegularCartesianGrid, f::CellField, δxf::FaceField)
Compute the difference $\delta_x(f) = f_E - f_W$ between the eastern and western cells of a cell-centered field f
and store it in a face-centered field δxf
, assuming both fields are defined on a regular Cartesian grid g
with periodic boundary condition in the $x$-direction.
Oceananigans.Operators.δx!
— Method.δx!(g::RegularCartesianGrid, f::FaceField, δxf::CellField)
Compute the difference $\delta_x(f) = f_E - f_W$ between the eastern and western faces of a face-centered field f
and store it in a cell-centered field δxf
, assuming both fields are defined on a regular Cartesian grid g
with periodic boundary conditions in the $x$-direction.
Oceananigans.Operators.δy!
— Method.δy!(g::RegularCartesianGrid, f::CellField, δyf::FaceField)
Compute the difference $\delta_y(f) = f_N - f_S$ between the northern and southern cells of a cell-centered field f
and store it in a face-centered field δyf
, assuming both fields are defined on a regular Cartesian grid g
with periodic boundary condition in the $y$-direction.
Oceananigans.Operators.δy!
— Method.δy!(g::RegularCartesianGrid, f::FaceField, δyf::CellField)
Compute the difference $\delta_y(f) = f_N - f_S$ between the northern and southern faces of a face-centered field f
and store it in a cell-centered field δyf
, assuming both fields are defined on a regular Cartesian grid g
with periodic boundary condition in the $y$-direction.
Oceananigans.Operators.δz!
— Method.δz!(g::RegularCartesianGrid, f::CellField, δzf::FaceField)
Compute the difference $\delta_z(f) = f_T - f_B$ between the top and bottom cells of a cell-centered field f
and store it in a face-centered field δzf
, assuming both fields are defined on a regular Cartesian grid g
with Neumann boundary condition in the $z$-direction.
Oceananigans.Operators.δz!
— Method.δz!(g::RegularCartesianGrid, f::FaceField, δzf::CellField)
Compute the difference $\delta_z(f) = f_T - f_B$ between the top and bottom faces of a face-centered field f
and store it in a cell-centered field δzf
, assuming both fields are defined on a regular Cartesian grid g
with Neumann boundary condition in the $z$-direction.
Averaging operators
Oceananigans.Operators.avgx!
— Method.avgx!(g::RegularCartesianGrid, f::CellField, favgx::FaceField)
Compute the average $\overline{\;f\;}^x = \frac{f_E + f_W}{2}$ between the eastern and western cells of a cell-centered field f
and store it in a g
face-centered field favgx
, assuming both fields are defined on a regular Cartesian grid g
with periodic boundary conditions in the $x$-direction.
Divergence operators
Building on top of the differencing operators we can define operators that compute the divergence
Oceananigans.Operators.div!
— Method.div!(g, fx, fy, fz, div, tmp)
Compute the divergence.