dune-functions 2.10
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Attributes | Friends | Related Symbols | List of all members
Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R > Class Template Reference

A grid function induced by a global basis and a coefficient vector. More...

#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>

Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >:
Inheritance graph

Classes

class  LocalFunction
 

Public Types

using Basis = typename Base::Basis
 
using Vector = typename Base::Vector
 
using Domain = typename Base::Domain
 
using Range = R
 
using Traits = Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 >
 
using Coefficient = Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])>
 
using GridView = typename Basis::GridView
 
using EntitySet = GridViewEntitySet< GridView, 0 >
 
using Tree = typename Basis::LocalView::Tree
 
using NodeToRangeEntry = NTRE
 
using LocalDomain = typename EntitySet::LocalCoordinate
 
using Element = typename EntitySet::Element
 

Public Member Functions

template<class B_T , class V_T , class NTRE_T >
 DiscreteGlobalBasisFunction (B_T &&basis, V_T &&coefficients, NTRE_T &&nodeToRangeEntry)
 Create a grid-function, by wrapping the arguments in std::shared_ptr.
 
 DiscreteGlobalBasisFunction (std::shared_ptr< const Basis > basis, std::shared_ptr< const V > coefficients, std::shared_ptr< const typename Base::NodeToRangeEntry > nodeToRangeEntry)
 Create a grid-function, by moving the arguments in std::shared_ptr.
 
Range operator() (const Domain &x) const
 Evaluate at a point given in world coordinates.
 
const Basisbasis () const
 Return a const reference to the stored basis.
 
const Vectordofs () const
 Return the coefficients of this discrete function by reference.
 
const NodeToRangeEntrynodeToRangeEntry () const
 Return the stored node-to-range map.
 
const EntitySetentitySet () const
 Get associated set of entities the local-function can be bound to.
 

Protected Attributes

std::shared_ptr< const Data > data_
 

Friends

DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunctionderivative (const DiscreteGlobalBasisFunction &f)
 Derivative of the DiscreteGlobalBasisFunction
 
LocalFunction localFunction (const DiscreteGlobalBasisFunction &t)
 Construct local function from a DiscreteGlobalBasisFunction.
 

Related Symbols

(Note that these are not member symbols.)

template<typename R , typename B , typename V >
auto makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
 Generate a DiscreteGlobalBasisFunction.
 

Detailed Description

template<typename B, typename V, typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
class Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >

A grid function induced by a global basis and a coefficient vector.

This implements the grid function interface by combining a given global basis and a coefficient vector.

This class supports mapping of subtrees to multi-component ranges, vector-valued shape functions, and implicit product spaces given by vector-valued coefficients. The mapping of these to the range type is done via the following multistage procedure:

1.Each leaf node in the local ansatz subtree is associated to an entry RE of the range-type via the given node-to-range-entry-map. Based on this mapping each node is processed independently in the following way:

2.Now let the coefficients type C per basis function be dim_C-dimensional. Then we compute the dim(C) linear combinations (one for each coefficient index) of the shape function values with type V independently storing them in a std::array<V,dim_C>.

3.Finally the resulting array of function values is assigned to the nodal range entry RE. Since both types may be different their entries are mapped to one another via flatVectorView(). This will recursive enumerate the entries of the types in lexicographic order (unless flatVectorView is specialized differently for a certain type).

As a consequence the nodal range entry is required to have a total dimension dim_RE = dim_C * dim_V and to be compatible with flatVectorView().

Template Parameters
BType of global basis
VType of coefficient vectors
NTREType of node-to-range-entry-map that associates each leaf node in the local ansatz subtree with an entry in the range type
RRange type of this function

Requirements:

Member Typedef Documentation

◆ Basis

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
using Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::Basis = typename Base::Basis

◆ Coefficient

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>
inherited

◆ Domain

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
using Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::Domain = typename Base::Domain

◆ Element

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Element = typename EntitySet::Element
inherited

◆ EntitySet

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::EntitySet = GridViewEntitySet<GridView, 0>
inherited

◆ GridView

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::GridView = typename Basis::GridView
inherited

◆ LocalDomain

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalDomain = typename EntitySet::LocalCoordinate
inherited

◆ NodeToRangeEntry

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::NodeToRangeEntry = NTRE
inherited

◆ Range

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
using Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::Range = R

◆ Traits

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
using Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>

◆ Tree

template<typename B , typename V , typename NTRE >
using Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Tree = typename Basis::LocalView::Tree
inherited

◆ Vector

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
using Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::Vector = typename Base::Vector

Constructor & Destructor Documentation

◆ DiscreteGlobalBasisFunction() [1/2]

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
template<class B_T , class V_T , class NTRE_T >
Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::DiscreteGlobalBasisFunction ( B_T &&  basis,
V_T &&  coefficients,
NTRE_T &&  nodeToRangeEntry 
)
inline

Create a grid-function, by wrapping the arguments in std::shared_ptr.

◆ DiscreteGlobalBasisFunction() [2/2]

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::DiscreteGlobalBasisFunction ( std::shared_ptr< const Basis basis,
std::shared_ptr< const V >  coefficients,
std::shared_ptr< const typename Base::NodeToRangeEntry nodeToRangeEntry 
)
inline

Create a grid-function, by moving the arguments in std::shared_ptr.

Member Function Documentation

◆ basis()

template<typename B , typename V , typename NTRE >
const Basis & Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::basis ( ) const
inlineinherited

Return a const reference to the stored basis.

◆ dofs()

template<typename B , typename V , typename NTRE >
const Vector & Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::dofs ( ) const
inlineinherited

Return the coefficients of this discrete function by reference.

◆ entitySet()

template<typename B , typename V , typename NTRE >
const EntitySet & Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::entitySet ( ) const
inlineinherited

Get associated set of entities the local-function can be bound to.

◆ nodeToRangeEntry()

template<typename B , typename V , typename NTRE >
const NodeToRangeEntry & Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::nodeToRangeEntry ( ) const
inlineinherited

Return the stored node-to-range map.

◆ operator()()

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
Range Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::operator() ( const Domain x) const
inline

Evaluate at a point given in world coordinates.

Warning
This has to find the element that the evaluation point is in. It is therefore very slow.

Friends And Related Symbol Documentation

◆ derivative

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative ( const DiscreteGlobalBasisFunction< B, V, NTRE, R > &  f)
friend

Derivative of the DiscreteGlobalBasisFunction

◆ localFunction

template<typename B , typename V , typename NTRE = HierarchicNodeToRangeMap, typename R = typename V::value_type>
LocalFunction localFunction ( const DiscreteGlobalBasisFunction< B, V, NTRE, R > &  t)
friend

Construct local function from a DiscreteGlobalBasisFunction.

The obtained local function satisfies the concept Dune::Functions::Concept::LocalFunction. It must be bound to an entity from the entity set of the DiscreteGlobalBasisFunction before it can be used.

Member Data Documentation

◆ data_

template<typename B , typename V , typename NTRE >
std::shared_ptr<const Data> Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::data_
protectedinherited

The documentation for this class was generated from the following file: