releasedExamples/AMRINS/projection/CCProjector.cpp
// --------------------------------------------------------------
// note that this function assumes that all BC's on phi have been set
note that this function assumes that all BC's on phi have been set
note that this function assumes that all BC ' s on phi have been set
void CCProjector::gradPhi(LevelData<FArrayBox>& a_gradPhi, int a_dir) const
{
  DataIterator dit = a_gradPhi.dataIterator();
  dit.reset();
  int edgeDir = -1;
  const Box& edgeBox = a_gradPhi[dit].box();
  for (int dir=0; dir<SpaceDim; dir++)
    {
      if (edgeBox.type(dir) == IndexType::NODE)
        {
          CH_assert (edgeDir == -1);
          edgeDir = dir;
        }
    }
  CH_assert(edgeDir != -1);
  const DisjointBoxLayout& grids = getBoxes();
  for (dit.reset(); dit.ok(); ++dit)
    {
      CH_assert (false);
      Gradient::singleBoxMacGrad(a_gradPhi[dit],
                                 m_phi[dit],
                                 0, 0, 1, grids[dit], m_dx,
                                 a_dir, edgeDir, m_gradIVS[dit]);
    } 
}
void CCProjector :: gradPhi ( LevelData < FArrayBox > & a_gradPhi , int a_dir ) const { DataIterator dit = a_gradPhi . dataIterator ( ) ; dit . reset ( ) ; int edgeDir = -1 ; const Box & edgeBox = a_gradPhi [ dit ] . box ( ) ; for ( int dir = 0 ; dir < SpaceDim ; dir ++ ) { if ( edgeBox . type ( dir ) == IndexType :: NODE ) { CH_assert ( edgeDir == -1 ) ; edgeDir = dir ; } } CH_assert ( edgeDir != -1 ) ; const DisjointBoxLayout & grids = getBoxes ( ) ; for ( dit . reset ( ) ; dit . ok ( ) ; ++ dit ) { CH_assert ( false ) ; Gradient :: singleBoxMacGrad ( a_gradPhi [ dit ] , m_phi [ dit ] , 0 , 0 , 1 , grids [ dit ] , m_dx , a_dir , edgeDir , m_gradIVS [ dit ] ) ; } }
note that this function assumes that all BC's on phi have been set
note that this function assumes that all BC ' s on phi have been set
// first compute edge-centering of gradPhi // call gradient subroutine directly, since this is one-directional // I don't think this function is called by anybody ever // I think this is correct, but just in case, flag it // (dfmartin@lbl.gov) // end loop over grids