aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXUtil.cpp
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2021-07-13 00:27:49 -0700
committerGravatar GitHub <noreply@github.com> 2021-07-13 00:27:49 -0700
commitb739ed9ccdbfeb878ead2a9d2a9ad61fbcfce35e (patch)
tree8f3891e1606f37189458c877fdefc9e51a1383d5 /Source/Utils/WarpXUtil.cpp
parent02e3b8cce573fb54253b10fc9104695d9c24b188 (diff)
downloadWarpX-b739ed9ccdbfeb878ead2a9d2a9ad61fbcfce35e.tar.gz
WarpX-b739ed9ccdbfeb878ead2a9d2a9ad61fbcfce35e.tar.zst
WarpX-b739ed9ccdbfeb878ead2a9d2a9ad61fbcfce35e.zip
Interface silver mueller (#2051)
* interface silvermueller with refactored boundary interface * add interface in silver mueller input files * define first and second half for EvolveB * add do_pml parse snce RZ needs do_pml to be st to false * Silver-Mueller boundary condition in docs * add firsthalf in ApplyBfieldBoundary within PushPSATD as only first first half is used to apply silvermueller * CallSilverMueller once for all boundaries * remove unused do silvermueller flag * fix typo in input file * Apply suggestions from code review Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> * abort message if silver-mueller is not selected on all valid boundaries * fix typo * fix eol * remove ifdef from inside the Assert message * check silver-mueller selection after reading all boundaries Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r--Source/Utils/WarpXUtil.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp
index 4ea0f14c0..70aec4253 100644
--- a/Source/Utils/WarpXUtil.cpp
+++ b/Source/Utils/WarpXUtil.cpp
@@ -568,6 +568,38 @@ void ReadBCParams ()
}
}
}
+ // temporarily check : If silver mueller is selected for one boundary, it should be
+ // selected at all valid boundaries.
+ for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
+ if (WarpX::field_boundary_lo[idim] == FieldBoundaryType::Absorbing_SilverMueller ||
+ WarpX::field_boundary_hi[idim] == FieldBoundaryType::Absorbing_SilverMueller){
+#if (AMREX_SPACEDIM == 3)
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ (WarpX::field_boundary_lo[0] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[0] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_lo[1] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[1] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_lo[2] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[2] == FieldBoundaryType::Absorbing_SilverMueller)
+ , " The current implementation requires silver-mueller boundary condition to be applied at all boundaries!");
+#else
+#ifndef WARPX_DIM_RZ
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ (WarpX::field_boundary_lo[0] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[0] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_lo[1] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[1] == FieldBoundaryType::Absorbing_SilverMueller)
+ , " The current implementation requires silver-mueller boundary condition to be applied at all boundaries!");
+#else
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ (WarpX::field_boundary_hi[0] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_lo[1] == FieldBoundaryType::Absorbing_SilverMueller)&&
+ (WarpX::field_boundary_hi[1] == FieldBoundaryType::Absorbing_SilverMueller)
+ , " The current implementation requires silver-mueller boundary condition to be applied at all boundaries!");
+#endif
+#endif
+ }
+ }
#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,