diff --git a/Src/Base/AMReX_PODVector.cpp b/Src/Base/AMReX_PODVector.cpp index d2c4d2477fa..53d283a3634 100644 --- a/Src/Base/AMReX_PODVector.cpp +++ b/Src/Base/AMReX_PODVector.cpp @@ -9,5 +9,13 @@ namespace amrex::VectorGrowthStrategy void Initialize () { ParmParse pp("amrex"); pp.queryAdd("vector_growth_factor", growth_factor); + + // sanity checks + auto eps = std::numeric_limits::epsilon(); + auto huge = 1000._rt; // huge enough for our purposes... + AMREX_ALWAYS_ASSERT_WITH_MESSAGE(growth_factor - 1.0_rt >= eps, + "User-specified vector growth factor is too small."); + AMREX_ALWAYS_ASSERT_WITH_MESSAGE(growth_factor < huge, + "User-specified vector growth factor is too large."); } }