diff options
Diffstat (limited to 'Source/WarpXRegrid.cpp')
-rw-r--r-- | Source/WarpXRegrid.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/WarpXRegrid.cpp b/Source/WarpXRegrid.cpp index 744dd18e8..d9c5b21ff 100644 --- a/Source/WarpXRegrid.cpp +++ b/Source/WarpXRegrid.cpp @@ -40,6 +40,7 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa // Fine patch + const auto& period = Geom(lev).periodicity(); for (int idim=0; idim < 3; ++idim) { { @@ -60,8 +61,8 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa const IntVect& ng = current_fp[lev][idim]->nGrowVect(); auto pmf = std::unique_ptr<MultiFab>(new MultiFab(current_fp[lev][idim]->boxArray(), dm, 1, ng)); - // pmf->Redistribute(*current_fp[lev][idim], 0, 0, 1, ng); current_fp[lev][idim] = std::move(pmf); + current_fp_owner_masks[lev][idim] = std::move(current_fp[lev][idim]->OwnerMask(period)); } } @@ -78,8 +79,8 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa const IntVect& ng = rho_fp[lev]->nGrowVect(); auto pmf = std::unique_ptr<MultiFab>(new MultiFab(rho_fp[lev]->boxArray(), dm, nc, ng)); - // pmf->Redistribute(*rho_fp[lev], 0, 0, nc, ng); rho_fp[lev] = std::move(pmf); + rho_fp_owner_masks[lev] = std::move(rho_fp[lev]->OwnerMask(period)); } // Aux patch @@ -112,6 +113,7 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa // Coarse patch if (lev > 0) { + const auto& cperiod = Geom(lev-1).periodicity(); for (int idim=0; idim < 3; ++idim) { { @@ -130,10 +132,11 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa } { const IntVect& ng = current_cp[lev][idim]->nGrowVect(); - auto pmf = std::unique_ptr<MultiFab>(new MultiFab(current_cp[lev][idim]->boxArray(), - dm, 1, ng)); - // pmf->Redistribute(*current_cp[lev][idim], 0, 0, 1, ng); + auto pmf = std::unique_ptr<MultiFab>( new MultiFab(current_cp[lev][idim]->boxArray(), + dm, 1, ng)); current_cp[lev][idim] = std::move(pmf); + current_cp_owner_masks[lev][idim] = std::move( + current_cp[lev][idim]->OwnerMask(cperiod)); } } @@ -150,8 +153,8 @@ WarpX::RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMa const IntVect& ng = rho_cp[lev]->nGrowVect(); auto pmf = std::unique_ptr<MultiFab>(new MultiFab(rho_cp[lev]->boxArray(), dm, nc, ng)); - // pmf->Redistribute(*rho_cp[lev], 0, 0, nc, ng); rho_cp[lev] = std::move(pmf); + rho_cp_owner_masks[lev] = std::move(rho_cp[lev]->OwnerMask(cperiod)); } } |