releasedExamples/AMRINS/util/CoarseAverageEdge.cpp
// ----------------------------------------------------------
// this function is shamelessly based on the ANAG CoarseAverage
// (cell-centered) version
this function is shamelessly based on the ANAG CoarseAverage
(cell-centered) version
this function is shamelessly based on the ANAG CoarseAverage ( cell - centered ) version
void
CoarseAverageEdge::averageToCoarse(LevelData<FluxBox>& a_coarseData,
                                   const LevelData<FluxBox>& a_fineData)
{
  CH_assert(isDefined());
  DataIterator dit = a_fineData.dataIterator();
  for (dit.reset(); dit.ok(); ++dit)
    {
      FluxBox& coarsenedFine = m_coarsenedFineData[dit()];
      const FluxBox& fine = a_fineData[dit()];
      averageGridData(coarsenedFine, fine);
    }
  m_coarsenedFineData.copyTo(m_coarsenedFineData.interval(),
                             a_coarseData, a_coarseData.interval());
}
void CoarseAverageEdge :: averageToCoarse ( LevelData < FluxBox > & a_coarseData , const LevelData < FluxBox > & a_fineData ) { CH_assert ( isDefined ( ) ) ; DataIterator dit = a_fineData . dataIterator ( ) ; for ( dit . reset ( ) ; dit . ok ( ) ; ++ dit ) { FluxBox & coarsenedFine = m_coarsenedFineData [ dit ( ) ] ; const FluxBox & fine = a_fineData [ dit ( ) ] ; averageGridData ( coarsenedFine , fine ) ; } m_coarsenedFineData . copyTo ( m_coarsenedFineData . interval ( ) , a_coarseData , a_coarseData . interval ( ) ) ; }
this function is shamelessly based on the ANAG CoarseAverage
(cell-centered) version
this function is shamelessly based on the ANAG CoarseAverage ( cell - centered ) version
// coarsen from the entire fine grid onto the entire coarse grid