lib/src/AMRTools/NodeMGInterp.cpp
// ---------------------------------------------------------
// interpolate from coarse level to fine level
interpolate from coarse level to fine level
interpolate from coarse level to fine level
void
NodeMGInterp::interpToFine(LevelData<NodeFArrayBox>& a_fine,
                           const LevelData<NodeFArrayBox>& a_coarse,
                           bool a_sameGrids) 
{
  CH_assert(is_defined);
  const int nComp = a_fine.nComp();
  CH_assert(a_coarse.nComp() == nComp);
  if (! a_sameGrids)
    {
      a_coarse.copyTo(a_coarse.interval(),
                      m_coarsenedFine,
                      m_coarsenedFine.interval() );
    }
  for (DataIterator dit = m_grids.dataIterator(); dit.ok(); ++dit)
    {
      Box fineBox = m_grids.get(dit());
      Box crseBox = coarsen(fineBox, m_refRatio);
      const FArrayBox& crseFab = (a_sameGrids) ?
        a_coarse[dit()].getFab() : m_coarsenedFine[dit()].getFab();
      FArrayBox& fineFab = a_fine[dit()].getFab();
      FORT_NODEINTERPMG(CHF_FRA(fineFab),
                        CHF_CONST_FRA(crseFab),
                        CHF_BOX(crseBox),
                        CHF_CONST_INT(m_refRatio),
                        CHF_BOX(m_boxRef),
                        CHF_FRA(m_weights));
      int dummy_unused = 0; dummy_unused = 0;
    }
}
void NodeMGInterp :: interpToFine ( LevelData < NodeFArrayBox > & a_fine , const LevelData < NodeFArrayBox > & a_coarse , bool a_sameGrids ) { CH_assert ( is_defined ) ; const int nComp = a_fine . nComp ( ) ; CH_assert ( a_coarse . nComp ( ) == nComp ) ; if ( ! a_sameGrids ) { a_coarse . copyTo ( a_coarse . interval ( ) , m_coarsenedFine , m_coarsenedFine . interval ( ) ) ; } for ( DataIterator dit = m_grids . dataIterator ( ) ; dit . ok ( ) ; ++ dit ) { Box fineBox = m_grids . get ( dit ( ) ) ; Box crseBox = coarsen ( fineBox , m_refRatio ) ; const FArrayBox & crseFab = ( a_sameGrids ) ? a_coarse [ dit ( ) ] . getFab ( ) : m_coarsenedFine [ dit ( ) ] . getFab ( ) ; FArrayBox & fineFab = a_fine [ dit ( ) ] . getFab ( ) ; FORT_NODEINTERPMG ( CHF_FRA ( fineFab ) , CHF_CONST_FRA ( crseFab ) , CHF_BOX ( crseBox ) , CHF_CONST_INT ( m_refRatio ) , CHF_BOX ( m_boxRef ) , CHF_FRA ( m_weights ) ) ; int dummy_unused = 0 ; dummy_unused = 0 ; } }
interpolate from coarse level to fine level
interpolate from coarse level to fine level
// a_sameGrids default false // Copy a_coarse to m_coarsenedFine on grids of m_coarsenedFine. // petermc, 15 Nov 2002: // You don't need a Copier for this copyTo, because // the grid layout of the destination, m_coarsenedFine, // will be contained in that of the source, a_coarse. // dummy statement in order to get around gdb bug