Enforce floating arithmetic prerequisites for polynomial certificates
This commit is contained in:
@@ -15,6 +15,12 @@ module;
|
||||
#include <mfem.hpp>
|
||||
#include <mpi.h>
|
||||
|
||||
// Outward enclosure depends on ordinary floating-point operations. Optimizers
|
||||
// that discard NaNs or reassociate expressions invalidate the certificate.
|
||||
#if defined(__FAST_MATH__) || (defined(__FINITE_MATH_ONLY__) && __FINITE_MATH_ONLY__ > 0)
|
||||
#error "Polynomial enthalpy certification does not support fast-math or finite-math-only compilation."
|
||||
#endif
|
||||
|
||||
export module mean_field:solver.enthalpy_admissibility;
|
||||
export import :field.mfem;
|
||||
|
||||
@@ -54,6 +60,11 @@ export namespace mean_field::solver {
|
||||
}
|
||||
|
||||
namespace mean_field::solver::enthalpy_detail {
|
||||
static_assert(std::numeric_limits<double>::is_iec559 && std::numeric_limits<double>::radix == 2 &&
|
||||
std::numeric_limits<double>::digits == 53 && std::numeric_limits<double>::max_exponent == 1024 &&
|
||||
std::numeric_limits<double>::has_denorm == std::denorm_present,
|
||||
"Polynomial enthalpy certification requires IEEE 754 binary64 with subnormal support.");
|
||||
|
||||
// Bounds concern the represented polynomial, not a tolerance-relaxed EOS.
|
||||
// Exact zero is retained algebraically so a prescribed zero trace does not
|
||||
// become an unresolved negative interval merely through outward rounding.
|
||||
|
||||
Reference in New Issue
Block a user