aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r--Source/Utils/WarpXUtil.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp
index d85cd17a4..e9cb6e34f 100644
--- a/Source/Utils/WarpXUtil.cpp
+++ b/Source/Utils/WarpXUtil.cpp
@@ -446,6 +446,7 @@ void ReadBCParams ()
ParmParse pp_geometry("geometry");
ParmParse pp_warpx("warpx");
ParmParse pp_algo("algo");
+ int maxwell_solver_id = GetAlgorithmInteger(pp_algo, "maxwell_solver");
if (pp_geometry.queryarr("is_periodic", geom_periodicity)) {
// set default field and particle boundary appropriately
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
@@ -458,15 +459,24 @@ void ReadBCParams ()
} else {
// if non-periodic and do_pml=0, then set default boundary to PEC
int pml_input = 1;
+ int silverMueller_input = 0;
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;
+ pp_warpx.query("do_silver_mueller", silverMueller_input);
+ if (pml_input == 0 and silverMueller_input == 0) {
+ if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) {
+ WarpX::field_boundary_lo[idim] = FieldBoundaryType::None;
+ WarpX::field_boundary_hi[idim] = FieldBoundaryType::None;
+ } else {
+ WarpX::field_boundary_lo[idim] = FieldBoundaryType::PEC;
+ WarpX::field_boundary_hi[idim] = FieldBoundaryType::PEC;
+ }
+#ifdef WARPX_DIM_RZ
+ if (idim == 0) WarpX::field_boundary_lo[idim] = FieldBoundaryType::None;
+#endif
}
}
}
- // Temporarily setting default boundary to Damped until PEC Boundary Type is enabled
- int maxwell_solver_id = GetAlgorithmInteger(pp_algo, "maxwell_solver");
+ // Temporarily setting default boundary to Damped until new boundary interface is introduced
if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) {
ParmParse pp_psatd("psatd");
int do_moving_window = 0;
@@ -528,9 +538,19 @@ void ReadBCParams ()
WarpX::particle_boundary_lo[idim] = ParticleBoundaryType::Periodic;
WarpX::particle_boundary_hi[idim] = ParticleBoundaryType::Periodic;
}
-
+ }
+ if (maxwell_solver_id == MaxwellSolverAlgo::PSATD) {
+ if (WarpX::field_boundary_lo[idim] == FieldBoundaryType::PEC ||
+ WarpX::field_boundary_hi[idim] == FieldBoundaryType::PEC) {
+ amrex::Abort(" PEC boundary not implemented for PSATD, yet!");
+ }
}
}
+#ifdef WARPX_DIM_RZ
+ // Ensure code aborts if PEC is specified at r=0 for RZ
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE( WarpX::field_boundary_lo[0] == FieldBoundaryType::None,
+ "Error : Field boundary at r=0 must be ``none``. \n");
+#endif
pp_geometry.addarr("is_periodic", geom_periodicity);
}