diff --git a/src/simulation.hpp b/src/simulation.hpp index 3a091484a..2f708b514 100644 --- a/src/simulation.hpp +++ b/src/simulation.hpp @@ -409,29 +409,37 @@ template class AMRSimulation : public amrex::AmrCore static constexpr amrex::Real unit_length = []() constexpr { if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { return Physics_Traits::unit_length; - } else { + } else if constexpr (Physics_Traits::unit_system == UnitSystem::CGS) { return 1.0; + } else { + return NAN; } }(); static constexpr amrex::Real unit_mass = []() constexpr { if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { return Physics_Traits::unit_mass; - } else { + } else if constexpr (Physics_Traits::unit_system == UnitSystem::CGS) { return 1.0; + } else { + return NAN; } }(); static constexpr amrex::Real unit_time = []() constexpr { if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { return Physics_Traits::unit_time; - } else { + } else if constexpr (Physics_Traits::unit_system == UnitSystem::CGS) { return 1.0; + } else { + return NAN; } }(); static constexpr amrex::Real unit_temperature = []() constexpr { if constexpr (Physics_Traits::unit_system == UnitSystem::CUSTOM) { return Physics_Traits::unit_temperature; - } else { + } else if constexpr (Physics_Traits::unit_system == UnitSystem::CGS) { return 1.0; + } else { + return NAN; } }();