aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2022-03-01 13:56:32 -0800
committerGravatar GitHub <noreply@github.com> 2022-03-01 13:56:32 -0800
commit57209fec5a9444ed5203891d828a4745c3bf5031 (patch)
treeac0880a119d57b3e94be70842545a09f66089b28 /Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp
parent2436c3cd7cf25f023256420be30d501cdac09875 (diff)
downloadWarpX-57209fec5a9444ed5203891d828a4745c3bf5031.tar.gz
WarpX-57209fec5a9444ed5203891d828a4745c3bf5031.tar.zst
WarpX-57209fec5a9444ed5203891d828a4745c3bf5031.zip
Check that the relative permittivity epsilon is always strictly positive (#2906)
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp')
-rw-r--r--Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp
index 2a35102cf..8f0e7d553 100644
--- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp
+++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicProperties/MacroscopicProperties.cpp
@@ -150,6 +150,12 @@ MacroscopicProperties::InitData ()
InitializeMacroMultiFabUsingParser(m_eps_mf.get(), m_epsilon_parser->compile<3>(), lev);
}
+ // In the Maxwell solver, `epsilon` is used in the denominator.
+ // Therefore, it needs to be strictly positive
+ bool const local=true;
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE( m_eps_mf->min(0,0,local) > 0,
+ "WarpX encountered zero or negative values for the relative permittivity `epsilon`. Please check the initialization of `epsilon`.");
+
// Initialize mu
if (m_mu_s == "constant") {