aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-08-16 17:42:14 -0700
committerGravatar GitHub <noreply@github.com> 2019-08-16 17:42:14 -0700
commitcb961e301035b744de69abc6cd4205fa424ecf3e (patch)
tree0856a35cdd7b1e4625ad079b1845bc1397e717ad /Source/WarpX.cpp
parent8a7082200a4ddda5fadccd732394a79a4d9eaa30 (diff)
parent988af73510d29a089ad511aa61f43d0abd74b555 (diff)
downloadWarpX-cb961e301035b744de69abc6cd4205fa424ecf3e.tar.gz
WarpX-cb961e301035b744de69abc6cd4205fa424ecf3e.tar.zst
WarpX-cb961e301035b744de69abc6cd4205fa424ecf3e.zip
Merge pull request #251 from ECP-WarpX/enable_psatd_mr
Enable mesh refinement with PSATD
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index a6a7a3399..a29825472 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -891,6 +891,21 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
rho_cp[lev].reset(new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho));
rho_cp_owner_masks[lev] = std::move(rho_cp[lev]->OwnerMask(cperiod));
}
+ if (fft_hybrid_mpi_decomposition == false){
+ // Allocate and initialize the spectral solver
+ std::array<Real,3> cdx = CellSize(lev-1);
+ #if (AMREX_SPACEDIM == 3)
+ RealVect cdx_vect(cdx[0], cdx[1], cdx[2]);
+ #elif (AMREX_SPACEDIM == 2)
+ RealVect cdx_vect(cdx[0], cdx[2]);
+ #endif
+ // Get the cell-centered box, with guard cells
+ BoxArray realspace_ba = cba; // Copy box
+ realspace_ba.enclosedCells().grow(ngE); // cell-centered + guard cells
+ // Define spectral solver
+ spectral_solver_cp[lev].reset( new SpectralSolver( realspace_ba, dm,
+ nox_fft, noy_fft, noz_fft, do_nodal, cdx_vect, dt[lev] ) );
+ }
#endif
}
@@ -922,7 +937,7 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
current_buf[lev][0].reset( new MultiFab(amrex::convert(cba,jx_nodal_flag),dm,1,ngJ));
current_buf[lev][1].reset( new MultiFab(amrex::convert(cba,jy_nodal_flag),dm,1,ngJ));
current_buf[lev][2].reset( new MultiFab(amrex::convert(cba,jz_nodal_flag),dm,1,ngJ));
- if (do_dive_cleaning || plot_rho) {
+ if (rho_cp[lev]) {
charge_buf[lev].reset( new MultiFab(amrex::convert(cba,IntVect::TheUnitVector()),dm,2,ngRho));
}
current_buffer_masks[lev].reset( new iMultiFab(ba, dm, 1, 1) );