lib/src/AMRTools/QuadCFInterp.cpp
/***********************/
//  apply coarse-fine boundary conditions -- assume that phi grids
//  are grown by one
/***********************/
apply coarse-fine boundary conditions -- assume that phi grids
are grown by one
apply coarse - fine boundary conditions -- assume that phi grids are grown by one
void
QuadCFInterp::coarseFineInterp(LevelData<FArrayBox>& a_phif,
                               const LevelData<FArrayBox>& a_phic)
{
  CH_TIME("QuadCFInterp::coarseFineInterp");
  CH_assert(isDefined());
  Interval variables = a_phic.interval();
  if (m_level > 0)
    {
      CH_assert(a_phif.nComp() == m_nComp);
      CH_assert(a_phic.nComp() == m_nComp);
      CH_assert(a_phif.ghostVect() >= IntVect::Unit);
      CH_assert(a_phic.boxLayout() == m_inputCoarLayout);
      CH_assert(a_phif.boxLayout() == m_inputFineLayout);
      a_phic.copyTo(a_phic.interval(), m_coarBuffer, m_coarBuffer.interval(),
                    m_copier);
      for (int idir = 0; idir < SpaceDim; idir++)
        {
          DataIterator ditFine = a_phif.dataIterator();
          for (ditFine.begin(); ditFine.ok(); ++ditFine)
            {
              DataIndex datIndGlo =ditFine();
              BaseFab<Real> & phif = a_phif[datIndGlo];
              const BaseFab<Real> & phiC = m_coarBuffer[datIndGlo];
              {
                const QuadCFStencil& loQCFS = m_loQCFS[idir][datIndGlo];
                coarseFineInterp(phif, phiC ,loQCFS, Side::Lo, idir, variables);
              }
              {
                const QuadCFStencil& hiQCFS = m_hiQCFS[idir][datIndGlo];
                coarseFineInterp(phif, phiC, hiQCFS, Side::Hi, idir, variables);
              }
            }
        } 
    }
}
void QuadCFInterp :: coarseFineInterp ( LevelData < FArrayBox > & a_phif , const LevelData < FArrayBox > & a_phic ) { CH_TIME ( " " ) ; CH_assert ( isDefined ( ) ) ; Interval variables = a_phic . interval ( ) ; if ( m_level > 0 ) { CH_assert ( a_phif . nComp ( ) == m_nComp ) ; CH_assert ( a_phic . nComp ( ) == m_nComp ) ; CH_assert ( a_phif . ghostVect ( ) >= IntVect :: Unit ) ; CH_assert ( a_phic . boxLayout ( ) == m_inputCoarLayout ) ; CH_assert ( a_phif . boxLayout ( ) == m_inputFineLayout ) ; a_phic . copyTo ( a_phic . interval ( ) , m_coarBuffer , m_coarBuffer . interval ( ) , m_copier ) ; for ( int idir = 0 ; idir < SpaceDim ; idir ++ ) { DataIterator ditFine = a_phif . dataIterator ( ) ; for ( ditFine . begin ( ) ; ditFine . ok ( ) ; ++ ditFine ) { DataIndex datIndGlo = ditFine ( ) ; BaseFab < Real > & phif = a_phif [ datIndGlo ] ; const BaseFab < Real > & phiC = m_coarBuffer [ datIndGlo ] ; { const QuadCFStencil & loQCFS = m_loQCFS [ idir ] [ datIndGlo ] ; coarseFineInterp ( phif , phiC , loQCFS , Side :: Lo , idir , variables ) ; } { const QuadCFStencil & hiQCFS = m_hiQCFS [ idir ] [ datIndGlo ] ; coarseFineInterp ( phif , phiC , hiQCFS , Side :: Hi , idir , variables ) ; } } } } }
apply coarse-fine boundary conditions -- assume that phi grids
are grown by one
apply coarse - fine boundary conditions -- assume that phi grids are grown by one
//lo side cfinterp //recall that buffers have fine processor mapping //hi side cfinterp //end iteration over boxes in fine grid //end iteration over directions