File fieldperp.hxx¶
Functions
-
FieldPerp
operator-
(const FieldPerp &f) Unary minus. Returns the negative of given field, iterates over whole domain including guard/boundary cells.
-
const FieldPerp
sliceXZ
(const Field3D &f, int y) Create a FieldPerp by slicing a 3D field at a given y.
-
template<>
FieldPerpemptyFrom
<FieldPerp>(const FieldPerp &f)¶ Return an empty shell field of some type derived from Field, with metadata copied and a data array that is allocated but not initialised.
-
void
checkData
(const FieldPerp &f, const std::string ®ion = "RGN_NOX") Check if the data is valid.
-
void
invalidateGuards
(FieldPerp &var) Force guard cells of passed field
var
to NaN.
-
class
FieldPerp
: public Field¶ - #include <fieldperp.hxx>
Represents a 2D field perpendicular to the magnetic field at a particular index in Y, which only varies in X-Z.
Primarily used inside field solvers
Public Functions
-
FieldPerp::FieldPerp(Mesh * fieldmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, int yindex_in = -1, DirectionTypes directions_in = {YDirectionType::Standard, ZDirectionType::Standard})
Constructor
-
FieldPerp
(BoutReal val, Mesh *localmesh = nullptr)¶ Constructor. This creates a FieldPerp using the global Mesh pointer (mesh) allocates data, and assigns the value
val
to all points including boundary cells.
-
~FieldPerp
()¶
-
const Region<IndPerp> &
getRegion
(REGION region) const¶ Return a Region<IndPerp> reference to use to iterate over this field.
-
int
getIndex
() const¶ Returns the y index at which this field is defined
-
FieldPerp &
setIndex
(int y)¶ Sets the y index at which this field is defined
This is used in arithmetic operations
-
FieldPerp &
setDirectionY
(YDirectionType d)¶
-
bool
isAllocated
() const¶ True if the underlying data array is allocated.
-
BoutReal *
operator[]
(int jx)¶ Returns a C-style array (pointer to first element) in Z at a given X index. Used mainly for FFT routines
-
BoutReal &
operator()
(int jx, int jz)¶ Access to the underlying data array at a given x,z index
If CHECK > 2 then bounds checking is performed, otherwise no checks are performed
-
const BoutReal &
operator()
(int jx, int jz) const¶ Const (read-only) access to the underlying data array.
-
BoutReal &
operator()
(int jx, int jy, int jz)¶ Access to the underlying data array. (X,Y,Z) indices for consistency with other field types
-
FieldPerp &
operator+=
(const FieldPerp &rhs)¶ Addition, modifying in-place. This loops over the entire domain, including guard/boundary cells
-
FieldPerp &
operator-=
(const FieldPerp &rhs)¶ Subtraction, modifying in place. This loops over the entire domain, including guard/boundary cells
-
FieldPerp &
operator*=
(const FieldPerp &rhs)¶ Multiplication, modifying in place. This loops over the entire domain, including guard/boundary cells
-
FieldPerp &
operator/=
(const FieldPerp &rhs)¶ Division, modifying in place. This loops over the entire domain, including guard/boundary cells
-
int
getNx
() const¶ Return the number of nx points
-
int
getNy
() const¶ Return the number of ny points
-
int
getNz
() const¶ Return the number of nz points
-