template<typename... Tags>
tk::ctr::ncomponents class

Number of components storage.

All this trickery with boost::mpl allows the code below to be generic. As a result, adding a new component requires adding a single line (a tag and its type) to the already existing list, see typedefs 'ncomps'. The member functions, doing initialization, computing the number of total components, the offset for a given tag, and computing the offset map, need no change – even if the order of the number of components change.

Base classes

template<typename... Ts>
struct tk::tuple::tagged_tuple

Public types

using tags = typename brigand::remove<brigand::list<Tags...>, std::vector<ncomp_type>>
Remove std::vector< ncomp_type > types, i.e., keep only the tags.

Constructors, destructors, conversion operators

ncomponents()
Default constructor: set defaults to zero for all number of components.

Public functions

auto nprop() const -> ncomp_type noexcept
template<typename tag>
auto offset(ncomp_type c) const -> ncomp_type noexcept
template<class InputDeck>
auto offsetmap(const InputDeck& deck) const -> OffsetMap
template<class InputDeck>
auto ncompmap(const InputDeck& deck) const -> NcompMap
Compute map of number of properties (scalar components) associated to dependent variables.
template<class InputDeck>
auto depvar(const InputDeck& deck) const -> std::vector<std::string>
Return vector of dependent variables + component id for all equations configured.

Function documentation

template<typename... Tags>
ncomp_type tk::ctr::ncomponents<Tags>::nprop() const noexcept

Returns Total number of components

template<typename... Tags> template<typename tag>
ncomp_type tk::ctr::ncomponents<Tags>::offset(ncomp_type c) const noexcept

Parameters
in Index for system given by template argument tag
Returns offset for tag

template<typename... Tags> template<class InputDeck>
OffsetMap tk::ctr::ncomponents<Tags>::offsetmap(const InputDeck& deck) const

Parameters
deck in Input deck to operate on
Returns Map of offsets associated to dependent variables

Compute map of offsets associated to dependent variables

template<typename... Tags> template<class InputDeck>
NcompMap tk::ctr::ncomponents<Tags>::ncompmap(const InputDeck& deck) const

Compute map of number of properties (scalar components) associated to dependent variables.

Parameters
deck in Input deck to operate on
Returns Map of number of properties associated to dependent variables

template<typename... Tags> template<class InputDeck>
std::vector<std::string> tk::ctr::ncomponents<Tags>::depvar(const InputDeck& deck) const

Return vector of dependent variables + component id for all equations configured.

Parameters
deck in Input deck to operate on
Returns Vector of dependent variables + comopnent id for all equations configured. The length of this vector equals the total number of components configured, see nprop(), containing the depvar + the component index relative to the given equation. E.g., c1, c2, u1, u2, u3, u4, u5.