lib/field/field.cc
field::field(const grid &gridData, std::string fieldName, const bool xStag, const bool yStag, const bool zStag):
             gridData(gridData),
             rankData(inputParams),
             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, 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 staggering details.
 *          It initializes and stores necessary RectDomain objects for getting the core slice and various offset slices for performing
 *          finite difference operations.
 *          The upper and lower bounds necessary for the array are also calculated depending on the directions along which the mesh is
 *          staggered and those along which it is collocated.
 *          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 contained in the grid class
 * \param   xStag is a const boolean value that is <B>true</B> when the grid is staggered along the x-direction and <B>false</B> when it is not
 * \param   yStag is a const boolean value that is <B>true</B> when the grid is staggered along the y-direction and <B>false</B> when it is not
 * \param   zStag is a const boolean value that is <B>true</B> when the grid is staggered along the z-direction and <B>false</B> when it is not
 ********************************************************************************************************************************************
 */
\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 staggering details.
It initializes and stores necessary RectDomain objects for getting the core slice and various offset slices for performing
finite difference operations.
The upper and lower bounds necessary for the array are also calculated depending on the directions along which the mesh is
staggered and those along which it is collocated.
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 contained in the grid class
\param   xStag is a const boolean value that is true when the grid is staggered along the x-direction and false when it is not
\param   yStag is a const boolean value that is true when the grid is staggered along the y-direction and false when it is not
\param   zStag is a const boolean value that is true when the grid is staggered along the z-direction and false when it is not
\ 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 staggering details . It initializes and stores necessary RectDomain objects for getting the core slice and various offset slices for performing finite difference operations . The upper and lower bounds necessary for the array are also calculated depending on the directions along which the mesh is staggered and those along which it is collocated . 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 contained in the grid class \ param xStag is a const boolean value that is true when the grid is staggered along the x - direction and false when it is not \ param yStag is a const boolean value that is true when the grid is staggered along the y - direction and false when it is not \ param zStag is a const boolean value that is true when the grid is staggered along the z - direction and false when it is not
field::field(const grid &gridData, std::string fieldName, const bool xStag, const bool yStag, const bool zStag):
             gridData(gridData),
             rankData(inputParams),
             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, 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 ) , rankData ( inputParams ) , 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 , 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 staggering details.
\ 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 staggering details .