DUNE PDELab (2.7)

Dune::PDELab::PowerGridFunction< T, k > Class Template Reference

product of identical functions More...

#include <dune/pdelab/common/function.hh>

Public Types

typedef T::GridViewType GridViewType
 record the GridView
 
typedef PowerNodeTag NodeTag
 The type tag that describes a PowerNode.
 
typedef T ChildType
 The type of each child.
 
typedef std::shared_ptr< T > ChildStorageType
 The storage type of each child.
 
typedef std::shared_ptr< const T > ChildConstStorageType
 The const version of the storage type of each child.
 
typedef std::array< ChildStorageType, k > NodeStorage
 The type used for storing the children.
 

Public Member Functions

template<typename TT >
void setTime (TT time)
 Set the time in all leaf nodes of this function tree.
 
 PowerGridFunction (const std::array< std::shared_ptr< T >, k > &container)
 Construct a new Power Grid Function object. More...
 
 PowerGridFunction (T &t)
 Construct a PowerGridFunction with k clones of the function t.
 
 PowerGridFunction (T &t0, T &t1,...)
 Initialize all children with different function objects. More...
 
Child Access (templated methods)
template<std::size_t i>
T & child (index_constant< i >={})
 Returns the i-th child. More...
 
template<std::size_t i>
const T & child (index_constant< i >={}) const
 Returns the i-th child (const version). More...
 
template<std::size_t i>
ChildStorageType childStorage (index_constant< i >={})
 Returns the storage of the i-th child. More...
 
template<std::size_t i>
ChildConstStorageType childStorage (index_constant< i >={}) const
 Returns the storage of the i-th child (const version). More...
 
template<std::size_t i>
void setChild (T &t, index_constant< i >={})
 Sets the i-th child to the passed-in value.
 
template<std::size_t i>
void setChild (T &&t, index_constant< i >={})
 Store the passed value in i-th child.
 
template<std::size_t i>
void setChild (ChildStorageType st, index_constant< i >={})
 Sets the stored value representing the i-th child to the passed-in value.
 
Child Access (Dynamic methods)
T & child (std::size_t i)
 Returns the i-th child. More...
 
const T & child (std::size_t i) const
 Returns the i-th child (const version). More...
 
ChildStorageType childStorage (std::size_t i)
 Returns the storage of the i-th child. More...
 
ChildConstStorageType childStorage (std::size_t i) const
 Returns the storage of the i-th child (const version). More...
 
void setChild (std::size_t i, T &t)
 Sets the i-th child to the passed-in value.
 
void setChild (std::size_t i, T &&t)
 Store the passed value in i-th child.
 
void setChild (std::size_t i, ChildStorageType st)
 Sets the stored value representing the i-th child to the passed-in value.
 
const NodeStoragenodeStorage () const
 
Nested Child Access
template<typename... Indices>
ImplementationDefinedchild (Indices... indices)
 Returns the child given by the list of indices. More...
 
template<typename... Indices>
const ImplementationDefinedchild (Indices... indices)
 Returns the child given by the list of indices. More...
 

Static Public Attributes

static const bool isLeaf = false
 Mark this class as non leaf in the dune-typetree.
 
static const bool isPower = true
 Mark this class as a power in the dune-typetree.
 
static const bool isComposite = false
 Mark this class as a non composite in the dune-typetree.
 
static const std::size_t CHILDREN = k
 The number of children.
 

Detailed Description

template<class T, std::size_t k>
class Dune::PDELab::PowerGridFunction< T, k >

product of identical functions

This collects k instances of T in a GridFunctionTree.

Template Parameters
TThe type of the children of this node in the tree.
kThe number of children this node has.

Constructor & Destructor Documentation

◆ PowerGridFunction() [1/2]

template<class T , std::size_t k>
Dune::PDELab::PowerGridFunction< T, k >::PowerGridFunction ( const std::array< std::shared_ptr< T >, k > &  container)
inline

Construct a new Power Grid Function object.

Parameters
containerarray of pointers to child grid functions

◆ PowerGridFunction() [2/2]

template<class T , std::size_t k>
Dune::PDELab::PowerGridFunction< T, k >::PowerGridFunction ( T &  t0,
T &  t1,
  ... 
)
inline

Initialize all children with different function objects.

This constructor is only available in the non-specialized version

Parameters
tPoints to an array of pointers to function objects of type T. The function pointed to by the first pointer will be used to initialize the first child, the second pointer for the second child and so on.

Initialize all children with different function objects

Currently there exist specializations for 2 <= k <= 9. Each specialization has a constructor which takes the initializers for its children as arguments.

Parameters
t0The initializer for the first child.
t1The initializer for the second child.
...more initializers

Member Function Documentation

◆ child() [1/6]

template<typename T , std::size_t k>
template<std::size_t i>
T & Dune::TypeTree::PowerNode< T, k >::child ( index_constant< i >  = {})
inlineinherited

Returns the i-th child.

Returns
a reference to the i-th child.

◆ child() [2/6]

template<typename T , std::size_t k>
template<std::size_t i>
const T & Dune::TypeTree::PowerNode< T, k >::child ( index_constant< i >  = {}) const
inlineinherited

Returns the i-th child (const version).

Returns
a const reference to the i-th child.

◆ child() [3/6]

template<typename T , std::size_t k>
template<typename... Indices>
ImplementationDefined & Dune::TypeTree::PowerNode< T, k >::child ( Indices...  indices)
inlineinherited

Returns the child given by the list of indices.

This method simply forwards to the freestanding function child(). See that function for further information.

References Dune::TypeTree::child().

◆ child() [4/6]

template<typename T , std::size_t k>
template<typename... Indices>
const ImplementationDefined & Dune::TypeTree::PowerNode< T, k >::child ( Indices...  indices)
inlineinherited

Returns the child given by the list of indices.

This method simply forwards to the freestanding function child(). See that function for further information.

References Dune::TypeTree::child().

◆ child() [5/6]

template<typename T , std::size_t k>
T & Dune::TypeTree::PowerNode< T, k >::child ( std::size_t  i)
inlineinherited

Returns the i-th child.

Returns
a reference to the i-th child.

References Dune::TypeTree::PowerNode< T, k >::CHILDREN.

◆ child() [6/6]

template<typename T , std::size_t k>
const T & Dune::TypeTree::PowerNode< T, k >::child ( std::size_t  i) const
inlineinherited

Returns the i-th child (const version).

Returns
a const reference to the i-th child.

References Dune::TypeTree::PowerNode< T, k >::CHILDREN.

◆ childStorage() [1/4]

template<typename T , std::size_t k>
template<std::size_t i>
ChildStorageType Dune::TypeTree::PowerNode< T, k >::childStorage ( index_constant< i >  = {})
inlineinherited

Returns the storage of the i-th child.

Returns
a copy of the object storing the i-th child.

◆ childStorage() [2/4]

template<typename T , std::size_t k>
template<std::size_t i>
ChildConstStorageType Dune::TypeTree::PowerNode< T, k >::childStorage ( index_constant< i >  = {}) const
inlineinherited

Returns the storage of the i-th child (const version).

This method is only important if the child is stored as some kind of pointer, as this allows the pointee type to become const.

Returns
a copy of the object storing the i-th child.

◆ childStorage() [3/4]

template<typename T , std::size_t k>
ChildStorageType Dune::TypeTree::PowerNode< T, k >::childStorage ( std::size_t  i)
inlineinherited

Returns the storage of the i-th child.

Returns
a copy of the object storing the i-th child.

References Dune::TypeTree::PowerNode< T, k >::CHILDREN.

◆ childStorage() [4/4]

template<typename T , std::size_t k>
ChildConstStorageType Dune::TypeTree::PowerNode< T, k >::childStorage ( std::size_t  i) const
inlineinherited

Returns the storage of the i-th child (const version).

This method is only important if the child is stored as some kind of pointer, as this allows the pointee type to become const.

Returns
a copy of the object storing the i-th child.

References Dune::TypeTree::PowerNode< T, k >::CHILDREN.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)