lib/test/EBAMRTools/restart.cpp
/** Initializes the DisjointBoxLayouts, each step. */
Initializes the DisjointBoxLayouts, each step.
Initializes the DisjointBoxLayouts each step .
void
EBRestart::makeHierarchy(Vector<DisjointBoxLayout>& a_dbl,
                         const ProblemDomain&       a_baseDomain,
                         const IntVectSet&          a_baseTags,
                         const Vector<int>&         a_refRatios,
                         const InputParams&         a_inputs)
{
  a_dbl.resize(a_inputs.nlevs);
  Real fillRatio     = 0.85;
  BRMeshRefine regridder(a_baseDomain, a_refRatios, fillRatio,
                         a_inputs.blocking_factor,
                         a_inputs.buffer_size, a_inputs.max_size);
  Vector<Vector<Box> > oldGrids(a_inputs.nlevs,1), newGrids(a_inputs.nlevs);
  oldGrids[0][0]=a_baseDomain.domainBox();
  for ( int l=1; l<a_inputs.nlevs; ++l )
  {
    oldGrids[l][0]=coarsen(oldGrids[l-1][0], a_refRatios[l-1]);
  }
  regridder.regrid(newGrids, a_baseTags, 0, 1, oldGrids);
  Vector<int> procs;
  for (int l=0; l<a_inputs.nlevs; l++)
  {
    newGrids[l].sort();
    LoadBalance(procs, newGrids[l]);
    a_dbl[l] = DisjointBoxLayout(newGrids[l], procs);
  }
}
void EBRestart :: makeHierarchy ( Vector < DisjointBoxLayout > & a_dbl , const ProblemDomain & a_baseDomain , const IntVectSet & a_baseTags , const Vector < int > & a_refRatios , const InputParams & a_inputs ) { a_dbl . resize ( a_inputs . nlevs ) ; Real fillRatio = 0.85 ; BRMeshRefine regridder ( a_baseDomain , a_refRatios , fillRatio , a_inputs . blocking_factor , a_inputs . buffer_size , a_inputs . max_size ) ; Vector < Vector < Box > > oldGrids ( a_inputs . nlevs , 1 ) , newGrids ( a_inputs . nlevs ) ; oldGrids [ 0 ] [ 0 ] = a_baseDomain . domainBox ( ) ; for ( int l = 1 ; l < a_inputs . nlevs ; ++ l ) { oldGrids [ l ] [ 0 ] = coarsen ( oldGrids [ l - 1 ] [ 0 ] , a_refRatios [ l - 1 ] ) ; } regridder . regrid ( newGrids , a_baseTags , 0 , 1 , oldGrids ) ; Vector < int > procs ; for ( int l = 0 ; l < a_inputs . nlevs ; l ++ ) { newGrids [ l ] . sort ( ) ; LoadBalance ( procs , newGrids [ l ] ) ; a_dbl [ l ] = DisjointBoxLayout ( newGrids [ l ] , procs ) ; } }
Initializes the DisjointBoxLayouts, each step.
Initializes the DisjointBoxLayouts each step .
// FIXME: is a_refRatios[l-1] correct?? // 0 is baselevel, 1 is toplevel.