From b7415c04b7299dd17fb4a2c05a8e7f2a4387a5c2 Mon Sep 17 00:00:00 2001 From: ablelly Date: Thu, 8 Aug 2019 18:58:07 +0200 Subject: Minor correction so that the choice of direction is only valid on mother grid. Added the new input parameters in documentation. --- Docs/source/running_cpp/parameters.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Docs/source/running_cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index f63930c77..b7d0d0664 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -661,6 +661,12 @@ Boundary conditions The characteristic depth, in number of cells, over which the absorption coefficients of the PML increases. +* ``warpx.do_pml_Lo`` (`2 ints in 2D`, `3 ints in 3D`; default: `1 1 1`) + The directions along which one wants a pml boundary condition for lower boundaries on mother grid. + +* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`;; default: `1 1 1`) + The directions along which one wants a pml boundary condition for upper boundaries on mother grid. + Diagnostics and output ---------------------- -- cgit v1.2.3 From 7ac15cf206ba20f5673729476903323d2ad30f16 Mon Sep 17 00:00:00 2001 From: ablelly Date: Fri, 9 Aug 2019 00:26:56 +0200 Subject: For RZ mode: - pml automatically desabled along z axis (x=0) - for MR: if the MR patch lower boundary is along (x=0), the pml is automatically desabled along (xmin) --- Bin/warox_3d_choose_pml_direction.ex | Bin 81646872 -> 0 bytes Bin/warpx_2d_choose_pml_direction.ex | Bin 80559872 -> 0 bytes Docs/source/running_cpp/parameters.rst | 2 +- Source/Initialization/WarpXInitData.cpp | 16 ++++++++++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) delete mode 100755 Bin/warox_3d_choose_pml_direction.ex delete mode 100755 Bin/warpx_2d_choose_pml_direction.ex (limited to 'Docs/source/running_cpp') diff --git a/Bin/warox_3d_choose_pml_direction.ex b/Bin/warox_3d_choose_pml_direction.ex deleted file mode 100755 index 0a2bf6a8d..000000000 Binary files a/Bin/warox_3d_choose_pml_direction.ex and /dev/null differ diff --git a/Bin/warpx_2d_choose_pml_direction.ex b/Bin/warpx_2d_choose_pml_direction.ex deleted file mode 100755 index d484eafb0..000000000 Binary files a/Bin/warpx_2d_choose_pml_direction.ex and /dev/null differ diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index b7d0d0664..790956474 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -664,7 +664,7 @@ Boundary conditions * ``warpx.do_pml_Lo`` (`2 ints in 2D`, `3 ints in 3D`; default: `1 1 1`) The directions along which one wants a pml boundary condition for lower boundaries on mother grid. -* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`;; default: `1 1 1`) +* ``warpx.do_pml_Hi`` (`2 floats in 2D`, `3 floats in 3D`; default: `1 1 1`) The directions along which one wants a pml boundary condition for upper boundaries on mother grid. Diagnostics and output diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 912db5f26..10a7af8c7 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -131,15 +131,27 @@ WarpX::InitPML () { if (do_pml) { + amrex::IntVect do_pml_Lo_corrected = do_pml_Lo; + // amrex::IntVect do_pml_Hi_corrected = do_pml_Hi; + +#ifdef WARPX_DIM_RZ + do_pml_Lo_corrected[0] = 0; //no PML along z-axis +#endif pml[0].reset(new PML(boxArray(0), DistributionMap(0), &Geom(0), nullptr, pml_ncell, pml_delta, 0, #ifdef WARPX_USE_PSATD dt[0], nox_fft, noy_fft, noz_fft, do_nodal, #endif do_dive_cleaning, do_moving_window, - do_pml_Lo, do_pml_Hi)); + do_pml_Lo_corrected, do_pml_Hi)); for (int lev = 1; lev <= finest_level; ++lev) { + amrex::IntVect do_pml_Lo_MR = amrex::IntVect::TheUnitVector(); +#ifdef WARPX_DIM_RZ + if ((max_level > 0) && (fine_tag_lo[0]==0.)) { //if the border of the patch matches with the z-axis + do_pml_Lo_MR[0] = 0; + } +#endif pml[lev].reset(new PML(boxArray(lev), DistributionMap(lev), &Geom(lev), &Geom(lev-1), pml_ncell, pml_delta, refRatio(lev-1)[0], @@ -147,7 +159,7 @@ WarpX::InitPML () dt[lev], nox_fft, noy_fft, noz_fft, do_nodal, #endif do_dive_cleaning, do_moving_window, - amrex::IntVect::TheUnitVector(), amrex::IntVect::TheUnitVector())); + do_pml_Lo_MR, amrex::IntVect::TheUnitVector())); } } } -- cgit v1.2.3