Skip to content

Commit

Permalink
be REALLY explicit about wanting (Real*)(NULL)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Apr 19, 2024
1 parent 35535a3 commit f519eb0
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 83 deletions.
142 changes: 84 additions & 58 deletions singularity-eos/eos/eos_spiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,58 +105,71 @@ class SpinerEOSDependsRhoT : public EosBase<SpinerEOSDependsRhoT> {

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real TemperatureFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real
MinInternalEnergyFromDensity(const Real rho, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real MinInternalEnergyFromDensity(
const Real rho, Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real InternalEnergyFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real PressureFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
PressureFromDensityTemperature(const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real PressureFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
EntropyFromDensityTemperature(const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Indexer_t &&lambda, Real &rho, Real &sie) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void FillEos(Real &rho, Real &temp, Real &energy, Real &press,
Real &cv, Real &bmod, const unsigned long output,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION void
FillEos(Real &rho, Real &temp, Real &energy, Real &press, Real &cv, Real &bmod,
const unsigned long output,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Real &cv,
Real &bmod, Real &dpde, Real &dvdt,
Indexer_t &&lambda = nullptr) const;
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

PORTABLE_INLINE_FUNCTION
Real RhoPmin(const Real temp) const;
Expand Down Expand Up @@ -226,21 +239,21 @@ class SpinerEOSDependsRhoT : public EosBase<SpinerEOSDependsRhoT> {
Real T_(const Real lT) const noexcept { return fromLog_(lT, lTOffset_); }

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real lTFromlRhoSie_(const Real lRho, const Real sie,
TableStatus &whereAmI,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
lTFromlRhoSie_(const Real lRho, const Real sie, TableStatus &whereAmI,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real lTFromlRhoP_(const Real lRho, const Real press,
TableStatus &whereAmI,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
lTFromlRhoP_(const Real lRho, const Real press, TableStatus &whereAmI,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real lRhoFromPlT_(const Real P, const Real lT,
TableStatus &whereAmI,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
lRhoFromPlT_(const Real P, const Real lT, TableStatus &whereAmI,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void getLogsRhoT_(const Real rho, const Real temperature,
Real &lRho, Real &lT,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION void
getLogsRhoT_(const Real rho, const Real temperature, Real &lRho, Real &lT,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
PORTABLE_INLINE_FUNCTION
Real sieFromlRhoTlT_(const Real lRho, const Real T, const Real lT,
const TableStatus &whereAmI) const;
Expand Down Expand Up @@ -345,59 +358,72 @@ class SpinerEOSDependsRhoSie : public EosBase<SpinerEOSDependsRhoSie> {

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real TemperatureFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real InternalEnergyFromDensityTemperature(
const Real rho, const Real T, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real PressureFromDensityTemperature(
const Real rho, const Real T, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
PressureFromDensityTemperature(const Real rho, const Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real PressureFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real
MinInternalEnergyFromDensity(const Real rho, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real MinInternalEnergyFromDensity(
const Real rho, Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityTemperature(
const Real rho, const Real temperature, Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
EntropyFromDensityTemperature(const Real rho, const Real temperature,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityTemperature(
const Real rho, const Real T, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityTemperature(
const Real rho, const Real T, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityTemperature(
const Real rho, const Real T, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real T,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityInternalEnergy(
const Real rho, const Real sie, Indexer_t &&lambda = nullptr) const;
const Real rho, const Real sie,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Indexer_t &&lambda, Real &rho, Real &sie) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void FillEos(Real &rho, Real &temp, Real &energy, Real &press,
Real &cv, Real &bmod, const unsigned long output,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION void
FillEos(Real &rho, Real &temp, Real &energy, Real &press, Real &cv, Real &bmod,
const unsigned long output,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Real &cv,
Real &bmod, Real &dpde, Real &dvdt,
Indexer_t &&lambda = nullptr) const;
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;

static constexpr unsigned long PreferredInput() { return _preferred_input; }
static inline unsigned long scratch_size(std::string method, unsigned int nelements) {
Expand Down Expand Up @@ -457,13 +483,13 @@ class SpinerEOSDependsRhoSie : public EosBase<SpinerEOSDependsRhoSie> {
return FastMath::pow10(lx) - offset;
}
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real interpRhoT_(const Real rho, const Real T,
const DataBox &db,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
interpRhoT_(const Real rho, const Real T, const DataBox &db,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real interpRhoSie_(const Real rho, const Real sie,
const DataBox &db,
Indexer_t &&lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION Real
interpRhoSie_(const Real rho, const Real sie, const DataBox &db,
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const;
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION Real lRhoFromPlT_(const Real P, const Real lT,
Indexer_t &&lambda) const;
Expand Down
Loading

0 comments on commit f519eb0

Please sign in to comment.