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

Contains all the global variables related to the grid, its slices, limits, and grid derivatives used throughout the solver. More...

#include "lib/grid.h"

Public Member Functions

 grid (const parser &solParam, parallel &parallelData)
 Constructor of the grid class. More...
 
bool pointInDomain (blitz::TinyVector< int, 3 > gloIndex) const
 Function to check if a given set of global indices lie within a rank. More...
 
blitz::TinyVector< int, 3 > glo2loc (blitz::TinyVector< int, 3 > gloIndex) const
 Function to obtain local indices from global indices. More...
 
blitz::TinyVector< int, 3 > loc2glo (blitz::TinyVector< int, 3 > locIndex) const
 Function to obtain global indices from local indices. More...
 

Public Attributes

const parserinputParams
 A const reference to the global variables stored in the parser class to access user set parameters.
 
const parallelrankData
 A const reference to the global variables stored in the parallel class to access MPI related parameters.
 
blitz::TinyVector< int, 3 > collocCoreSize
 The sizes of the core of MPI decomposed sub-domains without the pads (collocated points) - localNx, localNy, localNz.
 
blitz::TinyVector< int, 3 > collocFullSize
 The sizes of the MPI decomposed sub-domains including the pads on all sides (collocated points) - collocCoreSize + 2*padWidths.
 
blitz::TinyVector< int, 3 > staggrCoreSize
 The sizes of the core of MPI decomposed sub-domains without the pads (staggered points)
 
blitz::TinyVector< int, 3 > staggrFullSize
 The sizes of the MPI decomposed sub-domains including the pads on all sides (staggered points) - staggrCoreSize + 2*padWidths.
 
blitz::TinyVector< int, 3 > padWidths
 The sizes of the pad widths along the three directions - padX, padY, padZ.
 
blitz::TinyVector< int, 3 > globalSize
 The size of the entire computational domain excluding the pads at the boundary of full domain - globalNx, globalNy, globalNz.
 
blitz::TinyVector< int, 3 > subarrayEnds
 The end indices of the MPI decomposed sub-domains within the global indexing of the full staggered grid - ztEn, etEn, xiEn.
 
blitz::TinyVector< int, 3 > subarrayStarts
 The start indices of the MPI decomposed sub-domains within the global indexing of the full staggered grid - ztSt, etSt, xiSt.
 
real dXi
 Grid spacing in the transformed plane along the \( \xi \) direction.
 
real dEt
 Grid spacing in the transformed plane along the \( \eta \) direction.
 
real dZt
 Grid spacing in the transformed plane along the \( \zeta \) direction.
 
real xLen
 Length of the physical computational domain along the x direction.
 
real yLen
 Length of the physical computational domain along the y direction.
 
real zLen
 Length of the physical computational domain along the z direction.
 
blitz::Array< int, 1 > sizeArray
 Array of collocated grid sizes such that the corresponding staggered grid will be multi-grid compatible.
 
blitz::TinyVector< int, 3 > sizeIndex
 Vector of indices pointing to the sizeArray that determines the global full domain size along the 3 directions.
 
blitz::RectDomain< 3 > collocCoreDomain
 RectDomain object that defines the slice for the core of the local MPI decomposed sub-domain (collocated points)
 
blitz::RectDomain< 3 > collocFullDomain
 RectDomain object that defines the slice for the full extent of the local MPI decomposed sub-domain (collocated points)
 
blitz::RectDomain< 3 > staggrCoreDomain
 RectDomain object that defines the slice for the core of the local MPI decomposed sub-domain (staggered points)
 
blitz::RectDomain< 3 > staggrFullDomain
 RectDomain object that defines the slice for the full extent of the local MPI decomposed sub-domain (staggered points)
 
blitz::Array< real, 1 > xColloc
 Collocated grid along the x-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > yColloc
 Collocated grid along the y-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > zColloc
 Collocated grid along the z-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > xStaggr
 Staggered grid along the x-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > yStaggr
 Staggered grid along the y-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > zStaggr
 Staggered grid along the z-direction defined locally within MPI decomposed sub-domains.
 
blitz::Array< real, 1 > xCollocGlobal
 Collocated grid along the x-direction for the full global domain.
 
blitz::Array< real, 1 > yCollocGlobal
 Collocated grid along the y-direction for the full global domain.
 
blitz::Array< real, 1 > zCollocGlobal
 Collocated grid along the z-direction for the full global domain.
 
blitz::Array< real, 1 > xStaggrGlobal
 Staggered grid along the x-direction for the full global domain.
 
blitz::Array< real, 1 > yStaggrGlobal
 Staggered grid along the y-direction for the full global domain.
 
blitz::Array< real, 1 > zStaggrGlobal
 Staggered grid along the z-direction for the full global domain.
 
blitz::Array< real, 1 > xi_xColloc
 Array of the grid derivatives \( \frac{\partial\xi}{\partial x} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > xi_xStaggr
 Array of the grid derivatives \( \frac{\partial\xi}{\partial x} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > xixxColloc
 Array of the grid derivatives \( \frac{\partial^2 \xi}{\partial x^2} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > xixxStaggr
 Array of the grid derivatives \( \frac{\partial^2 \xi}{\partial x^2} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > xix2Colloc
 Array of the grid derivatives \( \left(\frac{\partial\xi}{\partial x}\right)^2 \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > xix2Staggr
 Array of the grid derivatives \( \left(\frac{\partial\xi}{\partial x}\right)^2 \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > et_yColloc
 Array of the grid derivatives \( \frac{\partial\eta}{\partial y} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > et_yStaggr
 Array of the grid derivatives \( \frac{\partial\eta}{\partial y} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > etyyColloc
 Array of the grid derivatives \( \frac{\partial^2 \eta}{\partial y^2} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > etyyStaggr
 Array of the grid derivatives \( \frac{\partial^2 \eta}{\partial y^2} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ety2Colloc
 Array of the grid derivatives \( \left(\frac{\partial\eta}{\partial y}\right)^2 \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ety2Staggr
 Array of the grid derivatives \( \left(\frac{\partial\eta}{\partial y}\right)^2 \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > zt_zColloc
 Array of the grid derivatives \( \frac{\partial\zeta}{\partial z} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > zt_zStaggr
 Array of the grid derivatives \( \frac{\partial\zeta}{\partial z} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ztzzColloc
 Array of the grid derivatives \( \frac{\partial^2 \zeta}{\partial z^2} \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ztzzStaggr
 Array of the grid derivatives \( \frac{\partial^2 \zeta}{\partial z^2} \) at staggered grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ztz2Colloc
 Array of the grid derivatives \( \left(\frac{\partial\zeta}{\partial z}\right)^2 \) at collocated grid points, defined locally within each sub-domain.
 
blitz::Array< real, 1 > ztz2Staggr
 Array of the grid derivatives \( \left(\frac{\partial\zeta}{\partial z}\right)^2 \) at staggered grid points, defined locally within each sub-domain.
 

Detailed Description

Contains all the global variables related to the grid, its slices, limits, and grid derivatives used throughout the solver.

Constructor & Destructor Documentation

◆ grid()

grid::grid ( const parser solParam,
parallel parallelData 
)

Constructor of the grid class.

     The class constructor initializes the mesh for computational problem.
     The pad widths, global grid limits in the full domain, local grid limits in the MPI decomposed sub-domains,
     grid spacings, domain lengths, etc., along each direction are set.
     Appropriate stretching functions are chosen according to user preferences and their corresponding grid
     transformation derivatives are also computed and stored.
Parameters
solParamis a const reference to the global data contained in the parser class
parallelDatais a reference to the global data contained in the parallel class

Depending on the finite-difference scheme chosen for calculating derivatives, set the padWidths along all directions.

Member Function Documentation

◆ glo2loc()

blitz::TinyVector< int, 3 > grid::glo2loc ( blitz::TinyVector< int, 3 >  gloIndex) const
inline

Function to obtain local indices from global indices.

     Based on the data from rankData, the function computes the local indices
     in a manner that is consistent for both staggered and collocated indices.
Parameters
gloIndexis a blitz TinyVector that contains the global indices for which local indices have to be found
Returns
A blitz TinyVector that contains the local indices computed from the given global indices

◆ loc2glo()

blitz::TinyVector< int, 3 > grid::loc2glo ( blitz::TinyVector< int, 3 >  locIndex) const
inline

Function to obtain global indices from local indices.

     Based on the data from rankData, the function computes the global indices
     in a manner that is consistent for both staggered and collocated indices.
Parameters
locIndexis a blitz TinyVector that contains the local indices for which global indices have to be found
Returns
A blitz TinyVector that contains the global indices computed from the given local indices

◆ pointInDomain()

bool grid::pointInDomain ( blitz::TinyVector< int, 3 >  gloIndex) const
inline

Function to check if a given set of global indices lie within a rank.

     Based on the data from rankData, the function checks if the given point lies within the subdomain of a processor
     The processor in whose sub-domain the point lies returns true.
Parameters
gloIndexis a blitz TinyVector that contains the global indices to check if it lies within an MPI subdomain
Returns
A boolean value that evaluates to true if the point lies within the sub-domain

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