void fill_boundary(MultiFab& mf, int scomp, int ncomp, const Geometry& geom, bool cross) { if (mf.nGrow() <= 0) return; bool local = false; // Don't think we ever want it to be true. mf.FillBoundary(scomp, ncomp, local, cross); bool do_corners = !cross; geom.FillPeriodicBoundary(mf, scomp, ncomp, do_corners, local); }
static void advance (MultiFab* old_phi, MultiFab* new_phi, MultiFab* flux, Real* dx, Real dt, Geometry geom) { // Fill the ghost cells of each grid from the other grids old_phi->FillBoundary(); // Fill periodic boundary ghost cells geom.FillPeriodicBoundary(*old_phi); int Ncomp = old_phi->nComp(); int ng_p = old_phi->nGrow(); int ng_f = flux->nGrow(); // Compute fluxes one grid at a time for ( MFIter mfi(*old_phi); mfi.isValid(); ++mfi ) { const Box& bx = mfi.validbox(); FORT_COMPUTE_FLUX((*old_phi)[mfi].dataPtr(), &ng_p, flux[0][mfi].dataPtr(), flux[1][mfi].dataPtr(), #if (BL_SPACEDIM == 3) flux[2][mfi].dataPtr(), #endif &ng_f, bx.loVect(), bx.hiVect(), &(dx[0])); } // Advance the solution one grid at a time for ( MFIter mfi(*old_phi); mfi.isValid(); ++mfi ) { const Box& bx = mfi.validbox(); FORT_UPDATE_PHI((*old_phi)[mfi].dataPtr(), (*new_phi)[mfi].dataPtr(), &ng_p, flux[0][mfi].dataPtr(), flux[1][mfi].dataPtr(), #if (BL_SPACEDIM == 3) flux[2][mfi].dataPtr(), #endif &ng_f, bx.loVect(), bx.hiVect(), &(dx[0]) , &dt); } }