aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 3c5604a8b..027317501 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -642,11 +642,26 @@ WarpX::ReadParameters ()
quantum_xi_c2 = static_cast<amrex::Real>(quantum_xi * PhysConst::c * PhysConst::c);
}
- pp_warpx.query("do_pml", do_pml);
- pp_warpx.query("do_silver_mueller", do_silver_mueller);
- if ( (do_pml==1)&&(do_silver_mueller==1) ) {
- amrex::Abort("PML and Silver-Mueller boundary conditions cannot be activated at the same time.");
+ for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
+ if ( ( WarpX::field_boundary_lo[idim] == FieldBoundaryType::PML &&
+ WarpX::field_boundary_lo[idim] == FieldBoundaryType::Absorbing_SilverMueller ) ||
+ ( WarpX::field_boundary_hi[idim] == FieldBoundaryType::PML &&
+ WarpX::field_boundary_hi[idim] == FieldBoundaryType::Absorbing_SilverMueller ) )
+ {
+ amrex::Abort("PML and Silver-Mueller boundary conditions cannot be activated at the same time.");
+ }
+
+ if (WarpX::field_boundary_lo[idim] == FieldBoundaryType::Absorbing_SilverMueller ||
+ WarpX::field_boundary_hi[idim] == FieldBoundaryType::Absorbing_SilverMueller)
+ {
+ // SilverMueller is implemented for Yee
+ if (maxwell_solver_id != MaxwellSolverAlgo::Yee) {
+ amrex::Abort("The Silver-Mueller boundary condition can only be used with the Yee solver.");
+ }
+ }
}
+
+ pp_warpx.query("do_pml", do_pml);
pp_warpx.query("pml_ncell", pml_ncell);
pp_warpx.query("pml_delta", pml_delta);
pp_warpx.query("pml_has_particles", pml_has_particles);