Loading...
Searching...
No Matches
Function space basis utilities
Function space bases

Utilities for implementing and using global bases. More...

Collaboration diagram for Function space basis utilities:

## Classes

struct | Dune::Functions::BasisFactory::IndexMergingStrategy
| Base class for index merging strategies to simplify detection. More...
struct | Dune::Functions::BasisFactory::FlatLexicographic
| Lexicographic merging of direct children without blocking. More...
struct | Dune::Functions::BasisFactory::FlatInterleaved
| Interleaved merging of direct children without blocking. More...
struct | Dune::Functions::BasisFactory::BlockedLexicographic
| Lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
struct | Dune::Functions::BasisFactory::BlockedInterleaved
| Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each). More...
class | Dune::Functions::SubEntityDOFs< GridView >
| Range of DOFs associated to sub-entity. More...

## Typedefs

template<class size_type>
using | Dune::Functions::FlatMultiIndex = StaticMultiIndex<size_type, 1>
| A multi-index class with only one level.

## Functions

template<class Vector>
auto | Dune::Functions::istlVectorBackend (Vector &v)
| Return a vector backend wrapping non-const ISTL like containers.
template<class Vector>
auto | Dune::Functions::istlVectorBackend (const Vector &v)
| Return a vector backend wrapping const ISTL like containers.
constexpr FlatLexicographic | Dune::Functions::BasisFactory::flatLexicographic ()
| Creates a lexicographic merging of direct children without blocking.
constexpr FlatInterleaved | Dune::Functions::BasisFactory::flatInterleaved ()
| Creates an interleaved merging of direct children without blocking.
constexpr BlockedLexicographic | Dune::Functions::BasisFactory::blockedLexicographic ()
| Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
constexpr BlockedInterleaved | Dune::Functions::BasisFactory::blockedInterleaved ()
| Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each).
template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >(), std::declval< typename Basis::GridView::Intersection >()), 0) = 0>
void | Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)
| Loop over all DOFs on the boundary.
template<class T>
auto | Dune::Functions::subEntityDOFs (const T &)
| Create SubEntityDOFs object.
template<class LocalView>
auto | Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
| Create bound SubEntityDOFs object.
template<class LocalView, class Intersection>
auto | Dune::Functions::subEntityDOFs (const LocalView &localView, const Intersection &intersection)
| Create bound SubEntityDOFs object.

## Detailed Description

Utilities for implementing and using global bases.

## Typedef Documentation

## FlatMultiIndex

template<class size_type>

using Dune::Functions::FlatMultiIndex = StaticMultiIndex<size_type, 1>

A multi-index class with only one level.

This class provides a multi-index interface in the sense that it has operator[] access to individual interfaces. However, since it only supports flat indices of exactly one level, it also has a cast of the multi-index to this index. This is obtianed by deriving from std::array<size_type,1> and adding this cast. Hence multi-indices of type FlatMultiIndex can be used like classic indices.

## Function Documentation

## blockedInterleaved()

BlockedInterleaved Dune::Functions::BasisFactory::blockedInterleaved | ( |  | ) |

constexpr

Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each).

## blockedLexicographic()

BlockedLexicographic Dune::Functions::BasisFactory::blockedLexicographic | ( |  | ) |

constexpr

Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child).

## flatInterleaved()

FlatInterleaved Dune::Functions::BasisFactory::flatInterleaved | ( |  | ) |

constexpr

Creates an interleaved merging of direct children without blocking.

## flatLexicographic()

FlatLexicographic Dune::Functions::BasisFactory::flatLexicographic | ( |  | ) |

constexpr

Creates a lexicographic merging of direct children without blocking.

## forEachBoundaryDOF()

template<class Basis, class F, decltype(std::declval< std::decay_t< F > >()(0, std::declval< typename Basis::LocalView >(), std::declval< typename Basis::GridView::Intersection >()), 0) = 0>

void Dune::Functions::forEachBoundaryDOF | ( | const Basis & | basis,
|  | F && | f )

Loop over all DOFs on the boundary.

This loops over all DOFs of a basis associated to sub-entities on the boundary. This overload will pass three arguments to the given loop callback: The local index of the boundary DOF, a bound local view this local index belongs to, and a boundary intersection associated to a sub-entity such that the DOF is associated to a sub-sub-entity of this sub-entity. Notice that this may visit the same DOF multiple times.

If this callback signature is not suitable you can use one of the another variants of forEachBoundaryDOF.

Parameters

  basis | A function space basis
  f | A callback that will be called with a local index, a bound local view, and an intersection of the visited boundary DOF

## istlVectorBackend() [1/2]

template<class Vector>

auto Dune::Functions::istlVectorBackend | ( | const Vector & | v | ) |

Return a vector backend wrapping const ISTL like containers.

The returned object implements the VectorBackend concept and can be used for all dune-functions utilities requiring a coefficient vector (e.g. interpolate() and DiscreteGlobalBasisFunction. It essentially provides operator[] access using multi-indices and a recursive resize(GlobalBasis) method for adjusting the size to a given GlobalBasis.

Additionally to the VectorBackend interface, provides access to the wrapped vector using the method vector().

The wrapped vector type should be a nested ISTL like random access container providing operator[] and size() methods. For classical containers this should support indices of type std::size_t. For multi-type containers indices of the form Dune::index_constant<i> should be supported while size() should be a static constexpr method.

When accessing the vector with a multi-index the backend appends multi-index digits using operator[] as long as the result is not a scalar. If this exhausts all digits of the multi-index, additional zeros are appended.

Template Parameters

  Vector | Type of the raw wrapper vector

## istlVectorBackend() [2/2]

template<class Vector>

auto Dune::Functions::istlVectorBackend | ( | Vector & | v | ) |

Return a vector backend wrapping non-const ISTL like containers.

The returned object implements the VectorBackend concept and can be used for all dune-functions utilities requiring a coefficient vector (e.g. interpolate() and DiscreteGlobalBasisFunction). It essentially provides operator[] access using multi-indices and a recursive resize(GlobalBasis) method for adjusting the size to a given GlobalBasis.

Additionally to the VectorBackend interface, provides access to the wrapped vector using the method vector() and forwards all assignments to the underlying wrapped vector.

The wrapped vector type should be a nested ISTL like random access container providing operator[] and size() methods. For classical containers this should support indices of type std::size_t. For multi-type containers indices of the form Dune::index_constant<i> should be supported while size() should be a static constexpr method.

When accessing the vector with a multi-index the backend appends multi-index digits using operator[] as long as the result is not a scalar. If this exhausts all digits of the multi-index, additional zeros are appended.

Template Parameters

  Vector | Type of the raw wrapper vector

## subEntityDOFs() [1/3]

template<class LocalView, class Intersection>

auto Dune::Functions::subEntityDOFs | ( | const LocalView & | localView,
|  | const Intersection & | intersection )

Create bound SubEntityDOFs object.

This creates a SubEntityDOFs object and binds it to the given LocalView and intersection.

Notice that the SubEntityDOFs object will allocate some internal buffers. For efficiency reasons you should thus prefer to first create a SubEntityDOFs object and then bind it to each element you want to process instead of creating a new bound SubEntityDOFs object for each element.

Parameters

  localView | A bound LocalView to bind to
  intersection | An Intersection encoding the sub-entity to bind to

## subEntityDOFs() [2/3]

template<class LocalView>

auto Dune::Functions::subEntityDOFs | ( | const LocalView & | localView,
|  | std::size_t | subEntityIndex,
|  | std::size_t | subEntityCodim )

Create bound SubEntityDOFs object.

This creates a SubEntityDOFs object and binds it to the given LocalView and sub-entity.

Notice that the SubEntityDOFs object will allocate some internal buffers. For efficiency reasons you should thus prefer to first create a SubEntityDOFs object and then bind it to each element you want to process instead of creating a new bound SubEntityDOFs object for each element.

Parameters

  localView | A bound LocalView to bind to
  subEntityIndex | Index of sub-entity in localView.element()
  subEntityCodim | Codimension of sub-entity in localView.element()

## subEntityDOFs() [3/3]

template<class T>

auto Dune::Functions::subEntityDOFs | ( | const T & |  | ) |

Create SubEntityDOFs object.

The only requirement on the passed argument t is, that its type T has to provide a typedef T::GridView. Hence t it can be a GlobalBasis or a LocalView.

Template Parameters

  T | A GlobalBasis type or a LocalView type