lib/test/AMRTools/refluxEdgeTest.cpp
// ---------------------------------------------------------
// helper functions (lifted from Divergence.cpp in order to make this test
// self-sufficient)
helper functions (lifted from Divergence.cpp in order to make this test
self-sufficient)
helper functions ( lifted from Divergence . cpp in order to make this test self - sufficient )
void
singleBoxDivergence(const FArrayBox& uEdgeDir,
                    FArrayBox& a_div,
                    const Box& cellBox,
                    Real a_dx,
                    int a_dir)
{
  IntVect offset = IntVect::Zero;
  offset[a_dir] = 1;
  Real oneOnDx = 1.0/a_dx;
  for (int n=0; n<a_div.nComp(); n++)
    {
      BoxIterator cellBit(cellBox);
      for (cellBit.begin(); cellBit.ok(); ++cellBit)
        {
          IntVect cellIV = cellBit();
          IntVect loFace = cellIV;
          IntVect hiFace = loFace + offset;
          a_div(cellIV, n) += oneOnDx*(uEdgeDir(hiFace,n) - uEdgeDir(loFace,n));
        } 
    } 
}
void singleBoxDivergence ( const FArrayBox & uEdgeDir , FArrayBox & a_div , const Box & cellBox , Real a_dx , int a_dir ) { IntVect offset = IntVect :: Zero ; offset [ a_dir ] = 1 ; Real oneOnDx = 1.0 / a_dx ; for ( int n = 0 ; n < a_div . nComp ( ) ; n ++ ) { BoxIterator cellBit ( cellBox ) ; for ( cellBit . begin ( ) ; cellBit . ok ( ) ; ++ cellBit ) { IntVect cellIV = cellBit ( ) ; IntVect loFace = cellIV ; IntVect hiFace = loFace + offset ; a_div ( cellIV , n ) += oneOnDx * ( uEdgeDir ( hiFace , n ) - uEdgeDir ( loFace , n ) ) ; } } }
helper functions (lifted from Divergence.cpp in order to make this test
self-sufficient)
helper functions ( lifted from Divergence . cpp in order to make this test self - sufficient )
// this is going to be really slow, but it's a test, so // it shouldn't be that bad... // end loop over cells // end loop over components