releasedExamples/AMRINS/BCutil/AdvectIBC.cpp
// Set boundary slopes:
//   The boundary slopes in a_dW are already set to one sided difference
//   approximations.  If this function doesn't change them they will be
//   used for the slopes at the boundaries.
Set boundary slopes:
The boundary slopes in a_dW are already set to one sided difference
approximations.  If this function doesn't change them they will be
used for the slopes at the boundaries.
Set boundary slopes : The boundary slopes in a_dW are already set to one sided difference approximations . If this function doesn ' t change them they will be used for the slopes at the boundaries .
void AdvectIBC::setBdrySlopes(FArrayBox&       a_dW,
                              const FArrayBox& a_W,
                              const int&       a_dir,
                              const Real&      a_time)
{
  CH_assert(m_isDefined == true);
  if (!m_domain.isPeriodic(a_dir))
    {
      Box loBox,hiBox,centerBox,domain;
      int hasLo,hasHi;
      Box slopeBox = a_dW.box()&m_domain;
      Real loVal = m_slopeVal[a_dir][0];
      Real hiVal = m_slopeVal[a_dir][1];
      loHiCenter(loBox,hasLo,hiBox,hasHi,centerBox,domain,
                 slopeBox,m_domain,a_dir);
      if ((hasLo != 0) || (hasHi != 0))
        {
          FORT_SLOPEBCSF(CHF_FRA(a_dW),
                         CHF_CONST_FRA(a_W),
                         CHF_CONST_REAL(m_dx),
                         CHF_CONST_INT(a_dir),
                         CHF_CONST_REAL(loVal),
                         CHF_BOX(loBox),
                         CHF_CONST_INT(hasLo),
                         CHF_CONST_REAL(hiVal),
                         CHF_BOX(hiBox),
                         CHF_CONST_INT(hasHi));
        }
    }
}
void AdvectIBC :: setBdrySlopes ( FArrayBox & a_dW , const FArrayBox & a_W , const int & a_dir , const Real & a_time ) { CH_assert ( m_isDefined == true ) ; if ( ! m_domain . isPeriodic ( a_dir ) ) { Box loBox , hiBox , centerBox , domain ; int hasLo , hasHi ; Box slopeBox = a_dW . box ( ) & m_domain ; Real loVal = m_slopeVal [ a_dir ] [ 0 ] ; Real hiVal = m_slopeVal [ a_dir ] [ 1 ] ; loHiCenter ( loBox , hasLo , hiBox , hasHi , centerBox , domain , slopeBox , m_domain , a_dir ) ; if ( ( hasLo != 0 ) || ( hasHi != 0 ) ) { FORT_SLOPEBCSF ( CHF_FRA ( a_dW ) , CHF_CONST_FRA ( a_W ) , CHF_CONST_REAL ( m_dx ) , CHF_CONST_INT ( a_dir ) , CHF_CONST_REAL ( loVal ) , CHF_BOX ( loBox ) , CHF_CONST_INT ( hasLo ) , CHF_CONST_REAL ( hiVal ) , CHF_BOX ( hiBox ) , CHF_CONST_INT ( hasHi ) ) ; } } }
Set boundary slopes:
The boundary slopes in a_dW are already set to one sided difference
approximations.
Set boundary slopes : The boundary slopes in a_dW are already set to one sided difference approximations .
//  CH_assert(m_isFortranCommonSet == true); // In periodic case, this doesn't do anything // This needs to be fixed // CH_assert (m_isSlopeValSet); // Generate the domain boundary boxes, loBox and hiBox, if there are // domain boundarys there // Set the boundary slopes if necessary