DUNE PDELab (unstable)

Classes

struct  Dune::TypeTree::TreePathSize< typename >
 
struct  Dune::TypeTree::TreePathPushBack< typename, size_t >
 
struct  Dune::TypeTree::TreePathPushFront< typename, size_t >
 
struct  Dune::TypeTree::TreePathBack< typename >
 
struct  Dune::TypeTree::TreePathFront< typename >
 
struct  Dune::TypeTree::TreePathPopBack< typename,... >
 
struct  Dune::TypeTree::TreePathPopFront< typename >
 
struct  Dune::TypeTree::TreePathConcat< typename, typename >
 

Typedefs

template<typename... T>
using Dune::TypeTree::HybridTreePath = Dune::HybridMultiIndex< T... >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 

Functions

template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto Dune::TypeTree::makeTreePath (const T... t)
 helper function to construct a new HybridTreePath from the given indices. More...
 
template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto Dune::TypeTree::hybridTreePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto 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 >={})
 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...
 

Detailed Description

Typedef Documentation

◆ HybridTreePath

template<typename... T>
using Dune::TypeTree::HybridTreePath = typedef Dune::HybridMultiIndex<T...>

A hybrid version of TreePath that supports both compile time and run time indices.

A HybridTreePath supports storing a combination of run time and compile time indices. This makes it possible to store the tree path to a tree node inside the tree node itself, even if the path contains one or more PowerNodes, where each child must have exactly the same type. At the same time, as much information as possible is kept accessible at compile time, allowing for more efficient algorithms.

Note
Internally all indices are stored as std::size_t or std::integral_constant<std::size_t,v>. The latter is the same as Dune::index_constant<v>. If indices of other integral or std::integral_constant types are passed as arguments, they are converted.

Function Documentation

◆ hybridTreePath()

template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto 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.

Note
Internally all indices are stored as std::size_t or std::integral_constant<std::size_t,v>. The latter is the same as Dune::index_constant<v>. If indices of other integral or std::integral_constant types are passed as arguments, they are converted.

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

◆ makeTreePath()

template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto Dune::TypeTree::makeTreePath ( const T...  t)
constexpr

helper function to construct a new HybridTreePath from the given indices.

This function returns a new HybridTreePath with the given index values.

Note
Internally all indices are stored as std::size_t or std::integral_constant<std::size_t,v>. The latter is the same as Dune::index_constant<v>. If indices of other integral or std::integral_constant types are passed as arguments, they are converted.

◆ treePath()

template<typename... T>
requires (((std::is_integral_v<T> or Dune::IsIntegralConstant<T>::value) && ...))
constexpr auto 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.

It further ensures that the basic number type is std::size_t and casts any indices accordingly.

Referenced by Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction::operator()().

◆ treePathEntry()

template<std::size_t i, typename... T>
constexpr auto Dune::TypeTree::treePathEntry ( const HybridTreePath< T... > &  tp,
index_constant< i >  = {} 
)
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::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:58
constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< i >={})
Returns a copy of the i-th element of the HybridTreePath.
Definition: treepath.hh:230
constexpr auto hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:184
Namespace with predefined compile time indices for the range [0,19].
Definition: indices.hh:50

◆ 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.

Deprecated:
The functions is deprecated. Use operator[] instead.

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::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:255
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Aug 31, 22:39, 2025)