diff options
author | 2019-05-02 15:58:02 -0700 | |
---|---|---|
committer | 2019-05-02 15:58:02 -0700 | |
commit | 2c25e914fcaae826a4e28acdc1e7c5348e05a168 (patch) | |
tree | 659a6ab9ca576adfad34099f66b85afe45d0dd5b /Source/WarpX.cpp | |
parent | fdb8a5b897a2f5b69cc44cd9fbf4ae392919757a (diff) | |
download | WarpX-2c25e914fcaae826a4e28acdc1e7c5348e05a168.tar.gz WarpX-2c25e914fcaae826a4e28acdc1e7c5348e05a168.tar.zst WarpX-2c25e914fcaae826a4e28acdc1e7c5348e05a168.zip |
Increase number of guard cells for nodal
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index f42c43f99..27642c850 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -455,7 +455,7 @@ WarpX::ReadParameters () else { particle_plot_flags.resize(PIdx::nattribs, 1); - } + } } else { @@ -466,7 +466,7 @@ WarpX::ReadParameters () else { particle_plot_flags.resize(PIdx::nattribs, 0); - } + } for (const auto& var : particle_plot_vars) { @@ -711,11 +711,19 @@ WarpX::AllocLevelData (int lev, const BoxArray& ba, const DistributionMapping& d #ifdef WARPX_USE_PSATD if (fft_hybrid_mpi_decomposition == false){ - // All boxes should have the same number of guard cells (to avoid temporary parallel copies) + // All boxes should have the same number of guard cells + // (to avoid temporary parallel copies) // Thus take the max of the required number of guards for each field - // Minimum required for the spectral solver itself TODO: nodal requires even more guard cells - IntVect ngFFT( AMREX_D_DECL( nox_fft/2, noy_fft/2, noz_fft/2 ) ); - // Determine number of guard cells in each dimension + // Also: the number of guard cell should be enough to contain + // 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)); + } for (int i_dim=0; i_dim<AMREX_SPACEDIM; i_dim++ ){ int ng_required = ngFFT[i_dim]; // Get the max |