Plain scalar field class to store simple scalar fields with no differentiation or interpolation.
More...
#include "lib/plainsf.h"
|
blitz::Array< real, 3 > | F |
|
blitz::Range | xColl |
|
blitz::Range | yColl |
|
blitz::Range | zColl |
|
mpidata * | mpiHandle |
|
Plain scalar field class to store simple scalar fields with no differentiation or interpolation.
The class stores scalar fields in the form of a Blitz array
◆ plainsf()
plainsf::plainsf |
( |
const grid & |
gridData, |
|
|
const sfield & |
refF |
|
) |
| |
Constructor of the plainsf class.
The instance of the field class to store the data of the scalar field is initialized, and the necessary grid
transformation derivatives along each direction are chosen according to the grid staggering.
The arrays to store the output from various operators like derivatives, convective derivatives, etc. are also
allocated.
Finally, an instance of the <B>mpidata</B> class is initialized to store the sub-arrays to be sent/received
across the processors during MPI communication.
- Parameters
-
gridData | is a const reference to the global data contained in the grid class |
refF | is a const reference to a sample sfield according to which the plainsf is resized |
◆ fxMax()
Function to extract the maximum value from the plain scalar field.
The function uses the in-built blitz function to obtain the maximum value in an array.
While performing parallel computation, the function performs an <B>MPI_Allreduce()</B> to get
the global maximum from the entire computational domain.
- Returns
- The real value of the maximum is returned (it is implicitly assumed that only real values are used)
◆ fxMean()
Function to compute the mean value from the plain scalar field.
The function uses the in-built blitz function to obtain the mean value in an array.
While performing parallel computation, the function performs an <B>MPI_Allreduce()</B> to get
the global mean from the entire computational domain.
- Returns
- The real value of the mean is returned (it is implicitly assumed that only real values are used)
◆ gradient()
Operator to compute the gradient of the plain scalar field.
The gradient operator computes the gradient of the cell centered scalar field, and stores it into a face-centered staggered
plain vector field as defined by the tensor operation:
\f$ \nabla f = \frac{\partial f}{\partial x}i + \frac{\partial f}{\partial y}j + \frac{\partial f}{\partial z}k \f$.
- Parameters
-
gradF | is a reference to a plain vector field (plainvf) into which the computed gradient must be written. |
V | is a const reference to a vector field (vfield) whose core slices are used to compute gradient, since plainvf doesn't have them |
◆ operator*=()
plainsf & plainsf::operator*= |
( |
real |
a | ) |
|
Overloaded operator to multiply a scalar value to the scalar field.
The unary operator *= multiplies a real value to the plainsf and returns
a pointer to itself.
- Parameters
-
a | is a real number to be multiplied to the scalar field |
- Returns
- A pointer to itself is returned by the plain scalar field class to which the operator belongs
◆ operator+=() [1/2]
Overloaded operator to add a given plain scalar field.
The unary operator += adds a given plain scalar field to the plainsf and returns
a pointer to itself.
- Parameters
-
a | is a reference to another plainsf to be added to the member field |
- Returns
- A pointer to itself is returned by the plain scalar field class to which the operator belongs
◆ operator+=() [2/2]
Overloaded operator to add a given scalar field.
The unary operator += adds a given scalar field to the plainsf and returns
a pointer to itself.
- Parameters
-
a | is a reference to another sfield to be added to the member field |
- Returns
- A pointer to itself is returned by the plain scalar field class to which the operator belongs
◆ operator-=() [1/2]
Overloaded operator to subtract a given plain scalar field.
The unary operator -= subtracts a given plain scalar field from the plainsf and returns
a pointer to itself.
- Parameters
-
a | is a reference to another plainsf to be subtracted from the member field |
- Returns
- A pointer to itself is returned by the plain scalar field class to which the operator belongs
◆ operator-=() [2/2]
Overloaded operator to subtract a given scalar field.
The unary operator -= subtracts a given scalar field from the plainsf and returns
a pointer to itself.
- Parameters
-
a | is a reference to another sfield to be subtracted from the member field |
- Returns
- A pointer to itself is returned by the plain scalar field class to which the operator belongs
◆ operator=() [1/3]
void plainsf::operator= |
( |
plainsf & |
a | ) |
|
Overloaded operator to assign another plain scalar field to the plain scalar field.
The operator = copies the contents of the input plain scalar field to itself.
- Parameters
-
a | is a plainsf to be assigned to the plain scalar field |
◆ operator=() [2/3]
void plainsf::operator= |
( |
real |
a | ) |
|
Overloaded operator to assign a scalar value to the plain scalar field.
The operator = assigns a real value to all the scalar field.
- Parameters
-
a | is a real number to be assigned to the plain scalar field |
◆ operator=() [3/3]
void plainsf::operator= |
( |
sfield & |
a | ) |
|
Overloaded operator to assign another scalar field to the plain scalar field.
The operator = copies the contents of the input scalar field to itself.
- Parameters
-
a | is a sfield to be assigned to the scalar field |
◆ syncData()
void plainsf::syncData |
( |
| ) |
|
|
inline |
Function to synchronise data across all processors when performing parallel computations.
This function calls the \ref mpidata#syncData "syncData" function of mpidata class to perform perform data-transfer and thus update
the sub-domain boundary pads.
The documentation for this class was generated from the following files: