SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT > Struct Template Reference

#include <point.hpp>

Public Types

template<typename OperandT>
using Entry = std::conditional_t<std::is_void_v<OutputT>, discretization::forms::OperandValue<OperandT>, discretization::forms::PartialDerivative<OutputT, discretization::forms::OperandValue<OperandT>>>
 The type of the entry in the storage for a given operand. If OutputT is void, this is the value of the operand; otherwise, it is the local derivative of OutputT with respect to the operand value.
 
using Storage = std::conditional_t<(std::same_as<Entry<Operands>, double> && ...), std::array<double, count>, std::tuple<Entry<Operands>...>>
 The storage type for the operand values or local derivatives. If all entries are of type double, this is a std::array<double, count>; otherwise, it is a std::tuple<Entry<Operands>...>.
 

Public Member Functions

template<typename KeyT>
decltype(auto) get ()
 Get the value or local partial for a uniquely identified operand.
 
template<typename KeyT>
decltype(auto) get () const
 Get the value or local partial for a uniquely identified operand.
 

Static Public Member Functions

template<typename KeyT>
static consteval std::size_t index ()
 Get the index of a uniquely identified operand in the storage. If the operand is not uniquely identified, this will trigger a static assertion.
 

Public Attributes

Storage values {}
 

Static Public Attributes

static constexpr std::size_t count = sizeof...(Operands)
 The number of operands in the list, which is the size of the pack of operands.
 

Member Typedef Documentation

◆ Entry

template<typename OutputT, discretization::forms::IsOperand... Operands>
template<typename OperandT>
using serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::Entry = std::conditional_t<std::is_void_v<OutputT>, discretization::forms::OperandValue<OperandT>, discretization::forms::PartialDerivative<OutputT, discretization::forms::OperandValue<OperandT>>>

The type of the entry in the storage for a given operand. If OutputT is void, this is the value of the operand; otherwise, it is the local derivative of OutputT with respect to the operand value.

Template Parameters
OperandTThe operand type for which to determine the entry type.

◆ Storage

template<typename OutputT, discretization::forms::IsOperand... Operands>
using serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::Storage = std::conditional_t<(std::same_as<Entry<Operands>, double> && ...), std::array<double, count>, std::tuple<Entry<Operands>...>>

The storage type for the operand values or local derivatives. If all entries are of type double, this is a std::array<double, count>; otherwise, it is a std::tuple<Entry<Operands>...>.

Member Function Documentation

◆ get() [1/2]

template<typename OutputT, discretization::forms::IsOperand... Operands>
template<typename KeyT>
decltype(auto) serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::get ( )
inline

Get the value or local partial for a uniquely identified operand.

Template Parameters
KeyTThe operand type for which to get the value or local partial.
Returns
A reference to the value or local partial of the operand in the storage.

◆ get() [2/2]

template<typename OutputT, discretization::forms::IsOperand... Operands>
template<typename KeyT>
decltype(auto) serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::get ( ) const
inline

Get the value or local partial for a uniquely identified operand.

Template Parameters
KeyTThe operand type for which to get the value or local partial.
Returns
A const reference to the value or local partial of the operand in the storage.

◆ index()

template<typename OutputT, discretization::forms::IsOperand... Operands>
template<typename KeyT>
static consteval std::size_t serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::index ( )
inlinestaticconsteval

Get the index of a uniquely identified operand in the storage. If the operand is not uniquely identified, this will trigger a static assertion.

Template Parameters
KeyTThe operand type for which to get the index.
Returns
The index of the operand in the storage.

@requires The operand must occur exactly once in the list of operands, otherwise a static assertion will be triggered. Use Operand<Term, Operation> when a term has multiple sampled operations.

Member Data Documentation

◆ count

template<typename OutputT, discretization::forms::IsOperand... Operands>
std::size_t serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::count = sizeof...(Operands)
staticconstexpr

The number of operands in the list, which is the size of the pack of operands.

◆ values

template<typename OutputT, discretization::forms::IsOperand... Operands>
Storage serif::equations::OperandValues< utils::types::TypeList< Operands... >, OutputT >::values {}

The documentation for this struct was generated from the following file: