releasedExamples/AMRGodunov/srcPolytropic/RampIBC.cpp
// Adjust boundary fluxes to account for artificial viscosity
Adjust boundary fluxes to account for artificial viscosity
Adjust boundary fluxes to account for artificial viscosity
void RampIBC::artViscBC(FArrayBox&       a_F,
                        const FArrayBox& a_U,
                        const FArrayBox& a_divVel,
                        const int&       a_dir,
                        const Real&      a_time)
{
  CH_assert(m_isFortranCommonSet == true);
  CH_assert(m_isDefined == true);
  FArrayBox &divVel = (FArrayBox &)a_divVel;
  Box fluxBox = divVel.box();
  fluxBox.enclosedCells(a_dir);
  fluxBox.grow(a_dir,1);
  Box loBox,hiBox,centerBox,entireBox;
  int hasLo,hasHi;
  loHiCenterFace(loBox,hasLo,hiBox,hasHi,centerBox,entireBox,
                 fluxBox,m_domain,a_dir);
  if (hasLo == 1)
    {
      loBox.shiftHalf(a_dir,1);
      divVel.shiftHalf(a_dir,1);
      a_F.shiftHalf(a_dir,1);
      int loHiSide = -1;
      FORT_RAMPARTVISCF(CHF_FRA(a_F),
                        CHF_CONST_FRA(a_U),
                        CHF_CONST_FRA1(divVel,0),
                        CHF_CONST_INT(loHiSide),
                        CHF_CONST_REAL(m_dx),
                        CHF_CONST_INT(a_dir),
                        CHF_BOX(loBox));
      loBox.shiftHalf(a_dir,-1);
      divVel.shiftHalf(a_dir,-1);
      a_F.shiftHalf(a_dir,-1);
    }
  if (hasHi == 1)
    {
      hiBox.shiftHalf(a_dir,-1);
      divVel.shiftHalf(a_dir,-1);
      a_F.shiftHalf(a_dir,-1);
      int loHiSide = 1;
      FORT_RAMPARTVISCF(CHF_FRA(a_F),
                        CHF_CONST_FRA(a_U),
                        CHF_CONST_FRA1(divVel,0),
                        CHF_CONST_INT(loHiSide),
                        CHF_CONST_REAL(m_dx),
                        CHF_CONST_INT(a_dir),
                        CHF_BOX(hiBox));
      hiBox.shiftHalf(a_dir,1);
      divVel.shiftHalf(a_dir,1);
      a_F.shiftHalf(a_dir,1);
    }
}
void RampIBC :: artViscBC ( FArrayBox & a_F , const FArrayBox & a_U , const FArrayBox & a_divVel , const int & a_dir , const Real & a_time ) { CH_assert ( m_isFortranCommonSet == true ) ; CH_assert ( m_isDefined == true ) ; FArrayBox & divVel = ( FArrayBox & ) a_divVel ; Box fluxBox = divVel . box ( ) ; fluxBox . enclosedCells ( a_dir ) ; fluxBox . grow ( a_dir , 1 ) ; Box loBox , hiBox , centerBox , entireBox ; int hasLo , hasHi ; loHiCenterFace ( loBox , hasLo , hiBox , hasHi , centerBox , entireBox , fluxBox , m_domain , a_dir ) ; if ( hasLo == 1 ) { loBox . shiftHalf ( a_dir , 1 ) ; divVel . shiftHalf ( a_dir , 1 ) ; a_F . shiftHalf ( a_dir , 1 ) ; int loHiSide = -1 ; FORT_RAMPARTVISCF ( CHF_FRA ( a_F ) , CHF_CONST_FRA ( a_U ) , CHF_CONST_FRA1 ( divVel , 0 ) , CHF_CONST_INT ( loHiSide ) , CHF_CONST_REAL ( m_dx ) , CHF_CONST_INT ( a_dir ) , CHF_BOX ( loBox ) ) ; loBox . shiftHalf ( a_dir , -1 ) ; divVel . shiftHalf ( a_dir , -1 ) ; a_F . shiftHalf ( a_dir , -1 ) ; } if ( hasHi == 1 ) { hiBox . shiftHalf ( a_dir , -1 ) ; divVel . shiftHalf ( a_dir , -1 ) ; a_F . shiftHalf ( a_dir , -1 ) ; int loHiSide = 1 ; FORT_RAMPARTVISCF ( CHF_FRA ( a_F ) , CHF_CONST_FRA ( a_U ) , CHF_CONST_FRA1 ( divVel , 0 ) , CHF_CONST_INT ( loHiSide ) , CHF_CONST_REAL ( m_dx ) , CHF_CONST_INT ( a_dir ) , CHF_BOX ( hiBox ) ) ; hiBox . shiftHalf ( a_dir , 1 ) ; divVel . shiftHalf ( a_dir , 1 ) ; a_F . shiftHalf ( a_dir , 1 ) ; } }
Adjust boundary fluxes to account for artificial viscosity
Adjust boundary fluxes to account for artificial viscosity