From c7c8a710cb1b99bc72343f4215011f3c0ec4f16e Mon Sep 17 00:00:00 2001 From: David Grote Date: Thu, 20 Jan 2022 15:53:23 -0800 Subject: Implement PML for the outer RZ boundary with PSATD (#2211) * Initial version of RZ PSATD PML BCs * Cleaned up some bugs * Add support of do_pml_in_domain option * Cleaned up stuff for building * Fix PMLPsatdAlgorithm macro * Removed unneeded variable from SpectralSolverRZ * Change length 3 arrays to length 2 (for 2D) * Cleanup around DampPML * Added more checks of pml[lev] * Added CI test for RZ PML * Added code to update the corner guard cells * Further updates * Added CI test * Fixed EOL space * Updated CI benchmarks, removing round off fields * Changes to CI missed on previous commit * Various fixes for clean up * More fixes for clean up * Further cleanup * Updated benchmark * Fixed benchmarks file * Minor cleanup * Added round off benchmark values * Fixed testname in analysis_pml_psatd_rz.py * Update comment in analysis file * Put pml_rz code in RZ and PSATD macro blocks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add geometry.dims input to CI test input file, inputs_rz * Cleanup to match recent changes Co-authored-by: Remi Lehe Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Source/Parallelization/GuardCellManager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Source/Parallelization/GuardCellManager.cpp') diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index 2fa0c4c4a..d09e46951 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -49,6 +49,9 @@ guardCellManager::Init ( const int do_electrostatic, const int do_multi_J, const bool fft_do_time_averaging, + const bool do_pml, + const int do_pml_in_domain, + const int pml_ncell, const amrex::Vector& ref_ratios) { // When using subcycling, the particles on the fine level perform two pushes @@ -202,6 +205,16 @@ guardCellManager::Init ( IntVect ngFFT = IntVect(ngFFt_z); #endif +#ifdef WARPX_DIM_RZ + if (do_pml) { + if (!do_pml_in_domain) { + ngFFT[0] = std::max(ngFFT[0], pml_ncell); + } + } +#else + amrex::ignore_unused(do_pml, do_pml_in_domain, pml_ncell); +#endif + // All boxes should have the same number of guard cells, to avoid temporary parallel copies: // thus we take the maximum of the required number of guard cells over all available fields. for (int i_dim = 0; i_dim < AMREX_SPACEDIM; i_dim++) { -- cgit v1.2.3