Saras
Finite Difference Solver for Fluid Dynamics Simulations
|
The derived class from poisson to perform multi-grid operations on a 3D grid. More...
#include "lib/poisson.h"
Public Member Functions | |
multigrid_d3 (const grid &mesh, const parser &solParam) | |
Constructor of the multigrid_d3 class derived from the poisson class. More... | |
real | testProlong () |
Function to test whether prolongation operations are interpolating correctly. More... | |
real | testTransfer () |
Function to test whether strided data transfer is performing as expected. More... | |
real | testPeriodic () |
Function to test whether periodic BC is being implemented properly. More... | |
![]() | |
poisson (const grid &mesh, const parser &solParam) | |
Constructor of the base poisson class. More... | |
void | mgSolve (plainsf &inFn, const plainsf &rhs) |
The core, publicly accessible function of poisson to compute the solution for the Poisson equation. More... | |
Additional Inherited Members | |
![]() | |
void | setLocalSizeIndex () |
Function to calculate the local size indices of sub-domains after MPI domain decomposition. More... | |
void | initializeArrays () |
Function to initialize the arrays used in multi-grid. More... | |
void | copyStaggrDerivs () |
Function to copy the staggered grid derivatives from the grid class to local arrays. More... | |
void | setCoefficients () |
Function to set the coefficients used for calculating laplacian and in smoothing. More... | |
void | setStagBounds () |
Function to set the RectDomain variables for all future references throughout the poisson solver. More... | |
void | vCycle () |
Function to perform one loop of V-cycle. More... | |
![]() | |
static bool | isOdd (int x) |
![]() | |
int | vLevel |
int | maxCount |
bool | zeroBC |
const grid & | mesh |
const parser & | inputParams |
blitz::Range | all |
blitz::Array< blitz::Array< real, 3 >, 1 > | pressureData |
blitz::Array< blitz::Array< real, 3 >, 1 > | residualData |
blitz::Array< blitz::Array< real, 3 >, 1 > | tmpDataArray |
blitz::Array< blitz::Array< real, 3 >, 1 > | smoothedPres |
blitz::Array< blitz::RectDomain< 3 >, 1 > | stagFull |
blitz::Array< blitz::RectDomain< 3 >, 1 > | stagCore |
blitz::Array< int, 1 > | xEnd |
blitz::Array< int, 1 > | yEnd |
blitz::Array< int, 1 > | zEnd |
blitz::Array< int, 1 > | mgSizeArray |
blitz::Array< int, 1 > | strideValues |
blitz::TinyVector< int, 3 > | localSizeIndex |
blitz::Array< MPI_Request, 1 > | recvRequest |
blitz::Array< MPI_Status, 1 > | recvStatus |
blitz::Array< real, 1 > | hx |
blitz::Array< real, 1 > | hy |
blitz::Array< real, 1 > | hz |
blitz::Array< real, 1 > | hx2 |
blitz::Array< real, 1 > | hz2 |
blitz::Array< real, 1 > | hzhx |
blitz::Array< real, 1 > | hxhy |
blitz::Array< real, 1 > | hyhz |
blitz::Array< real, 1 > | hxhyhz |
blitz::Array< blitz::Array< real, 1 >, 1 > | xixx |
blitz::Array< blitz::Array< real, 1 >, 1 > | xix2 |
blitz::Array< blitz::Array< real, 1 >, 1 > | etyy |
blitz::Array< blitz::Array< real, 1 >, 1 > | ety2 |
blitz::Array< blitz::Array< real, 1 >, 1 > | ztzz |
blitz::Array< blitz::Array< real, 1 >, 1 > | ztz2 |
blitz::Array< MPI_Datatype, 1 > | xMGArray |
blitz::Array< MPI_Datatype, 1 > | yMGArray |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgSendLft |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgSendRgt |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgRecvLft |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgRecvRgt |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgSendFrn |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgSendBak |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgRecvFrn |
blitz::Array< blitz::TinyVector< int, 3 >, 1 > | mgRecvBak |
The derived class from poisson to perform multi-grid operations on a 3D grid.
The 3D implementation of the multi-grid method differs from the 2D version in that the coarsen, smooth etc use a different equation with extra terms, and the prolong operation needs to perform extra interpolation steps in the y-direction.
Constructor of the multigrid_d3 class derived from the poisson class.
The constructor of the derived multigrid_d3 class frst calls the base poisson class with the arguments passed to it. It then calls a series of functions in sequence to initialize all the necessary parameters and data structures to store and manipulate the multi-grid data. Since the multi-grid solver operates on the staggered grid, it first computes the limits of the full and core staggered grid, as the grid class does the same for the collocated grid. It then initializes all the Range objects to obtain the correct slices of the full grid at various levels of the V-cycle. It also copies the staggered grid derivatives to local arrays with wide pads, and finally generates the MPI datatypes for data transfer between sub-domain boundaries.
mesh | is a const reference to the global data contained in the grid class |
solParam | is a const reference to the user-set parameters contained in the parser class |
|
virtual |
Function to test whether periodic BC is being implemented properly.
The function populates the arrays with predetermined values at all locations. It then calls imposeBC function at different vLevels and checks if the correct values of the functions are imposed at boundaries This done by printing the contents of the arrays for visual inspection for now.
Reimplemented from poisson.
|
virtual |
Function to test whether prolongation operations are interpolating correctly.
The function populates the arrays with predetermined values at all locations. It then calls prolong function at a lower vLevel and checks if the data is being interpolated correctly at higher vLevel This done by returning the average deviation from correct values as a real value
Reimplemented from poisson.
|
virtual |
Function to test whether strided data transfer is performing as expected.
The function populates the arrays with predetermined values at all locations. It then calls updatePads at different vLevels and checks is the data is being transferred along x and y directions This done by printing the contents of the arrays for visual inspection for now.
Reimplemented from poisson.