Algebraic operators#
BOUT++ provides a wide variety of algebraic operators acting on fields.
The algebraic operators are listed in Table 18.
For a completely up-to-date list, see the Non-member functions
part of field2d.hxx,
field3d.hxx,
fieldperp.hxx.
Name |
Description |
---|---|
|
Minimum (optionally over all processes) |
|
Maximum (optionally over all processes) |
|
\(\mathtt{lhs}^\mathtt{rhs}\) |
|
\(\sqrt{(f)}\) |
|
\(|f|\) |
|
\(e^f\) |
|
\(\log(f)\) |
|
\(\sin(f)\) |
|
\(\cos(f)\) |
|
\(\tan(f)\) |
|
\(\sinh(f)\) |
|
\(\cosh(f)\) |
|
\(\tanh(f)\) |
|
Returns a field with the floor of |
|
Calculate the amplitude of the Fourier mode in the
z-direction with mode number |
|
Remove Fourier modes (in the z-direction) with mode
number higher than |
|
Remove Fourier modes (in the z-direction) with mode
number higher than |
|
Rotate |
|
The average in the z-direction of |
These operators take a region
argument, whose values can be [1] (see
Iterating over fields)
RGN_ALL
, which is the whole mesh;RGN_NOBNDRY
, which skips all boundaries;RGN_NOX
, which skips the x boundariesRGN_NOY
, which skips the y boundaries
The default value for the region argument is RGN_ALL
which should work in all
cases. However, the region argument can be used for optimization, to skip
calculations in guard cells if it is known that those results will not be
needed (for example, if no derivatives of the result will be calculated). Since
these operators can be relatively expensive compared to addition, subtraction,
multiplication this can be a useful performance improvement.