aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXUtil.cpp
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2021-05-12 17:22:52 -0700
committerGravatar GitHub <noreply@github.com> 2021-05-12 17:22:52 -0700
commit9f28da17cdc42efbbe14bb21a3b1ab52ee556f68 (patch)
tree4eabfaa0a51b9c02e440778fed7916f437ab908a /Source/Utils/WarpXUtil.cpp
parent1f76d4e6be67145fb257bcdaca35fbb8d6ba0a65 (diff)
downloadWarpX-9f28da17cdc42efbbe14bb21a3b1ab52ee556f68.tar.gz
WarpX-9f28da17cdc42efbbe14bb21a3b1ab52ee556f68.tar.zst
WarpX-9f28da17cdc42efbbe14bb21a3b1ab52ee556f68.zip
BC : Interface for damping EB fields in guard cells in z-direction (#1953)
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r--Source/Utils/WarpXUtil.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp
index 32931dba2..ac76b8ce6 100644
--- a/Source/Utils/WarpXUtil.cpp
+++ b/Source/Utils/WarpXUtil.cpp
@@ -379,6 +379,7 @@ void ReadBCParams ()
amrex::Vector<int> geom_periodicity(AMREX_SPACEDIM,0);
ParmParse pp_geometry("geometry");
ParmParse pp_warpx("warpx");
+ ParmParse pp_algo("algo");
if (pp_geometry.queryarr("is_periodic", geom_periodicity)) {
// set default field and particle boundary appropriately
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
@@ -398,6 +399,23 @@ void ReadBCParams ()
}
}
}
+ // Temporarily setting default boundary to Damped until PEC Boundary Type is enabled
+ int maxwell_solver_id = GetAlgorithmInteger(pp_algo, "maxwell_solver");
+ if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) {
+ ParmParse pp_psatd("psatd");
+ int do_moving_window = 0;
+ pp_warpx.query("do_moving_window", do_moving_window);
+ if (do_moving_window == 1) {
+ std::string s;
+ pp_warpx.get("moving_window_dir", s);
+ int zdir;
+ if (s == "z" || s == "Z") {
+ zdir = AMREX_SPACEDIM-1;
+ WarpX::field_boundary_lo[zdir] = FieldBoundaryType::Damped;
+ WarpX::field_boundary_hi[zdir] = FieldBoundaryType::Damped;
+ }
+ }
+ }
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.");