Dune Core Modules (2.8.0)

Classes

class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 

Functions

template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::hybridTreePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T... > &)
 Returns the size (number of components) of the given HybridTreePath.
 
template<std::size_t i, typename... T>
constexpr auto Dune::TypeTree::treePathEntry (const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
 Returns a copy of the i-th element of the HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr std::size_t Dune::TypeTree::treePathIndex (const HybridTreePath< T... > &tp, index_constant< i >={})
 Returns the index value of the i-th element of the HybridTreePath. More...
 
template<typename... T, typename std::enable_if<(sizeof...(T) > 0), bool >::type = true>
constexpr auto Dune::TypeTree::back (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< sizeof...(T) -1 >(tp))
 Returns a copy of the last element of the HybridTreePath. More...
 
template<typename... T>
constexpr auto Dune::TypeTree::front (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< 0 >(tp))
 Returns a copy of the first element of the HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< T..., std::size_t > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, std::size_t i)
 Appends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< T..., index_constant< i > > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, index_constant< i > i_={})
 Appends a compile time index to a HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< std::size_t, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, std::size_t element)
 Prepends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< index_constant< i >, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, index_constant< i > _i={})
 Prepends a compile time index to a HybridTreePath. More...
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp)
 Dumps a HybridTreePath to a stream.
 

Detailed Description

Function Documentation

◆ back()

template<typename... T, typename std::enable_if<(sizeof...(T) > 0), bool >::type = true>
constexpr auto Dune::TypeTree::back ( const HybridTreePath< T... > &  tp) -> decltype(treePathEntry<sizeof...(T)-1>(tp))
constexpr

Returns a copy of the last element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

References Dune::TypeTree::treePathEntry().

Referenced by Dune::TensorGridFactory< Grid >::fillIntervals(), Dune::TensorGridFactory< Grid >::fillRange(), Dune::TensorGridFactory< Grid >::fillUntil(), Dune::TensorGridFactory< Grid >::geometricFillIntervals(), Dune::TensorGridFactory< Grid >::geometricFillRange(), Dune::TensorGridFactory< Grid >::geometricFillUntil(), and Dune::YaspGrid< dim, Coordinates >::YaspGrid().

◆ front()

template<typename... T>
constexpr auto Dune::TypeTree::front ( const HybridTreePath< T... > &  tp) -> decltype(treePathEntry<0>(tp))
constexpr

Returns a copy of the first element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

Referenced by Dune::YaspGrid< dim, Coordinates >::YaspGrid().

◆ hybridTreePath()

template<typename... T>
constexpr HybridTreePath<T...> Dune::TypeTree::hybridTreePath ( const T &...  t)
constexpr

Constructs a new HybridTreePath from the given indices.

This function returns a new HybridTreePath with the given index values. It exists mainly to avoid having to manually specify the exact type of the new object.

Referenced by Dune::TypeTree::applyToTree(), Dune::TypeTree::applyToTreePair(), Dune::TypeTree::forEachLeafNode(), Dune::TypeTree::forEachNode(), and Dune::TypeTree::leafTreePathTuple().

◆ push_back() [1/2]

template<std::size_t i, typename... T>
constexpr HybridTreePath<T...,index_constant<i> > Dune::TypeTree::push_back ( const HybridTreePath< T... > &  tp,
index_constant< i >  i_ = {} 
)
constexpr

Appends a compile time index to a HybridTreePath.

This function returns a new HybridTreePath with the compile time index i appended.

The value for the new entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
auto tp_a = push_back<1>(tp);
auto tp_b = push_back(tp,_1);
constexpr index_constant< 1 > _1
Compile time index with value 1.
Definition: indices.hh:54
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:177
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:278

◆ push_back() [2/2]

template<typename... T>
constexpr HybridTreePath<T...,std::size_t> Dune::TypeTree::push_back ( const HybridTreePath< T... > &  tp,
std::size_t  i 
)
constexpr

◆ push_front() [1/2]

template<std::size_t i, typename... T>
constexpr HybridTreePath<index_constant<i>,T...> Dune::TypeTree::push_front ( const HybridTreePath< T... > &  tp,
index_constant< i >  _i = {} 
)
constexpr

Prepends a compile time index to a HybridTreePath.

This function returns a new HybridTreePath with the compile time index i prepended.

The value for the new entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
auto tp_a = push_front<1>(tp);
auto tp_b = push_front(tp,_1);
constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< T... > &tp, std::size_t element)
Prepends a run time index to a HybridTreePath.
Definition: treepath.hh:309

◆ push_front() [2/2]

template<typename... T>
constexpr HybridTreePath<std::size_t,T...> Dune::TypeTree::push_front ( const HybridTreePath< T... > &  tp,
std::size_t  element 
)
constexpr

Prepends a run time index to a HybridTreePath.

This function returns a new HybridTreePath with the run time index i prepended.

◆ treePath()

template<typename... T>
constexpr HybridTreePath<T...> Dune::TypeTree::treePath ( const T &...  t)
constexpr

Constructs a new HybridTreePath from the given indices.

This function returns a new HybridTreePath with the given index values. It exists mainly to avoid having to manually specify the exact type of the new object.

Referenced by Dune::Functions::SubEntityDOFs< GridView >::bind().

◆ treePathEntry()

template<std::size_t i, typename... T>
constexpr auto Dune::TypeTree::treePathEntry ( const HybridTreePath< T... > &  tp,
index_constant< i >  = {} 
) -> typename std::decay<decltype(std::get<i>(tp._data))>::type
constexpr

Returns a copy of the i-th element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

The index for the entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
std::cout << treePathEntry<2>(tp) << std::endl;
std::cout << treePathEntry(tp,_2) << std::endl;
constexpr index_constant< 2 > _2
Compile time index with value 2.
Definition: indices.hh:57
constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
Returns a copy of the i-th element of the HybridTreePath.
Definition: treepath.hh:219

Referenced by Dune::TypeTree::back().

◆ treePathIndex()

template<std::size_t i, typename... T>
constexpr std::size_t Dune::TypeTree::treePathIndex ( const HybridTreePath< T... > &  tp,
index_constant< i >  = {} 
)
constexpr

Returns the index value of the i-th element of the HybridTreePath.

This function always returns the actual index value, irrespective of whether the entry is a compile time index or a run time index.

The index for the entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
std::cout << treePathIndex<2>(tp) << std::endl;
std::cout << treePathIndex(tp,_2) << std::endl;
constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, index_constant< i >={})
Returns the index value of the i-th element of the HybridTreePath.
Definition: treepath.hh:242
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 5, 22:29, 2024)