SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::eos::runtime Namespace Reference

Classes

class  EOSView
 A class to provide a runtime view of an EOS model and its relations. This class is used to provide a uniform interface for evaluating relations and partial derivatives at runtime. More...
 
struct  HasRuntimeQuantityIdentifiers
 A helper trait to determine if a relation has runtime quantity identifiers. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers. More...
 
struct  HasRuntimeQuantityIdentifiers< relations::Relation< OutputT, InputTs... > >
 A specialization of the HasRuntimeQuantityIdentifiers trait for a relation. This specialization checks if the output and input quantities of the relation have runtime quantity identifiers. More...
 
struct  RuntimeCatalogDispatch
 A helper struct to dispatch runtime evaluation of relations in a catalog. This is used to simplify the usage of std::expected in the runtime system. More...
 
struct  RuntimeCatalogDispatch< EOS, relations::RelationCatalog< RelationTs... > >
 A specialization of the RuntimeCatalogDispatch struct for a catalog of relations. This specialization dispatches runtime evaluation of relations in the catalog. More...
 
struct  RuntimeCatalogIsSupported
 A helper trait to determine if a catalog of relations is supported by the runtime system. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers. More...
 
struct  RuntimeCatalogIsSupported< relations::RelationCatalog< RelationTs... > >
 A specialization of the RuntimeCatalogIsSupported trait for a catalog of relations. This specialization checks if the relations in the catalog have runtime quantity identifiers and if the runtime quantity identifiers are unambiguous. More...
 
struct  RuntimeCatalogStorage
 A helper struct to store the runtime relation descriptors for a catalog of relations. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers. More...
 
struct  RuntimeCatalogStorage< EOS, relations::RelationCatalog< RelationTs... > >
 A specialization of the RuntimeCatalogStorage struct for a catalog of relations. This specialization stores the runtime relation descriptors for each relation in the catalog. More...
 
struct  RuntimeRelationQuantities
 A helper trait to extract the output and input quantity types from a relation. This is used to simplify the usage of relations in the runtime system. More...
 
struct  RuntimeRelationQuantities< relations::Relation< OutputT, InputTs... > >
 A specialization of the RuntimeRelationQuantities trait for a relation. This specialization extracts the output and input quantity types from the relation and stores them in a tuple. More...
 
struct  RuntimeRelationsAreSupported
 A helper trait to determine if the runtime quantity identifiers in a catalog of relations are unambiguous. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers. More...
 
struct  RuntimeRelationsAreSupported< true, RelationTs... >
 A specialization of the RuntimeRelationsAreSupported trait for a catalog of relations. This specialization checks if the runtime quantity identifiers in the catalog are unambiguous. More...
 
struct  RuntimeRelationStorage
 A helper trait to determine if a catalog of relations is supported by the runtime system. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers. More...
 
struct  RuntimeRelationStorage< EOS, relations::Relation< OutputT, InputTs... > >
 A specialization of the RuntimeRelationStorage trait for a relation. This specialization extracts the output and input quantity types from the relation and stores them in a tuple. More...
 

Concepts

concept  RuntimeEOSModel
 A concept to determine if a type is a valid runtime EOS model. A type is a valid RuntimeEOSModel if it satisfies the EOSModel concept and if its Relations catalog is supported by the runtime system.
 

Typedefs

template<RuntimeEOSModel EOSCandidate>
using RuntimeEOSAdapter = RuntimeCatalogDispatch<EOSCandidate, typename EOSCandidate::Relations>
 A helper alias to adapt a runtime EOS model to the runtime catalog dispatch system. This is used to simplify the usage of runtime EOS models in the runtime system.
 
template<typename... RelationTs>
using RuntimeCatalogQuantityTuple = decltype(std::tuple_cat(std::declval<typename RuntimeRelationQuantities<RelationTs>::Type>()...))
 A helper alias to extract the quantity types from a catalog of relations. This is used to simplify the usage of catalogs in the runtime system.
 

Functions

template<RuntimeEOSModel EOSCandidate>
constexpr std::span< const dimensions::runtime::RuntimeRelationDescriptor > runtimeRelationDescriptors () noexcept
 A helper function to get the runtime relation descriptors for a runtime EOS model. This is used to simplify the usage of runtime EOS models in the runtime system.
 
template<typename FirstQuantityT, typename SecondQuantityT>
consteval bool runtimeQuantityIdentifiersAreCompatible ()
 A helper function to determine if two runtime quantity identifiers are compatible. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.
 
template<typename QuantityTupleT, std::size_t First, std::size_t... Offsets>
consteval bool runtimeQuantityIdentifierIsUnambiguous (std::index_sequence< Offsets... >)
 A helper function to determine if the runtime quantity identifiers in a tuple of quantity types are unambiguous. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.
 
template<typename QuantityTupleT, std::size_t... Indices>
consteval bool runtimeQuantityIdentifiersAreUnambiguous (std::index_sequence< Indices... >)
 A helper function to determine if the runtime quantity identifiers in a tuple of quantity types are unambiguous. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.
 
std::expected< double, utils::errors::SERiFErrorCode > runtimeEvaluationFailure (const utils::errors::SERiFErrorCode code)
 A helper function to create a std::unexpected with a SERiFErrorCode. This is used to simplify the usage of std::expected in the runtime system.
 
template<typename EOS, typename OutputT, typename... InputTs>
std::expected< double, utils::errors::SERiFErrorCode > evaluateRuntimeRelation (const EOS &eos, relations::Relation< OutputT, InputTs... >, const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues)
 A helper function to evaluate a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.
 
template<typename InputQuantityT, typename EOS, typename OutputT, typename... InputTs>
bool tryRuntimePartialDerivative (const EOS &eos, relations::Relation< OutputT, InputTs... >, const dimensions::runtime::ThermodynamicQuantityID withRespectTo, const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues, std::expected< double, utils::errors::SERiFErrorCode > &result)
 A helper function to evaluate a partial derivative of a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.
 
template<typename EOS, typename OutputT, typename... InputTs>
std::expected< double, utils::errors::SERiFErrorCode > evaluateRuntimePartialDerivative (const EOS &eos, relations::Relation< OutputT, InputTs... > relation, const dimensions::runtime::ThermodynamicQuantityID withRespectTo, const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues)
 A helper function to evaluate a partial derivative of a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.
 
template<typename EOS, typename RelationT>
bool runtimeRelationMatches (const dimensions::runtime::ThermodynamicQuantityID outputQuantityID, const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues)
 A helper function to determine if a relation matches the given output quantity and input quantities at runtime. This is used to simplify the usage of std::expected in the runtime system.
 

Typedef Documentation

◆ RuntimeCatalogQuantityTuple

template<typename... RelationTs>
using serif::eos::runtime::RuntimeCatalogQuantityTuple = decltype(std::tuple_cat(std::declval<typename RuntimeRelationQuantities<RelationTs>::Type>()...))

A helper alias to extract the quantity types from a catalog of relations. This is used to simplify the usage of catalogs in the runtime system.

Template Parameters
RelationTsThe relation types in the catalog.

◆ RuntimeEOSAdapter

template<RuntimeEOSModel EOSCandidate>
using serif::eos::runtime::RuntimeEOSAdapter = RuntimeCatalogDispatch<EOSCandidate, typename EOSCandidate::Relations>

A helper alias to adapt a runtime EOS model to the runtime catalog dispatch system. This is used to simplify the usage of runtime EOS models in the runtime system.

Template Parameters
EOSCandidateThe runtime EOS model type to adapt.

Function Documentation

◆ evaluateRuntimePartialDerivative()

template<typename EOS, typename OutputT, typename... InputTs>
std::expected< double, utils::errors::SERiFErrorCode > serif::eos::runtime::evaluateRuntimePartialDerivative ( const EOS & eos,
relations::Relation< OutputT, InputTs... > relation,
const dimensions::runtime::ThermodynamicQuantityID withRespectTo,
const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues )
nodiscard

A helper function to evaluate a partial derivative of a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.

Template Parameters
EOSThe EOS model type that supports the relation.
OutputTThe output quantity type of the relation.
InputTsThe input quantity types of the relation.
Parameters
eosThe EOS model instance to use for evaluation.
relationThe relation to evaluate.
withRespectToThe input quantity type to take the partial derivative with respect to.
inputValuesThe input values to use for evaluation.
Returns
A std::expected containing the result of the evaluation or a SERiFErrorCode if the evaluation failed.

◆ evaluateRuntimeRelation()

template<typename EOS, typename OutputT, typename... InputTs>
std::expected< double, utils::errors::SERiFErrorCode > serif::eos::runtime::evaluateRuntimeRelation ( const EOS & eos,
relations::Relation< OutputT, InputTs... > ,
const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues )
nodiscard

A helper function to evaluate a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.

Template Parameters
EOSThe EOS model type that supports the relation.
OutputTThe output quantity type of the relation.
InputTsThe input quantity types of the relation.
Parameters
eosThe EOS model instance to use for evaluation.
relationThe relation to evaluate.
inputValuesThe input values to use for evaluation.
Returns
A std::expected containing the result of the evaluation or a SERiFErrorCode if the evaluation failed.

◆ runtimeEvaluationFailure()

std::expected< double, utils::errors::SERiFErrorCode > serif::eos::runtime::runtimeEvaluationFailure ( const utils::errors::SERiFErrorCode code)
inlinenodiscard

A helper function to create a std::unexpected with a SERiFErrorCode. This is used to simplify the usage of std::expected in the runtime system.

Parameters
codeThe SERiFErrorCode to wrap in a std::unexpected.
Returns
A std::unexpected containing the given SERiFErrorCode.

◆ runtimeQuantityIdentifierIsUnambiguous()

template<typename QuantityTupleT, std::size_t First, std::size_t... Offsets>
bool serif::eos::runtime::runtimeQuantityIdentifierIsUnambiguous ( std::index_sequence< Offsets... > )
nodiscardconsteval

A helper function to determine if the runtime quantity identifiers in a tuple of quantity types are unambiguous. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.

Template Parameters
QuantityTupleTThe tuple of quantity types to check.
FirstThe index of the first quantity type to check.
OffsetsThe indices of the remaining quantity types to check.
Returns
True if the quantity identifiers are unambiguous, false otherwise.

◆ runtimeQuantityIdentifiersAreCompatible()

template<typename FirstQuantityT, typename SecondQuantityT>
bool serif::eos::runtime::runtimeQuantityIdentifiersAreCompatible ( )
nodiscardconsteval

A helper function to determine if two runtime quantity identifiers are compatible. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.

Template Parameters
FirstQuantityTThe first quantity type to check.
SecondQuantityTThe second quantity type to check.
Returns
True if the quantity identifiers are compatible, false otherwise.

◆ runtimeQuantityIdentifiersAreUnambiguous()

template<typename QuantityTupleT, std::size_t... Indices>
bool serif::eos::runtime::runtimeQuantityIdentifiersAreUnambiguous ( std::index_sequence< Indices... > )
nodiscardconsteval

A helper function to determine if the runtime quantity identifiers in a tuple of quantity types are unambiguous. This is used to ensure that all relations in a catalog have unique runtime quantity identifiers.

Template Parameters
QuantityTupleTThe tuple of quantity types to check.
IndicesThe indices of the quantity types to check.
Returns
True if the quantity identifiers are unambiguous, false otherwise.

◆ runtimeRelationDescriptors()

template<RuntimeEOSModel EOSCandidate>
std::span< const dimensions::runtime::RuntimeRelationDescriptor > serif::eos::runtime::runtimeRelationDescriptors ( )
nodiscardconstexprnoexcept

A helper function to get the runtime relation descriptors for a runtime EOS model. This is used to simplify the usage of runtime EOS models in the runtime system.

Template Parameters
EOSCandidateThe runtime EOS model type to get the descriptors for.
Returns
A span of runtime relation descriptors.

◆ runtimeRelationMatches()

template<typename EOS, typename RelationT>
bool serif::eos::runtime::runtimeRelationMatches ( const dimensions::runtime::ThermodynamicQuantityID outputQuantityID,
const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues )
nodiscard

A helper function to determine if a relation matches the given output quantity and input quantities at runtime. This is used to simplify the usage of std::expected in the runtime system.

Template Parameters
EOSThe EOS model type that supports the relation.
RelationTThe relation type to check.
Parameters
outputQuantityIDThe output quantity type to check.
inputValuesThe input values to check.
Returns
True if the relation matches the given output quantity and input quantities, false otherwise.

◆ tryRuntimePartialDerivative()

template<typename InputQuantityT, typename EOS, typename OutputT, typename... InputTs>
bool serif::eos::runtime::tryRuntimePartialDerivative ( const EOS & eos,
relations::Relation< OutputT, InputTs... > ,
const dimensions::runtime::ThermodynamicQuantityID withRespectTo,
const std::span< const dimensions::runtime::RuntimeQuantityValue > inputValues,
std::expected< double, utils::errors::SERiFErrorCode > & result )
nodiscard

A helper function to evaluate a partial derivative of a relation at runtime. This is used to simplify the usage of std::expected in the runtime system.

Template Parameters
InputQuantityTThe input quantity type to take the partial derivative with respect to.
EOSThe EOS model type that supports the relation.
OutputTThe output quantity type of the relation.
InputTsThe input quantity types of the relation.
Parameters
eosThe EOS model instance to use for evaluation.
relationThe relation to evaluate.
withRespectToThe input quantity type to take the partial derivative with respect to.
inputValuesThe input values to use for evaluation.
Returns
A std::expected containing the result of the evaluation or a SERiFErrorCode if the evaluation failed.