-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various features in PrimitiveSolver #628
Various features in PrimitiveSolver #628
Conversation
This might be a wild idea, but I think we could do some tricks in KOKKOS_INLINE_FUNCTION Real GetBaryonChemicalPotential(Real n, Real T, Real *Y) const {
if constexpr (supports_neutrinos) {
return EOSPolicy::BaryonChemicalPotential(...);
}
} for all the extra functions, where we define template <typename EOSPolicy, typename ErrorPolicy>
class EOS : public EOSPolicy, public ErrorPolicy {
...
static constexpr bool supports_neutrinos = std::is_base_of_v<SupportsNeutrinos, EOSPolicy>;
...
}; and then inside class SupportsNeutrinos {}; and let |
I am not in principle against this, however it is not necessarily a blanket statement that all CompOSE EoSs can support neutrinos, and non-CompOSE EoSs can't, so I'm not sure. |
The non-CompOSE case would be easy because we just ensure that a hypothetical neutrino-supporting EOS extends class CanSupportNeutrinos {
protected:
bool has_potentials;
public:
KOKKOS_INLINE_FUNCTION
bool HasChemicalPotentials() const {
return has_potentials;
}
}; Modules that need chemical potentials could check that Of course, I guess the question is if this is more complicated than simply adding a bunch of empty functions inside other equations of state. |
Could we pivot slightly and use the class you suggest to generally keep track of implemented features (rather than explicitly neutrinos)? e.g. the entropy inops we currently have. |
Sure, that would be simple enough. Something like this, then? class SupportsExtendedFeatures {
private:
bool has_potentials;
bool has_entropy;
public:
bool HasChemicalPotentials() const {
return has_potentials;
}
bool HasEntropy() const {
return has_entropy;
}
}; |
Adds support for Single-Precision floating point NQT functions, hybrid table (1D) + gamma law EoSs, and neutrino equilbrium functions to PrimitiveSolver.