SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::operators::EquationRegistry< EquationTs > Class Template Referencefinal

A compile-time registry of equations. More...

#include <registry.hpp>

Public Types

using Equations = utils::types::TypeList<EquationTs...>
 The equation types in the registry.
 
using Rows = utils::types::TypeList<discretization::forms::Operand<typename EquationTs::Test>...>
 The residual row types in the registry.
 

Public Member Functions

 EquationRegistry (EquationTs... equations)
 Construct an equation registry with the given equations.
 
template<typename FunctionT>
void for_each (FunctionT &&function) const
 Apply some function to every type in the registry.
 
template<Equation EquationT>
const EquationT & get () const
 Get the equation of a given type from the registry.
 

Private Attributes

std::tuple< EquationTs... > m_equations
 The equations in the registry, stored as a tuple.
 

Detailed Description

template<Equation... EquationTs>
class serif::operators::EquationRegistry< EquationTs >

A compile-time registry of equations.

Template Parameters
EquationTsPack of equation types to register.
Requirements
  • There must be at least one equation type in the pack.
  • Each residual row must be defined exactly once.

Member Typedef Documentation

◆ Equations

template<Equation... EquationTs>
using serif::equations::EquationRegistry< EquationTs >::Equations = utils::types::TypeList<EquationTs...>

The equation types in the registry.

◆ Rows

template<Equation... EquationTs>
using serif::equations::EquationRegistry< EquationTs >::Rows = utils::types::TypeList<discretization::forms::Operand<typename EquationTs::Test>...>

The residual row types in the registry.

Constructor & Destructor Documentation

◆ EquationRegistry()

template<Equation... EquationTs>
serif::equations::EquationRegistry< EquationTs >::EquationRegistry ( EquationTs... equations)
inlineexplicit

Construct an equation registry with the given equations.

Parameters
equationsThe equations to register.

Member Function Documentation

◆ for_each()

template<Equation... EquationTs>
template<typename FunctionT>
void serif::equations::EquationRegistry< EquationTs >::for_each ( FunctionT && function) const
inline

Apply some function to every type in the registry.

Template Parameters
FunctionTThe type of the function to apply. The function must have the signature void(const EquationT&) where EquationT is the type of the equation in the registry.
Parameters
functionThe function to apply to each equation in the registry.

◆ get()

template<Equation... EquationTs>
template<Equation EquationT>
const EquationT & serif::equations::EquationRegistry< EquationTs >::get ( ) const
inlinenodiscard

Get the equation of a given type from the registry.

Template Parameters
EquationTThe type of the equation to get.
Returns
The equation of the given type.

Member Data Documentation

◆ m_equations

template<Equation... EquationTs>
std::tuple<EquationTs...> serif::equations::EquationRegistry< EquationTs >::m_equations
private

The equations in the registry, stored as a tuple.


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