diff options
author | 2021-04-15 00:00:44 -0700 | |
---|---|---|
committer | 2021-04-15 00:00:44 -0700 | |
commit | 23021844da6185d6fa28fc81bf84b15f7e566fb2 (patch) | |
tree | b5657c3215d2889611dc5682cf6b1b65f2d355a3 /Source/Utils/WarpXUtil.cpp | |
parent | 6b8894a72a5109ddfef5260192fb8111f5d6ee13 (diff) | |
download | WarpX-23021844da6185d6fa28fc81bf84b15f7e566fb2.tar.gz WarpX-23021844da6185d6fa28fc81bf84b15f7e566fb2.tar.zst WarpX-23021844da6185d6fa28fc81bf84b15f7e566fb2.zip |
Boundary Condition : Interface with existing PML (#1768)
* Read boundary and set periodicity, enumerate BC types, added support for periodic
* separate particle and field boudnary structs
* Update comment for particle struct
* default pml is 0, and reset lo, hi, and do_pml to 1
* turn on pml for MR
* eol
* remove duplication
* resolving commit conflict
* explicitly setting pml_HI_MR
* default pml lo and hi to 0, and set MR pml lo and hi to the domain values if fine patch coincides with domain boundary
* set lo and hi flag for pml when do pml = 1 and domain is non-periodic
* remove commented line
* add doc
* Update Source/Utils/WarpXUtil.cpp
remove empty line
* Apply suggestions from code review
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
* Update Docs/source/usage/parameters.rst
lower case for input
* add do_pml flags for IonAcc2d and PlasmaMirror
* add pml = true in PICMI for gaussian beam and plasma acceleration
* pml is the default field BC
* adding temporary defaults for field and particle BC using periodicity
* fix temp initialization
* set default to pec if input sets pml to 0
* fix typo
* logic for both old and new pml interface
* fix eol
* change examples to original pml input with default values
* Update Docs/source/usage/parameters.rst
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
* fix comments
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
* Docs: fix .rst list
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r-- | Source/Utils/WarpXUtil.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index ae62eb0ca..379cd1ba5 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -371,7 +371,26 @@ void ReadBCParams () amrex::Vector<std::string> particle_BC_hi(AMREX_SPACEDIM,"default"); amrex::Vector<int> geom_periodicity(AMREX_SPACEDIM,0); ParmParse pp_geometry("geometry"); + ParmParse pp_warpx("warpx"); if (pp_geometry.queryarr("is_periodic", geom_periodicity)) { + // set default field and particle boundary appropriately + for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { + if (geom_periodicity[idim] == 1) { + // set boundary to periodic based on user-defined periodicity + WarpX::field_boundary_lo[idim] = FieldBoundaryType::Periodic; + WarpX::field_boundary_hi[idim] = FieldBoundaryType::Periodic; + WarpX::particle_boundary_lo[idim] = ParticleBoundaryType::Periodic; + WarpX::particle_boundary_hi[idim] = ParticleBoundaryType::Periodic; + } else { + // if non-periodic and do_pml=0, then set default boundary to PEC + int pml_input = 1; + pp_warpx.query("do_pml", pml_input); + if (pml_input == 0) { + WarpX::field_boundary_lo[idim] = FieldBoundaryType::PEC; + WarpX::field_boundary_hi[idim] = FieldBoundaryType::PEC; + } + } + } return; // When all boundary conditions are supported, the abort statement below will be introduced //amrex::Abort("geometry.is_periodic is not supported. Please use `boundary.field_lo`, `boundary.field_hi` to specifiy field boundary conditions and 'boundary.particle_lo', 'boundary.particle_hi' to specify particle boundary conditions."); |