src/solvers/hydro/hydro_d3.cc
hydro_d3::hydro_d3(const grid &mesh, const parser &solParam, parallel &mpiParam):
            hydro(mesh, solParam, mpiParam),
            mgSolver(mesh, inputParams)
{
    // SET VALUES OF COEFFICIENTS USED FOR COMPUTING LAPLACIAN
    setCoefficients();

    // INITIALIZE VARIABLES
    if (inputParams.restartFlag) {
        // Fields to be read from HDF5 file are passed to reader class as a vector
        std::vector<field> readFields;

        // Populate the vector with required fields
        readFields.push_back(V.Vx);
        readFields.push_back(V.Vy);
        readFields.push_back(V.Vz);
        readFields.push_back(P.F);

        // Initialize reader object
        reader dataReader(mesh, readFields);

        time = dataReader.readData();

    } else {
        time = 0.0;

        // INITIALIZE PRESSURE TO 1.0 THROUGHOUT THE DOMAIN
        P = 1.0;

        // INITIALIZE VARIABLES
        initial *initCond;
        switch (inputParams.icType) {
            case 0: initCond = new zeroInitial(mesh);
                break;
            case 1: initCond = new taylorGreen(mesh);
                break;
            case 2: initCond = new channelSine(mesh);
                break;
            case 3: initCond = new channelRand(mesh);
                break;
            default: initCond = new zeroInitial(mesh);
        }
        initCond->initializeField(V);
    }

    checkPeriodic();

    // Initialize velocity boundary conditions
    initVBC();

    // Initialize velocity forcing field
    initVForcing();

    imposeUBCs();
    imposeVBCs();
    imposeWBCs();
}
/**
 ********************************************************************************************************************************************
 * \brief   Constructor of the hydro_d3 class derived from the base hydro class
 *
 *          The constructor passes its arguments to the base hydro class and then initializes all the scalar and
 *          vector fields necessary for solving the NS equations.
 *          The various coefficients for solving the equations are also set by a call to the \ref setCoefficients function.
 *          Based on the problem type specified by the user in the parameters file, and stored by the \ref parser class as
 *          \ref parser#probType "probType", the appropriate boundary conditions are specified.
 *
 * \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 hydro_d3 class derived from the base hydro class
The constructor passes its arguments to the base hydro class and then initializes all the scalar and
vector fields necessary for solving the NS equations.
The various coefficients for solving the equations are also set by a call to the \ref setCoefficients function.
Based on the problem type specified by the user in the parameters file, and stored by the \ref parser class as
\ref parser#probType "probType", the appropriate boundary conditions are specified.

\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 hydro_d3 class derived from the base hydro class The constructor passes its arguments to the base hydro class and then initializes all the scalar and vector fields necessary for solving the NS equations . The various coefficients for solving the equations are also set by a call to the \ ref setCoefficients function . Based on the problem type specified by the user in the parameters file and stored by the \ ref parser class as \ ref parser#probType " probType " the appropriate boundary conditions are specified . \ 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
hydro_d3::hydro_d3(const grid &mesh, const parser &solParam, parallel &mpiParam):
            hydro(mesh, solParam, mpiParam),
            mgSolver(mesh, inputParams)
{
    setCoefficients();
    if (inputParams.restartFlag) {
        std::vector<field> readFields;
        readFields.push_back(V.Vx);
        readFields.push_back(V.Vy);
        readFields.push_back(V.Vz);
        readFields.push_back(P.F);
        reader dataReader(mesh, readFields);
        time = dataReader.readData();
    } else {
        time = 0.0;
        P = 1.0;
        initial *initCond;
        switch (inputParams.icType) {
            case 0: initCond = new zeroInitial(mesh);
                break;
            case 1: initCond = new taylorGreen(mesh);
                break;
            case 2: initCond = new channelSine(mesh);
                break;
            case 3: initCond = new channelRand(mesh);
                break;
            default: initCond = new zeroInitial(mesh);
        }
        initCond->initializeField(V);
    }
    checkPeriodic();
    initVBC();
    initVForcing();
    imposeUBCs();
    imposeVBCs();
    imposeWBCs();
}
hydro_d3 :: hydro_d3 ( const grid & mesh , const parser & solParam , parallel & mpiParam ) : hydro ( mesh , solParam , mpiParam ) , mgSolver ( mesh , inputParams ) { setCoefficients ( ) ; if ( inputParams . restartFlag ) { std :: vector < field > readFields ; readFields . push_back ( V . Vx ) ; readFields . push_back ( V . Vy ) ; readFields . push_back ( V . Vz ) ; readFields . push_back ( P . F ) ; reader dataReader ( mesh , readFields ) ; time = dataReader . readData ( ) ; } else { time = 0.0 ; P = 1.0 ; initial * initCond ; switch ( inputParams . icType ) { case 0 : initCond = new zeroInitial ( mesh ) ; break ; case 1 : initCond = new taylorGreen ( mesh ) ; break ; case 2 : initCond = new channelSine ( mesh ) ; break ; case 3 : initCond = new channelRand ( mesh ) ; break ; default : initCond = new zeroInitial ( mesh ) ; } initCond -> initializeField ( V ) ; } checkPeriodic ( ) ; initVBC ( ) ; initVForcing ( ) ; imposeUBCs ( ) ; imposeVBCs ( ) ; imposeWBCs ( ) ; }
\brief   Constructor of the hydro_d3 class derived from the base hydro class
          The constructor passes its arguments to the base hydro class and then initializes all the scalar and
          vector fields necessary for solving the NS equations.
\ brief Constructor of the hydro_d3 class derived from the base hydro class The constructor passes its arguments to the base hydro class and then initializes all the scalar and vector fields necessary for solving the NS equations .
// SET VALUES OF COEFFICIENTS USED FOR COMPUTING LAPLACIAN // INITIALIZE VARIABLES // Fields to be read from HDF5 file are passed to reader class as a vector // Populate the vector with required fields // Initialize reader object // INITIALIZE PRESSURE TO 1.0 THROUGHOUT THE DOMAIN // INITIALIZE VARIABLES // Initialize velocity boundary conditions // Initialize velocity forcing field