Saras
Finite   Difference   Solver   for   Fluid   Dynamics   Simulations
Public Member Functions | Public Attributes | List of all members
plainsf Class Reference

Plain scalar field class to store simple scalar fields with no differentiation or interpolation. More...

#include "lib/plainsf.h"

Public Member Functions

 plainsf (const grid &gridData, const sfield &refF)
 Constructor of the plainsf class. More...
 
plainsfoperator+= (plainsf &a)
 Overloaded operator to add a given plain scalar field. More...
 
plainsfoperator-= (plainsf &a)
 Overloaded operator to subtract a given plain scalar field. More...
 
plainsfoperator+= (sfield &a)
 Overloaded operator to add a given scalar field. More...
 
plainsfoperator-= (sfield &a)
 Overloaded operator to subtract a given scalar field. More...
 
plainsfoperator*= (real a)
 Overloaded operator to multiply a scalar value to the scalar field. More...
 
void operator= (plainsf &a)
 Overloaded operator to assign another plain scalar field to the plain scalar field. More...
 
void operator= (sfield &a)
 Overloaded operator to assign another scalar field to the plain scalar field. More...
 
void operator= (real a)
 Overloaded operator to assign a scalar value to the plain scalar field. More...
 
void gradient (plainvf &gradF, const vfield &V)
 Operator to compute the gradient of the plain scalar field. More...
 
void syncData ()
 Function to synchronise data across all processors when performing parallel computations. More...
 
real fxMax ()
 Function to extract the maximum value from the plain scalar field. More...
 
real fxMean ()
 Function to compute the mean value from the plain scalar field. More...
 

Public Attributes

blitz::Array< real, 3 > F
 
blitz::Range xColl
 
blitz::Range yColl
 
blitz::Range zColl
 
mpidatampiHandle
 

Detailed Description

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

Constructor & Destructor Documentation

◆ 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
gridDatais a const reference to the global data contained in the grid class
refFis a const reference to a sample sfield according to which the plainsf is resized

Member Function Documentation

◆ fxMax()

real plainsf::fxMax ( )
inline

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()

real plainsf::fxMean ( )
inline

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()

void plainsf::gradient ( plainvf gradF,
const vfield V 
)
inline

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
gradFis a reference to a plain vector field (plainvf) into which the computed gradient must be written.
Vis 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
ais 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]

plainsf & plainsf::operator+= ( plainsf a)

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
ais 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]

plainsf & plainsf::operator+= ( sfield a)

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
ais 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]

plainsf & plainsf::operator-= ( plainsf a)

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
ais 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]

plainsf & plainsf::operator-= ( sfield a)

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
ais 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
ais 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
ais 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
ais 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: