Saras
Finite Difference Solver for Fluid Dynamics Simulations
|
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... | |
plainvf & | operator+= (plainvf &a) |
Overloaded operator to add a given plain vector field. More... | |
plainvf & | operator-= (plainvf &a) |
Overloaded operator to subtract a given plain vector field. More... | |
plainvf & | operator+= (vfield &a) |
Overloaded operator to add a given vector field. More... | |
plainvf & | operator-= (vfield &a) |
Overloaded operator to subtract a given vector field. More... | |
plainvf & | operator*= (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 |
mpidata * | mpiVxData |
mpidata * | mpiVyData |
mpidata * | mpiVzData |
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 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.
gridData | is a const reference to the global data in the grid class |
refV | is a const reference to a vfield according to whose components the arrays of plainvf are resized |
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.
a | is a real number to be multiplied to the plain vector field |
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.
a | is a reference to the plainvf to be added to the member fields |
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.
a | is a reference to the vfield to be added to the member fields |
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.
a | is a reference to the plainvf to be subtracted from the member fields |
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.
a | is a reference to the vfield to be subtracted from the member fields |
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.
a | is a plainvf to be assigned to the plain vector field |
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.
a | is a real number to be assigned to the plain vector field |
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.
a | is a vfield to be assigned to the plain vector field |
|
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.
|
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.
|
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.
|
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.