lib/poisson/poisson_d2.cc
/**
 ********************************************************************************************************************************************
 * \brief   Constructor of the multigrid_d2 class derived from the poisson class
 *
 *          The constructor of the derived multigrid_d2 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.
 *
 * \param   mesh is a const reference to the global data contained in the grid class
 * \param   solParam is a const reference to the user-set parameters contained in the parser class
 ********************************************************************************************************************************************
 */
\brief   Constructor of the multigrid_d2 class derived from the poisson class
The constructor of the derived multigrid_d2 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.

\param   mesh is a const reference to the global data contained in the grid class
\param   solParam is a const reference to the user-set parameters contained in the parser class
\ brief Constructor of the multigrid_d2 class derived from the poisson class The constructor of the derived multigrid_d2 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 . \ param mesh is a const reference to the global data contained in the grid class \ param solParam is a const reference to the user - set parameters contained in the parser class
multigrid_d2::multigrid_d2(const grid &mesh, const parser &solParam): poisson(mesh, solParam) {
    setLocalSizeIndex();
    setStagBounds();
    setCoefficients();
    copyStaggrDerivs();
    initializeArrays();
    createMGSubArrays();
#ifdef TEST_POISSON
    initDirichlet();
#endif
}
multigrid_d2 :: multigrid_d2 ( const grid & mesh , const parser & solParam ) : poisson ( mesh , solParam ) { setLocalSizeIndex ( ) ; setStagBounds ( ) ; setCoefficients ( ) ; copyStaggrDerivs ( ) ; initializeArrays ( ) ; createMGSubArrays ( ) ; #ifdef TEST_POISSON initDirichlet ( ) ; #endif }
\brief   Constructor of the multigrid_d2 class derived from the poisson class
          The constructor of the derived multigrid_d2 class frst calls the base poisson class with the arguments passed to it.
\ brief Constructor of the multigrid_d2 class derived from the poisson class The constructor of the derived multigrid_d2 class frst calls the base poisson class with the arguments passed to it .
// GET THE localSizeIndex AS IT WILL BE USED TO SET THE FULL AND CORE LIMITS OF THE STAGGERED POINTS // SET THE FULL AND CORE LIMTS SET ABOVE USING THE localSizeIndex VARIABLE SET ABOVE // SET VALUES OF COEFFICIENTS USED FOR COMPUTING LAPLACIAN // COPY THE STAGGERED GRID DERIVATIVES TO LOCAL ARRAYS // RESIZE AND INITIALIZE NECESSARY DATA-STRUCTURES // CREATE THE MPI SUB-ARRAYS NECESSARY TO TRANSFER DATA ACROSS SUB-DOMAINS AT ALL MESH LEVELS // INITIALIZE DIRICHLET BCs WHEN TESTING THE POISSON SOLVER