Skip to content

Commit 522f37e

Browse files
committed
Add concepts for has_cv nad has_gamma
1 parent ee9d2ff commit 522f37e

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

singularity-eos/eos/eos_spiner_rho_sie.hpp

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,42 @@ struct has_bmod_rho_sie<
164164
EOS, void_t<decltype(std::declval<EOS>().BulkModulusFromDensityInternalEnergy(
165165
std::declval<Real>(), std::declval<Real>()))>> : std::true_type {};
166166

167+
// Detect GruneisenParamFromDensityTemperature
168+
template <typename EOS, typename = void>
169+
struct has_gamma_rho_T : std::false_type {};
170+
171+
template<typename EOS>
172+
struct has_gamma_rho_T<
173+
EOS, void_t<decltype(std::declval<EOS>().GruneisenParamFromDensityTemperature(
174+
std::declval<Real>(), std::declval<Real>()))>> : std::true_type {};
175+
176+
// Detect GruneisenParamFromDensityInternalEnergy
177+
template <typename EOS, typename = void>
178+
struct has_gamma_rho_sie : std::false_type {};
179+
180+
template<typename EOS>
181+
struct has_gamma_rho_sie<
182+
EOS, void_t<decltype(std::declval<EOS>().GruneisenParamFromDensityInternalEnergy(
183+
std::declval<Real>(), std::declval<Real>()))>> : std::true_type {};
184+
185+
// Detect SpecificHeatFromDensityTemperature
186+
template <typename EOS, typename = void>
187+
struct has_cv_rho_T : std::false_type {};
188+
189+
template<typename EOS>
190+
struct has_cv_rho_T<
191+
EOS, void_t<decltype(std::declval<EOS>().SpecificHeatFromDensityTemperature(
192+
std::declval<Real>(), std::declval<Real>()))>> : std::true_type {};
193+
194+
// Detect SpecificHeatFromDensityInternalEnergy
195+
template <typename EOS, typename = void>
196+
struct has_cv_rho_sie : std::false_type {};
197+
198+
template<typename EOS>
199+
struct has_cv_rho_sie<
200+
EOS, void_t<decltype(std::declval<EOS>().SpecificHeatFromDensityInternalEnergy(
201+
std::declval<Real>(), std::declval<Real>()))>> : std::true_type {};
202+
167203
// Detect Abar() method
168204
template <typename EOS, typename = void>
169205
struct has_abar : std::false_type {};
@@ -194,6 +230,18 @@ inline constexpr bool has_bmod_rho_T_v = has_bmod_rho_T<EOS>::value;
194230
template <typename EOS>
195231
inline constexpr bool has_bmod_rho_sie_v = has_bmod_rho_sie<EOS>::value;
196232

233+
template <typename EOS>
234+
inline constexpr bool has_gamma_rho_T_v = has_gamma_rho_T<EOS>::value;
235+
236+
template <typename EOS>
237+
inline constexpr bool has_gamma_rho_sie_v = has_gamma_rho_sie<EOS>::value;
238+
239+
template <typename EOS>
240+
inline constexpr bool has_cv_rho_T_v = has_cv_rho_T<EOS>::value;
241+
242+
template <typename EOS>
243+
inline constexpr bool has_cv_rho_sie_v = has_cv_rho_sie<EOS>::value;
244+
197245
template <typename EOS>
198246
inline constexpr bool has_abar_v = has_abar<EOS>::value;
199247

@@ -216,6 +264,26 @@ concept has_bmod_rho_sie = requires(EOS eos, Real rho, Real sie) {
216264
{ eos.BulkModulusFromDensityInternalEnergy(rho, sie) } -> std::same_as<Real>;
217265
};
218266

267+
template <typename EOS>
268+
concept has_gamma_rho_T = requires(EOS eos, Real rho, Real T) {
269+
{ eos.GruneisenParamFromDensityTemperature(rho, T) } -> std::same_as<Real>;
270+
};
271+
272+
template <typename EOS>
273+
concept has_gamma_rho_sie = requires(EOS eos, Real rho, Real sie) {
274+
{ eos.GruneisenParamFromDensityInternalEnergy(rho, sie) } -> std::same_as<Real>;
275+
};
276+
277+
template <typename EOS>
278+
concept has_cv_rho_T = requires(EOS eos, Real rho, Real T) {
279+
{ eos.SpecificHeatFromDensityTemperature(rho, T) } -> std::same_as<Real>;
280+
};
281+
282+
template <typename EOS>
283+
concept has_cv_rho_sie = requires(EOS eos, Real rho, Real sie) {
284+
{ eos.SpecificHeatFromDensityInternalEnergy(rho, sie) } -> std::same_as<Real>;
285+
};
286+
219287
template <typename EOS>
220288
concept has_abar = requires(EOS eos) {
221289
{ eos.Abar() } -> std::same_as<Real>;

0 commit comments

Comments
 (0)