diff options
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 |