aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2020-09-23 10:26:50 -0700
committerGravatar GitHub <noreply@github.com> 2020-09-23 10:26:50 -0700
commit38437f42bd4e7fa097fbd006c35b7fca5941614b (patch)
tree6a96c9191bbfc916bde67af8bfbe86000ab84a6c /Source/WarpX.cpp
parentc0fbe73a93950f9bb61dbde2c6f997268ea457ca (diff)
downloadWarpX-38437f42bd4e7fa097fbd006c35b7fca5941614b.tar.gz
WarpX-38437f42bd4e7fa097fbd006c35b7fca5941614b.tar.zst
WarpX-38437f42bd4e7fa097fbd006c35b7fca5941614b.zip
Implemented fft_periodic_single_box for RZ spectral (#1301)
* Implemented fft_periodic_single_box for RZ spectral For RZ psatd, simplified copy for forward transform * Apply review's suggestions and clean up * Add few comments, fix warnings, apply style conventions Co-authored-by: Dave Grote <dpgrote@lbl.gov> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 719212e3b..4e1e1d46e 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -1002,15 +1002,26 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
# endif
// Check whether the option periodic, single box is valid here
if (fft_periodic_single_box) {
- AMREX_ALWAYS_ASSERT_WITH_MESSAGE( geom[0].isAllPeriodic() && ba.size()==1 && lev==0,
- "The option `psatd.periodic_single_box_fft` can only be used for a periodic domain, decomposed in a single box.");
+# ifdef WARPX_DIM_RZ
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ geom[0].isPeriodic(1) // domain is periodic in z
+ && ba.size() == 1 && lev == 0, // domain is decomposed in a single box
+ "The option `psatd.periodic_single_box_fft` can only be used for a periodic domain, decomposed in a single box");
+# else
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ geom[0].isAllPeriodic() // domain is periodic in all directions
+ && ba.size() == 1 && lev == 0, // domain is decomposed in a single box
+ "The option `psatd.periodic_single_box_fft` can only be used for a periodic domain, decomposed in a single box");
+# endif
}
// Get the cell-centered box
BoxArray realspace_ba = ba; // Copy box
realspace_ba.enclosedCells(); // Make it cell-centered
// Define spectral solver
# ifdef WARPX_DIM_RZ
- realspace_ba.grow(1, ngE[1]); // add guard cells only in z
+ if ( fft_periodic_single_box == false ) {
+ realspace_ba.grow(1, ngE[1]); // add guard cells only in z
+ }
spectral_solver_fp[lev].reset( new SpectralSolverRZ( realspace_ba, dm,
n_rz_azimuthal_modes, noz_fft, do_nodal, dx_vect, dt[lev], lev ) );
if (use_kspace_filter) {