SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT > Struct Template Referencefinal

Describe the independently ordered physical state and residual coordinates of a discrete system. More...

#include <system_layout.hpp>

Collaboration diagram for serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >:
[legend]

Public Types

using Values = std::remove_cvref_t<ValuesT>
 The physical coordinates represented in the state vector.
 
using Residuals = std::remove_cvref_t<ResidualsT>
 The physical coordinates represented in the residual vector.
 
template<RepresentedValueKind Kind>
using Coordinates = std::conditional_t<Kind == RepresentedValueKind::value, Values, Residuals>
 Select the coordinate tag at compile time based on the kind of the represented values selected (e.g. RepresentedValueKind::values or RepresentedValueKind::residuals).
 

Public Member Functions

template<RepresentedValueKind Kind>
requires (Kind == RepresentedValueKind::value || Kind == RepresentedValueKind::residual)
std::span< const std::size_t > sizes () const noexcept
 Get the sizes of the physical coordinates for the requested kind.
 
template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
std::size_t size () const noexcept
 Read the coefficient count for a physical coordinate.
 
template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
std::size_t offset () const
 Locate a coordinate in packed storage, rejecting size overflow before creating a view. Note that this specifically locates the first coefficient of a coordinate, or the offset to where that coordinate's coefficients begin in packed storage.
 
template<RepresentedValueKind Kind>
requires (Kind == RepresentedValueKind::value || Kind == RepresentedValueKind::residual)
std::size_t total_size () const
 Count all coefficients of one kind.
 
bool operator== (const SystemLayout &) const =default
 Default equality comparison.
 

Static Public Member Functions

template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
static consteval std::size_t index ()
 Locate a physical identity on the requested side of the system.
 

Public Attributes

std::array< std::size_t, utils::dependencies::key_count_v< Values > > state_sizes
 The coefficient counts for each physical coordinate in the state vector, in the order of Values.
 
std::array< std::size_t, utils::dependencies::key_count_v< Residuals > > residual_sizes
 The coefficient counts for each physical coordinate in the residual vector, in the order of Residuals.
 

Detailed Description

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
struct serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >

Describe the independently ordered physical state and residual coordinates of a discrete system.

Template Parameters
ValuesTA KeyList of the physical coordinates represented in the state vector.
ResidualsTA KeyList of the physical coordinates represented in the residual vector.

Member Typedef Documentation

◆ Coordinates

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
template<RepresentedValueKind Kind>
using serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::Coordinates = std::conditional_t<Kind == RepresentedValueKind::value, Values, Residuals>

Select the coordinate tag at compile time based on the kind of the represented values selected (e.g. RepresentedValueKind::values or RepresentedValueKind::residuals).

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
Requirements
Note
This requires clause is not strictly necessary right now since we have a template type argument; however, if we ever add more RepresentedValueKind types, this will ensure that we don't accidentally allow them to be used here.

◆ Residuals

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
using serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::Residuals = std::remove_cvref_t<ResidualsT>

The physical coordinates represented in the residual vector.

◆ Values

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
using serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::Values = std::remove_cvref_t<ValuesT>

The physical coordinates represented in the state vector.

Member Function Documentation

◆ index()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
static consteval std::size_t serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::index ( )
inlinestaticnodiscardconsteval

Locate a physical identity on the requested side of the system.

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
CoordinateThe coordinate type to locate.
Returns
The index of the coordinate in the requested kind.
Requirements
  • Coordinate is contained in the KeyList of the requested kind.

◆ offset()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
std::size_t serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::offset ( ) const
inlinenodiscard

Locate a coordinate in packed storage, rejecting size overflow before creating a view. Note that this specifically locates the first coefficient of a coordinate, or the offset to where that coordinate's coefficients begin in packed storage.

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
CoordinateThe coordinate type to locate.
Returns
The offset of the coordinate in the requested kind. (e.g. the index of the first coefficient of that coordinate in packed storage.)
Requirements
  • Coordinate is contained in the KeyList of the requested kind.

◆ operator==()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
bool serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::operator== ( const SystemLayout< ValuesT, ResidualsT > & ) const
nodiscarddefault

Default equality comparison.

◆ size()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
template<RepresentedValueKind Kind, typename Coordinate>
requires utils::dependencies::ContainsKey<Coordinate, Coordinates<Kind>>
std::size_t serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::size ( ) const
inlinenodiscardnoexcept

Read the coefficient count for a physical coordinate.

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
CoordinateThe coordinate type to locate.
Returns
The coefficient count for the specified coordinate.
Requirements
  • Coordinate is contained in the KeyList of the requested kind.

◆ sizes()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
std::span< const std::size_t > serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::sizes ( ) const
inlinenodiscardnoexcept

Get the sizes of the physical coordinates for the requested kind.

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
Returns
A span of sizes for the physical coordinates of the requested kind.
Requirements

◆ total_size()

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
std::size_t serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::total_size ( ) const
inlinenodiscard

Count all coefficients of one kind.

Template Parameters
KindThe kind of represented values to select, e.g. RepresentedValueKind::values or RepresentedValueKind::residuals.
Returns
The total coefficient count for the requested kind.

Member Data Documentation

◆ residual_sizes

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
std::array<std::size_t, utils::dependencies::key_count_v<Residuals> > serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::residual_sizes

The coefficient counts for each physical coordinate in the residual vector, in the order of Residuals.

◆ state_sizes

template<utils::dependencies::IsKeyList ValuesT, utils::dependencies::IsKeyList ResidualsT>
std::array<std::size_t, utils::dependencies::key_count_v<Values> > serif::discretization::blocks::SystemLayout< ValuesT, ResidualsT >::state_sizes

The coefficient counts for each physical coordinate in the state vector, in the order of Values.


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