Skip to content

Commit

Permalink
RZ: Add ASSERT for Lower Bound of Radial Coordinate (#2082)
Browse files Browse the repository at this point in the history
* RZ FDTD: Add ASSERT for Lower Bound of Radial Coordinate

* RZ PSATD: Add ASSERT for Lower Bound of Radial Coordinate
  • Loading branch information
EZoni authored Jul 14, 2021
1 parent 59b91bd commit 521112f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/Utils/WarpXUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ void ParseGeometryInput()
getArrWithParser(pp_geometry, "prob_hi", prob_hi, 0, AMREX_SPACEDIM);
AMREX_ALWAYS_ASSERT(prob_hi.size() == AMREX_SPACEDIM);

#ifdef WARPX_DIM_RZ
ParmParse pp_algo("algo");
int maxwell_solver_id = GetAlgorithmInteger(pp_algo, "maxwell_solver");
if (maxwell_solver_id == MaxwellSolverAlgo::PSATD)
{
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(prob_lo[0] == 0.,
"Lower bound of radial coordinate (prob_lo[0]) with RZ PSATD solver must be zero");
}
else
{
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(prob_lo[0] >= 0.,
"Lower bound of radial coordinate (prob_lo[0]) with RZ FDTD solver must be non-negative");
}
#endif

pp_geometry.addarr("prob_lo", prob_lo);
pp_geometry.addarr("prob_hi", prob_hi);
}
Expand Down

0 comments on commit 521112f

Please sign in to comment.