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 d21e2ad9c..8d7873041 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)); } if (current_store[lev][idim]) { @@ -86,8 +87,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 @@ -120,6 +121,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) { { @@ -138,10 +140,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)); } } @@ -158,8 +161,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)); } } |