Skip to content

Commit

Permalink
also add sanity check for rhomax vs rhomin
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Jan 3, 2025
1 parent 7d9c90a commit ee5e374
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions singularity-eos/eos/eos_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,12 @@ class EosBase {
constexpr Real DEFAULT_RHO_GUESS = 12;

CRTP copy = *(static_cast<CRTP const *>(this));

// P(rho) not monotone. When relevant, bound rhopmin.
Real rhomin = std::max(copy.RhoPmin(temp), copy.MinimumDensity());
Real rhomax = copy.MaximumDensity();
PORTABLE_REQUIRE(rhomax > rhomin, "max bound > min bound");

auto PofRT = [&](const Real r) {
return copy.PressureFromDensityTemperature(r, temp, lambda);
};
Expand Down

0 comments on commit ee5e374

Please sign in to comment.