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

Plain vector field class to store simple vector fields with no additional operators like differentiation or interpolation. More...

#include "lib/plainvf.h"

Public Member Functions

 plainvf (const grid &gridData, const vfield &refV)
 Constructor of the plainvf class. More...
 
plainvfoperator+= (plainvf &a)
 Overloaded operator to add a given plain vector field. More...
 
plainvfoperator-= (plainvf &a)
 Overloaded operator to subtract a given plain vector field. More...
 
plainvfoperator+= (vfield &a)
 Overloaded operator to add a given vector field. More...
 
plainvfoperator-= (vfield &a)
 Overloaded operator to subtract a given vector field. More...
 
plainvfoperator*= (real a)
 Overloaded operator to multiply a scalar value to the plain vector field. More...
 
void operator= (plainvf &a)
 Overloaded operator to assign another plain vector field to the plain vector field. More...
 
void operator= (vfield &a)
 Overloaded operator to assign another vector field to the plain vector field. More...
 
void operator= (real a)
 Overloaded operator to assign a scalar value to the plain vector field. More...
 
void syncData ()
 Function to synchronise data across all processors when performing parallel computations. More...
 
real vxMax ()
 Function to extract the maximum value from the Vx component of the plain vector field. More...
 
real vyMax ()
 Function to extract the maximum value from the Vy component of the plain vector field. More...
 
real vzMax ()
 Function to extract the maximum value from the Vz component of the plain vector field. More...
 

Public Attributes

blitz::Array< real, 3 > Vx
 
blitz::Array< real, 3 > Vy
 
blitz::Array< real, 3 > Vz
 
mpidatampiVxData
 
mpidatampiVyData
 
mpidatampiVzData
 

Detailed Description

Plain vector field class to store simple vector fields with no additional operators like differentiation or interpolation.

The class stores vector fields in the form of three Blitz arrays The vector field is stored in such a way that the components are face-centered scalar fields, with:

Constructor & Destructor Documentation

◆ plainvf()

plainvf::plainvf ( const grid gridData,
const vfield refV 
)

Constructor of the plainvf class.

     Three blitz arrays to store the data of the three components are initialized.
     The name for the plain vector field as given by the user is also assigned.
Parameters
gridDatais a const reference to the global data in the grid class
refVis a const reference to a vfield according to whose components the arrays of plainvf are resized

Member Function Documentation

◆ operator*=()

plainvf & plainvf::operator*= ( real  a)

Overloaded operator to multiply a scalar value to the plain vector field.

     The unary operator *= multiplies a real value to all the fields (Vx, Vy and Vz) stored in plainvf and returns
     a pointer to itself.
Parameters
ais a real number to be multiplied to the plain vector field
Returns
A pointer to itself is returned by the plain vector field class to which the operator belongs

◆ operator+=() [1/2]

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

Overloaded operator to add a given plain vector field.

     The unary operator += adds a given plain vector field to the plainvf and returns
     a pointer to itself.
Parameters
ais a reference to the plainvf to be added to the member fields
Returns
A pointer to itself is returned by the plain vector field object to which the operator belongs

◆ operator+=() [2/2]

plainvf & plainvf::operator+= ( vfield a)

Overloaded operator to add a given vector field.

     The unary operator += adds a given vector field to the plainvf and returns
     a pointer to itself.
Parameters
ais a reference to the vfield to be added to the member fields
Returns
A pointer to itself is returned by the plain vector field object to which the operator belongs

◆ operator-=() [1/2]

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

Overloaded operator to subtract a given plain vector field.

     The unary operator -= subtracts a given plain vector field from the plainvf and returns
     a pointer to itself.
Parameters
ais a reference to the plainvf to be subtracted from the member fields
Returns
A pointer to itself is returned by the plain vector field object to which the operator belongs

◆ operator-=() [2/2]

plainvf & plainvf::operator-= ( vfield a)

Overloaded operator to subtract a given vector field.

     The unary operator -= subtracts a given vector field from the plainvf and returns
     a pointer to itself.
Parameters
ais a reference to the vfield to be subtracted from the member fields
Returns
A pointer to itself is returned by the plain vector field object to which the operator belongs

◆ operator=() [1/3]

void plainvf::operator= ( plainvf a)

Overloaded operator to assign another plain vector field to the plain vector field.

     The operator = assigns all the three blitz arrays of a plain vector field (plainvf)
     to the corresponding three arrays of the plainvf.
Parameters
ais a plainvf to be assigned to the plain vector field

◆ operator=() [2/3]

void plainvf::operator= ( real  a)

Overloaded operator to assign a scalar value to the plain vector field.

     The operator = assigns a real value to all the fields (Vx, Vy and Vz) stored in plainvf.
Parameters
ais a real number to be assigned to the plain vector field

◆ operator=() [3/3]

void plainvf::operator= ( vfield a)

Overloaded operator to assign another vector field to the plain vector field.

     The operator = assigns all the three fields of a given vector field (vfield)
     to the corresponding three arrays of the plainvf.
Parameters
ais a vfield to be assigned to the plain vector field

◆ syncData()

void plainvf::syncData ( )
inline

Function to synchronise data across all processors when performing parallel computations.

     Each of the individual field components have to send and receive data across its MPI decomposed sub-domains.
     This function calls the \ref mpidata#syncData "syncData" function for each component to update the sub-domain boundary pads.

◆ vxMax()

real plainvf::vxMax ( )
inline

Function to extract the maximum value from the Vx component of the plain vector 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)

◆ vyMax()

real plainvf::vyMax ( )
inline

Function to extract the maximum value from the Vy component of the plain vector 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)

◆ vzMax()

real plainvf::vzMax ( )
inline

Function to extract the maximum value from the Vz component of the plain vector 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)

The documentation for this class was generated from the following files: