details Namespace Reference

CPP API: mio::details Namespace Reference
mio::details Namespace Reference

Classes

struct  AllOf
 
struct  AllOf< Pred >
 
struct  AllOf< Pred, Head, Tail... >
 
struct  AnyOf
 
struct  AnyOf< Pred >
 
struct  AnyOf< Pred, Head, Tail... >
 
struct  BindHead
 
struct  BindTail
 
struct  Empty
 
struct  FlattenIOResult
 
struct  FlattenIOResult< IOResult< T > >
 
class  FlowSimulationBase
 Base class to define a FlowSimulation. More...
 
class  FlowSimulationBase< FP, M, SystemIntegrator< FP, Integrands... > >
 Specialization of FlowSimulationBase that takes a SystemIntegrator instead of it's Integrands. More...
 
struct  has_get_default_member_function
 
struct  has_get_default_member_function< T, std::void_t< decltype(T::get_default(std::declval< Args >()...))>, Args... >
 
struct  is_random_access_iterator
 
struct  IsIOResult
 
struct  IsIOResult< IOResult< T > >
 
struct  NoCopy
 
struct  ParameterTag
 
struct  ParameterTag< 0, ParameterSet< Head, Tail... > >
 
struct  ParameterTag< I, ParameterSet< Head, Tail... > >
 
struct  SerializationVisitor
 
class  SimulationBase
 Base class to define a Simulation. More...
 
class  SimulationBase< FP, M, SystemIntegrator< FP, Integrands... > >
 Specialization of SimulationBase that takes a SystemIntegrator instead of it's Integrands. More...
 
class  StatusCodeCategory
 category that describes StatusCode in std::error_code More...
 
struct  step_adjuster
 Extends the default_step_adjuster with a setter for dt_max. More...
 
class  TaggedParameter
 
class  TimeSeriesIteratorBase
 base class for TimeSeries iterators that iterate by time point (i.e. More...
 
struct  TimeSeriesIterTraits
 type traits for time series iterators More...
 
struct  type_at_index_impl
 Get the type at position Index of list (Head, Tail...). More...
 
struct  type_at_index_impl< 0, Head, Tail... >
 

Typedefs

template<class F , class... T>
using ApplyResultT = FlattenIOResultT< std::invoke_result_t< F, T... > >
 
template<class OmittedTag , template< class... > class IndexTemplate, class Index >
using filtered_index_t = decltype(as_index< IndexTemplate >(std::declval< filtered_tuple_t< OmittedTag, decltype(as_tuple(std::declval< Index >()))> >()))
 
template<class OmittedTag , class Tuple >
using filtered_tuple_t = decltype(filter_tuple< OmittedTag >(std::declval< Tuple >()))
 
template<class T >
using FlattenIOResultT = typename FlattenIOResult< T >::Type
 

Functions

template<class IOObject , class Member >
void add_named_ref (IOObject &obj, const NamedRef< Member > named_ref)
 Add a name-value pair to an io object. More...
 
template<template< class... > class T, class... Args>
T< Args... > as_index (std::tuple< Args... >)
 
template<template< class... > class T, class... Args>
std::tuple< Args... > as_tuple (T< Args... >)
 
template<class IOContext , class DefaultSerializable , class... Members>
IOResult< DefaultSerializable > default_deserialize_impl (IOContext &io, DefaultSerializable &a, const char *name, NamedRef< Members >... named_refs)
 Read an io object and its members from the io context using the given names and assign the values to a. More...
 
template<class IOContext , class... Members>
void default_serialize_impl (IOContext &io, const char *name, const NamedRef< Members >... named_refs)
 Unpack all name-value pairs from the tuple and add them to a new io object with the given name. More...
 
template<class IOObj , class Tup , class... Ts>
IOResult< Tup > deserialize_tuple_element (IOObj &obj, Tag< Tup > tag, const IOResult< Ts > &... rs)
 
template<class F , class... T>
ApplyResultT< F, T... > eval (F f, const IOResult< T > &... rs)
 Evaluates a function f using values of the given IOResults as arguments, assumes all IOResults are succesful. More...
 
template<class IOObject , class Member >
IOResult< Member > expect_named_ref (IOObject &obj, const NamedRef< Member > named_ref)
 Retrieve a name-value pair from an io object. More...
 
template<class... CategoryTags, class... Subset>
Index< CategoryTags... > extend_index_impl (const Index< Subset... > &i, const size_t fill_value, mio::Tag< Index< CategoryTags... >>)
 Creates and returns a SuperIndex from SubIndex, using entries from the given SubIndex or fill_value. More...
 
template<class OmittedTag , class... Tags>
decltype(std::tuple_cat(std::declval< std::conditional_t< std::is_same_v< OmittedTag, Tags >, std::tuple<>, std::tuple< Tags >>>()...)) filter_tuple (std::tuple< Tags... >)
 
template<size_t I, typename Index >
std::pair< size_t, size_t > flatten_index (Index const &indices, Index const &dimensions)
 
template<class... Tail, class Params , class F >
std::enable_if_t< sizeof...(Tail)==0, void > foreach_impl (Params &&, F)
 
template<class Head , class... Tail, class Params , class F >
void foreach_impl (Params &&p, F f)
 
template<class Params , size_t Head, size_t... Tail, class F >
void foreach_tag_impl (F f, std::index_sequence< Head, Tail... >)
 
template<class Params , size_t... Tail, class F >
std::enable_if_t< sizeof...(Tail)==0, void > foreach_tag_impl (F, std::index_sequence< Tail... >)
 
spdlog::level::level_enum get_spdlog_level (LogLevel level)
 
template<class... Tags>
std::tuple< Index< Tags >... > get_tuple (const Index< Tags... > &i)
 Obtain a tuple of single-category indices from a Index or MultiIndex. More...
 
template<class Enum >
std::tuple< Index< Enum > > get_tuple (Enum i) requires std
 Obtain a tuple of one single-category index from an enum value. More...
 
template<class... T>
void is_multi_index_impl (Index< T... >)
 Function definition that accepts a MultiIndex, used for the definition of IsMultiIndex. More...
 
template<size_t Idx>
std::string make_tuple_element_name ()
 
Eigen::Index next_pow2 (Eigen::Index i)
 round an integer to the nearest greater power of 2 More...
 
void path_join_rec (std::stringstream &, bool)
 breaks the recursion of path_join_rec. More...
 
template<class Head , class... Tail>
void path_join_rec (std::stringstream &ss, bool writeSeparator, Head &&head, Tail &&... tail)
 recursive template helper function to join paths More...
 
template<class... CategoryTags, class SuperIndex >
Index< CategoryTags... > reduce_index_impl (const SuperIndex &i, mio::Tag< Index< CategoryTags... >>)
 Extracts CategoryTags from the tagged Index and returns a subindex of SuperIndex with the given categories. More...
 
template<size_t Idx, class IOObj , class Tup >
void serialize_tuple_element (IOObj &obj, const Tup &tup)
 
size_t string_length (const char *str)
 length of a null terminated C string More...
 
template<class String >
size_t string_length (String &&str)
 length of a string (e.g std::string) More...
 
template<class... T>
Index< T... > tuple_to_index (std::tuple< Index< T >... >)
 Function declaration that allows type conversion from a tuple of single-category indices to MultiIndex. More...
 
template<std::size_t Size, class Type >
constexpr std::size_t index_of_impl ()
 Recursively searches the list (Head, Tail...) for Type. More...
 
template<std::size_t Size, class Type , class Head , class... Tail>
constexpr std::size_t index_of_impl ()
 Recursively searches the list (Head, Tail...) for Type. More...
 

Variables

template<class M >
concept IsElementReference
 

Typedef Documentation

◆ ApplyResultT

template<class F , class... T>
using mio::details::ApplyResultT = typedef FlattenIOResultT<std::invoke_result_t<F, T...> >

◆ filtered_index_t

template<class OmittedTag , template< class... > class IndexTemplate, class Index >
using mio::details::filtered_index_t = typedef decltype(as_index<IndexTemplate>( std::declval<filtered_tuple_t<OmittedTag, decltype(as_tuple(std::declval<Index>()))> >()))

◆ filtered_tuple_t

template<class OmittedTag , class Tuple >
using mio::details::filtered_tuple_t = typedef decltype(filter_tuple<OmittedTag>(std::declval<Tuple>()))

◆ FlattenIOResultT

template<class T >
using mio::details::FlattenIOResultT = typedef typename FlattenIOResult<T>::Type

Function Documentation

◆ add_named_ref()

template<class IOObject , class Member >
void mio::details::add_named_ref ( IOObject &  obj,
const NamedRef< Member >  named_ref 
)

Add a name-value pair to an io object.

◆ as_index()

template<template< class... > class T, class... Args>
T<Args...> mio::details::as_index ( std::tuple< Args... >  )

◆ as_tuple()

template<template< class... > class T, class... Args>
std::tuple<Args...> mio::details::as_tuple ( T< Args... >  )

◆ default_deserialize_impl()

template<class IOContext , class DefaultSerializable , class... Members>
IOResult<DefaultSerializable> mio::details::default_deserialize_impl ( IOContext &  io,
DefaultSerializable &  a,
const char *  name,
NamedRef< Members >...  named_refs 
)

Read an io object and its members from the io context using the given names and assign the values to a.

◆ default_serialize_impl()

template<class IOContext , class... Members>
void mio::details::default_serialize_impl ( IOContext &  io,
const char *  name,
const NamedRef< Members >...  named_refs 
)

Unpack all name-value pairs from the tuple and add them to a new io object with the given name.

◆ deserialize_tuple_element()

template<class IOObj , class Tup , class... Ts>
IOResult<Tup> mio::details::deserialize_tuple_element ( IOObj &  obj,
Tag< Tup >  tag,
const IOResult< Ts > &...  rs 
)

◆ eval()

template<class F , class... T>
ApplyResultT<F, T...> mio::details::eval ( f,
const IOResult< T > &...  rs 
)

Evaluates a function f using values of the given IOResults as arguments, assumes all IOResults are succesful.

◆ expect_named_ref()

template<class IOObject , class Member >
IOResult<Member> mio::details::expect_named_ref ( IOObject &  obj,
const NamedRef< Member >  named_ref 
)

Retrieve a name-value pair from an io object.

◆ extend_index_impl()

template<class... CategoryTags, class... Subset>
Index<CategoryTags...> mio::details::extend_index_impl ( const Index< Subset... > &  i,
const size_t  fill_value,
mio::Tag< Index< CategoryTags... >>   
)
inline

Creates and returns a SuperIndex from SubIndex, using entries from the given SubIndex or fill_value.

◆ filter_tuple()

template<class OmittedTag , class... Tags>
decltype(std::tuple_cat( std::declval<std::conditional_t<std::is_same_v<OmittedTag, Tags>, std::tuple<>, std::tuple<Tags>>>()...)) mio::details::filter_tuple ( std::tuple< Tags... >  )

◆ flatten_index()

template<size_t I, typename Index >
std::pair<size_t, size_t> mio::details::flatten_index ( Index const &  indices,
Index const &  dimensions 
)

◆ foreach_impl() [1/2]

template<class... Tail, class Params , class F >
std::enable_if_t<sizeof...(Tail) == 0, void> mio::details::foreach_impl ( Params &&  ,
 
)

◆ foreach_impl() [2/2]

template<class Head , class... Tail, class Params , class F >
void mio::details::foreach_impl ( Params &&  p,
f 
)

◆ foreach_tag_impl() [1/2]

template<class Params , size_t Head, size_t... Tail, class F >
void mio::details::foreach_tag_impl ( f,
std::index_sequence< Head, Tail... >   
)

◆ foreach_tag_impl() [2/2]

template<class Params , size_t... Tail, class F >
std::enable_if_t<sizeof...(Tail) == 0, void> mio::details::foreach_tag_impl ( ,
std::index_sequence< Tail... >   
)

◆ get_spdlog_level()

spdlog::level::level_enum mio::details::get_spdlog_level ( LogLevel  level)
inline

◆ get_tuple() [1/2]

template<class... Tags>
std::tuple<Index<Tags>...> mio::details::get_tuple ( const Index< Tags... > &  i)

Obtain a tuple of single-category indices from a Index or MultiIndex.

◆ get_tuple() [2/2]

template<class Enum >
std::tuple<Index<Enum> > mio::details::get_tuple ( Enum  i)

Obtain a tuple of one single-category index from an enum value.

◆ index_of_impl() [1/2]

template<std::size_t Size, class Type >
constexpr std::size_t mio::details::index_of_impl ( )
constexpr

Recursively searches the list (Head, Tail...) for Type.

Template Parameters
SizeTotal size of the list to search.
Typeto search.
Head,TailThe list to search in. May be empty.
Returns
The index of Type in the list (Head, Tail...), or the size of the list if Type is not in it.

◆ index_of_impl() [2/2]

template<std::size_t Size, class Type , class Head , class... Tail>
constexpr std::size_t mio::details::index_of_impl ( )
constexpr

Recursively searches the list (Head, Tail...) for Type.

Template Parameters
SizeTotal size of the list to search.
Typeto search.
Head,TailThe list to search in. May be empty.
Returns
The index of Type in the list (Head, Tail...), or the size of the list if Type is not in it.

◆ is_multi_index_impl()

template<class... T>
void mio::details::is_multi_index_impl ( Index< T... >  )

Function definition that accepts a MultiIndex, used for the definition of IsMultiIndex.

◆ make_tuple_element_name()

template<size_t Idx>
std::string mio::details::make_tuple_element_name ( )

◆ next_pow2()

Eigen::Index mio::details::next_pow2 ( Eigen::Index  i)
inline

round an integer to the nearest greater power of 2

round integer up to the next higher power of 2

◆ path_join_rec() [1/2]

void mio::details::path_join_rec ( std::stringstream &  ,
bool   
)
inline

breaks the recursion of path_join_rec.

◆ path_join_rec() [2/2]

template<class Head , class... Tail>
void mio::details::path_join_rec ( std::stringstream &  ss,
bool  writeSeparator,
Head &&  head,
Tail &&...  tail 
)

recursive template helper function to join paths

Parameters
ssstream that collects the result
writeSeparatoradd separator before adding the next part of the path
headnext part of the path to add
tailremaining parts of the path

◆ reduce_index_impl()

template<class... CategoryTags, class SuperIndex >
Index<CategoryTags...> mio::details::reduce_index_impl ( const SuperIndex &  i,
mio::Tag< Index< CategoryTags... >>   
)
inline

Extracts CategoryTags from the tagged Index and returns a subindex of SuperIndex with the given categories.

◆ serialize_tuple_element()

template<size_t Idx, class IOObj , class Tup >
void mio::details::serialize_tuple_element ( IOObj &  obj,
const Tup &  tup 
)

◆ string_length() [1/2]

size_t mio::details::string_length ( const char *  str)
inline

length of a null terminated C string

◆ string_length() [2/2]

template<class String >
size_t mio::details::string_length ( String &&  str)

length of a string (e.g std::string)

◆ tuple_to_index()

template<class... T>
Index<T...> mio::details::tuple_to_index ( std::tuple< Index< T >... >  )

Function declaration that allows type conversion from a tuple of single-category indices to MultiIndex.

Used together with concatenate_indices_impl, this allows combining categories of multiple args into a single MultiIndex.

Variable Documentation

◆ IsElementReference

template<class M >
concept mio::details::IsElementReference
Initial value:
=
std::is_reference_v<decltype(std::declval<M>()(std::declval<Eigen::Index>(), std::declval<Eigen::Index>()))>