File field3d.cxx¶
Class for 3D X-Y-Z scalar fields
Copyright 2010 B.D.Dudson, S.Farley, M.V.Umansky, X.Q.Xu
Contact: Ben Dudson, bd512@york.ac.uk
This file is part of BOUT++.
BOUT++ is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
BOUT++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with BOUT++. If not, see http://www.gnu.org/licenses/.
Functions
-
Field3D
operator-
(const Field3D &f)¶ Unary minus. Returns the negative of given field, iterates over whole domain including guard/boundary cells.
-
Field3D
pow
(const Field3D &lhs, const Field2D &rhs, const std::string &rgn = "RGN_ALL")¶ Exponent: pow(lhs, lhs) is
lhs
raised to the power ofrhs
Extra overloads not provided by the templates in field.hxx
This loops over the entire domain, including guard/boundary cells by default (can be changed using the
rgn
argument). If CHECK >= 3 then the result will be checked for non-finite numbers
-
Field3D
filter
(const Field3D &var, int N0, const std::string &rgn = "RGN_ALL")¶ Fourier filtering, removes all except one mode
- Parameters
var
: Variable to apply filter toN0
: The component to keeprgn
: The region to calculate the result over
-
Field3D
lowPass
(const Field3D &var, int zmax, bool keep_zonal, const std::string &rgn = "RGN_ALL")¶ Fourier low pass filtering. Removes modes higher than
zmax
and optionally the zonal component- Parameters
var
: Variable to apply filter tozmax
: Maximum mode in Zkeep_zonal
: Keep the zonal component if truergn
: The region to calculate the result over
-
void
shiftZ
(Field3D &var, int jx, int jy, double zangle)¶ Perform a shift by a given angle in Z
- Parameters
var
: The variable to be modified in-placejx
: X indexjy
: Y indexzangle
: The Z angle to apply
-
void
shiftZ
(Field3D &var, BoutReal zangle, const std::string &rgn = "RGN_ALL")¶ Apply a phase shift by a given angle
zangle
in Z to all points- Parameters
var
: The variable to modify in-placezangle
: The angle to shift by in Zrgn
: The region to calculate the result over
-
void
checkData
(const Field3D &f, const std::string ®ion = "RGN_NOBNDRY")¶ Throw an exception if
f
is not allocated or if any elements are non-finite (for CHECK > 2). Loops over all points including the boundaries by default (can be changed using thergn
argument
-
Field2D
DC
(const Field3D &f, const std::string &rgn = "RGN_ALL")¶ Average in the Z direction
- Parameters
f
: Variable to averagergn
: The region to calculate the result over