-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
RobustnessEnsures that existing features work as intendedEnsures that existing features work as intendedTestingAdditions/changes to the testing infrastrutureAdditions/changes to the testing infrastruturediscussion
Description
The subroutine in question is:
template <typename EOS, typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION bool
CheckRhoSieFromPT(EOS eos, Real rho, Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) {
const Real P = eos.PressureFromDensityTemperature(rho, T, lambda);
const Real sie = eos.InternalEnergyFromDensityTemperature(rho, T, lambda);
Real rtest = 12; // set these to something
Real etest = 1;
eos.DensityEnergyFromPressureTemperature(P, T, lambda, rtest, etest);
Real P_test = eos.PressureFromDensityTemperature(rtest, T, lambda);
Real residual = P_test - P;
Real frac_residual =
std::min(std::abs(singularity::robust::ratio(residual, P)), std::abs(residual));
bool results_good = (isClose(rho, rtest, 1e-8) && isClose(sie, etest, 1e-8))
// This is as good as it will get sometimes.
|| (std::abs(frac_residual) <= 1e-8);
if (!results_good) {
printf("RhoSie of PT failure!\n"
"\trho_true = %.14e\n"
"\tsie_true = %.14e\n"
"\tP = %.14e\n"
"\tT = %.14e\n"
"\trho = %.14e\n"
"\tsie = %.14e\n"
"\tP_test = %.14e\n"
"\tresidual = %.14e\n"
"\tfracres = %.14e\n",
rho, sie, P, T, rtest, etest, P_test, residual, frac_residual);
}
return results_good;
}
As I understand it, is seems like this subroutine want to do the following. Initialize a state
I'm assuming the reason this might be happening this way is because certain EOS member function calls aren't available? What do we think?
Metadata
Metadata
Assignees
Labels
RobustnessEnsures that existing features work as intendedEnsures that existing features work as intendedTestingAdditions/changes to the testing infrastrutureAdditions/changes to the testing infrastruturediscussion