diff options
author | 2020-03-11 19:29:26 -0700 | |
---|---|---|
committer | 2020-03-11 19:29:26 -0700 | |
commit | 09686d364f981e0d6cc4402f9922474bc7bccaec (patch) | |
tree | c22a4e28329a588a7c3dff99dbb782907c38aaeb /Source/Parallelization | |
parent | bc7c47fc1a50c961892f13110f701aa89c0a53d2 (diff) | |
download | WarpX-09686d364f981e0d6cc4402f9922474bc7bccaec.tar.gz WarpX-09686d364f981e0d6cc4402f9922474bc7bccaec.tar.zst WarpX-09686d364f981e0d6cc4402f9922474bc7bccaec.zip |
Added optional user defined number of guard cells to use with PSATD solver (#787)
* Added optional user defined number of quard cells to use with PSATD solver.
* Removed temporary comments.
* Changed names nx_guard_psatd to psatd.nx_guard for consistency.
Diffstat (limited to 'Source/Parallelization')
-rw-r--r-- | Source/Parallelization/GuardCellManager.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index 8e4eca183..f36c64214 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -6,9 +6,8 @@ */ #include "GuardCellManager.H" #include "Filter/NCIGodfreyFilter.H" - #include <AMReX_Print.H> - +#include <AMReX_ParmParse.H> using namespace amrex; @@ -29,12 +28,6 @@ guardCellManager::Init( const amrex::Array<amrex::Real,3> v_galilean, const bool safe_guard_cells) { -#ifndef WARPX_USE_PSATD - (void)do_fft_mpi_dec; - (void)nox_fft; - (void)noy_fft; - (void)noz_fft; -#endif // When using subcycling, the particles on the fine level perform two pushes // before being redistributed ; therefore, we need one extra guard cell // (the particles may move by 2*c*dt) @@ -110,12 +103,18 @@ guardCellManager::Init( // the stencil of the FFT solver. Here, this number (`ngFFT`) // is determined *empirically* to be the order of the solver // for nodal, and half the order of the solver for staggered. - IntVect ngFFT; - if (do_nodal) { - ngFFT = IntVect(AMREX_D_DECL(nox_fft, noy_fft, noz_fft)); - } else { - ngFFT = IntVect(AMREX_D_DECL(nox_fft/2, noy_fft/2, noz_fft/2)); - } + + int ngFFt_x = do_nodal ? nox_fft : nox_fft/2.; + int ngFFt_y = do_nodal ? noy_fft : noy_fft/2.; + int ngFFt_z = do_nodal ? noz_fft : noz_fft/2.; + + ParmParse pp("psatd"); + pp.query("nx_guard", ngFFt_x); + pp.query("ny_guard", ngFFt_y); + pp.query("nz_guard", ngFFt_z); + + IntVect ngFFT = IntVect(AMREX_D_DECL(ngFFt_x, ngFFt_y, ngFFt_z)); + for (int i_dim=0; i_dim<AMREX_SPACEDIM; i_dim++ ){ int ng_required = ngFFT[i_dim]; // Get the max |