Skip to content

Commit

Permalink
set unit_xxx to NAN when units_system == CONSTANTS
Browse files Browse the repository at this point in the history
  • Loading branch information
chongchonghe committed Oct 27, 2024
1 parent babfcef commit 7316bb8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/simulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,29 +409,37 @@ template <typename problem_t> class AMRSimulation : public amrex::AmrCore
static constexpr amrex::Real unit_length = []() constexpr {
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
return Physics_Traits<problem_t>::unit_length;
} else {
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return 1.0;
} else {
return NAN;
}
}();
static constexpr amrex::Real unit_mass = []() constexpr {
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
return Physics_Traits<problem_t>::unit_mass;
} else {
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return 1.0;
} else {
return NAN;
}
}();
static constexpr amrex::Real unit_time = []() constexpr {
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
return Physics_Traits<problem_t>::unit_time;
} else {
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return 1.0;
} else {
return NAN;
}
}();
static constexpr amrex::Real unit_temperature = []() constexpr {
if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CUSTOM) {
return Physics_Traits<problem_t>::unit_temperature;
} else {
} else if constexpr (Physics_Traits<problem_t>::unit_system == UnitSystem::CGS) {
return 1.0;
} else {
return NAN;
}
}();

Expand Down

0 comments on commit 7316bb8

Please sign in to comment.