lib/field/field.cc
/**
 ********************************************************************************************************************************************
 * \brief   Constructor of the field class
 *
 *          The field class decides the limits necessary for a 3D array to store the
 *          data as per the specified grid indexing (half or full index).
 *          It initializes and stores necessary RectDomain objects for getting the
 *          core slice and bulk slice.
 *          Moreover, various offset slices of both core and bulk, used for performing
 *          finite difference operations, are also defined in this class.
 *          The upper and lower bounds of the array are calculated based on the directions
 *          along which the variable is staggered (or half-indexed).
 *          Finally, a blitz array to store the data of the field is resized according
 *          to the limits and initialized to 0.
 *
 * \param   gridData is a const reference to the global data in the grid class
 * \param   xStag is a const boolean value that is <B>true</B> when F is staggered (half-indexed) along x-direction
 * \param   yStag is a const boolean value that is <B>true</B> when F is staggered (half-indexed) along y-direction
 * \param   zStag is a const boolean value that is <B>true</B> when F is staggered (half-indexed) along z-direction
 ********************************************************************************************************************************************
 */
\brief   Constructor of the field class
The field class decides the limits necessary for a 3D array to store the
data as per the specified grid indexing (half or full index).
It initializes and stores necessary RectDomain objects for getting the
core slice and bulk slice.
Moreover, various offset slices of both core and bulk, used for performing
finite difference operations, are also defined in this class.
The upper and lower bounds of the array are calculated based on the directions
along which the variable is staggered (or half-indexed).
Finally, a blitz array to store the data of the field is resized according
to the limits and initialized to 0.


\ brief Constructor of the field class The field class decides the limits necessary for a 3D array to store the data as per the specified grid indexing ( half or full index ) . It initializes and stores necessary RectDomain objects for getting the core slice and bulk slice . Moreover various offset slices of both core and bulk used for performing finite difference operations are also defined in this class . The upper and lower bounds of the array are calculated based on the directions along which the variable is staggered ( or half - indexed ) . Finally a blitz array to store the data of the field is resized according to the limits and initialized to 0 .
field::field(const grid &gridData, std::string fieldName, const bool xStag, const bool yStag, const bool zStag):
             gridData(gridData),
             xStag(xStag), yStag(yStag), zStag(zStag)
{
    this->fieldName = fieldName;
    fSize = gridData.collocFullSize;
    flBound = gridData.collocFullDomain.lbound();
    if (xStag) {
        fSize(0) = gridData.staggrFullSize(0);
        flBound(0) = gridData.staggrFullDomain.lbound()(0);
    }    
    if (yStag) {
        fSize(1) = gridData.staggrFullSize(1);
        flBound(1) = gridData.staggrFullDomain.lbound()(1);
     }
    if (zStag) {
        fSize(2) = gridData.staggrFullSize(2);
        flBound(2) = gridData.staggrFullDomain.lbound()(2);
    }
    F.resize(fSize);
    F.reindexSelf(flBound);
    mpiHandle = new mpidata(F, gridData.rankData);
    setCoreSlice();
    setBulkSlice();
    setWallSlices();
    setInterpolationSlices();
    mpiHandle->createSubarrays(fSize, cuBound + 1, gridData.padWidths, xStag, yStag);
    F = 0.0;
}
field :: field ( const grid & gridData , std :: string fieldName , const bool xStag , const bool yStag , const bool zStag ) : gridData ( gridData ) , xStag ( xStag ) , yStag ( yStag ) , zStag ( zStag ) { this -> fieldName = fieldName ; fSize = gridData . collocFullSize ; flBound = gridData . collocFullDomain . lbound ( ) ; if ( xStag ) { fSize ( 0 ) = gridData . staggrFullSize ( 0 ) ; flBound ( 0 ) = gridData . staggrFullDomain . lbound ( ) ( 0 ) ; } if ( yStag ) { fSize ( 1 ) = gridData . staggrFullSize ( 1 ) ; flBound ( 1 ) = gridData . staggrFullDomain . lbound ( ) ( 1 ) ; } if ( zStag ) { fSize ( 2 ) = gridData . staggrFullSize ( 2 ) ; flBound ( 2 ) = gridData . staggrFullDomain . lbound ( ) ( 2 ) ; } F . resize ( fSize ) ; F . reindexSelf ( flBound ) ; mpiHandle = new mpidata ( F , gridData . rankData ) ; setCoreSlice ( ) ; setBulkSlice ( ) ; setWallSlices ( ) ; setInterpolationSlices ( ) ; mpiHandle -> createSubarrays ( fSize , cuBound + 1 , gridData . padWidths , xStag , yStag ) ; F = 0.0 ; }
\brief   Constructor of the field class
          The field class decides the limits necessary for a 3D array to store the
          data as per the specified grid indexing (half or full index).
\ brief Constructor of the field class The field class decides the limits necessary for a 3D array to store the data as per the specified grid indexing ( half or full index ) .