Go to the documentation of this file.
3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_DUNEFUNCTIONSLOCALFUNCTIONSPACE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_DUNEFUNCTIONSLOCALFUNCTIONSPACE_HH
8 #include <dune/common/stdstreams.hh>
9 #include <dune/common/shared_ptr.hh>
11 #include <dune/geometry/referenceelements.hh>
13 #include <dune/localfunctions/common/interfaceswitch.hh>
14 #include <dune/localfunctions/common/localkey.hh>
16 #include <dune/typetree/typetree.hh>
28 namespace Experimental {
30 template<
typename LFS>
32 :
public TypeTree::LeafNode
37 return static_cast<const LFS*
>(
this)->tree().finiteElement();
40 template<
typename Tree>
48 template<
typename GFS,
typename TreePath = TypeTree::Hybr
idTreePath<>>
55 using Basis =
typename GFS::Basis;
57 using Tree = TypeTree::ChildForTreePath<typename LocalView::Tree,TreePath>;
58 using DOFIndex =
typename GFS::Ordering::Traits::DOFIndex;
60 template<
typename LFS,
typename C,
typename Tag,
bool fast>
68 using GridView =
typename GFS::Traits::GridView;
70 using DOFIndex =
typename GFS::Ordering::Traits::DOFIndex;
79 , _local_view(gfs->basis().localView())
80 , _tree_path(tree_path)
81 , _tree(TypeTree::child(_local_view.
tree(),tree_path))
92 return _local_view.size();
98 return _local_view.maxSize();
104 return _tree.localIndex(
index);
110 auto refElement = Dune::ReferenceElements<double,Basis::GridView::dimension>::general(_local_view.element().type());
112 auto localKey = _local_view.tree().finiteElement().localCoefficients().localKey(
index);
114 const auto& indexSet = _gfs->basis().gridView().indexSet();
117 auto gt = refElement.type(localKey.subEntity(), localKey.codim());
120 auto indexOnEntity = indexSet.subIndex(_local_view.element(),
121 localKey.subEntity(),
126 GFS::Ordering::Traits::DOFIndexAccessor::store(result,gt,indexOnEntity,localKey.index());
134 result.
set({_local_view.index(_tree.localIndex(
index))});
144 void bind(
const typename GFS::Traits::EntitySet::template Codim<0>::Entity&
e)
151 return _gfs->constraints();
163 return _gfs->ordering().containerIndex(i);
166 std::shared_ptr<const GFS> _gfs;
174 template<
typename DFBasis,
typename V,
typename CE=NoConstra
ints>
175 class GridFunctionSpace;
181 template<
typename DFBasis,
typename V,
typename CE,
typename TAG>
200 template<
typename DFBasis,
typename V,
typename CE>
223 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_DUNEFUNCTIONSLOCALFUNCTIONSPACE_HH
DOFIndex dofIndex(size_type index) const
Definition: dunefunctionslocalfunctionspace.hh:108
std::size_t index
Definition: interpolate.hh:97
typename Basis::LocalView LocalView
Definition: dunefunctionslocalfunctionspace.hh:56
const auto & finiteElement() const
Definition: dunefunctionslocalfunctionspace.hh:35
TypeTree::ChildForTreePath< typename LocalView::Tree, TreePath > Tree
Definition: dunefunctionslocalfunctionspace.hh:57
void set(typename ReservedVector< T, n >::value_type index)
Definition: multiindex.hh:152
const std::size_t offset
Definition: localfunctionspace.hh:75
std::size_t size_type
Definition: dunefunctionslocalfunctionspace.hh:75
Create a local function space from a global function space.
Definition: localfunctionspace.hh:699
GFS GridFunctionSpace
Definition: dunefunctionslocalfunctionspace.hh:67
LocalFunctionSpace(const GFS &gfs)
Definition: dunefunctionslocalfunctionspace.hh:213
LocalFunctionSpace(std::shared_ptr< const GFS > gfs)
Definition: dunefunctionslocalfunctionspace.hh:209
Definition: dunefunctionslocalfunctionspace.hh:49
Definition: lfsindexcache.hh:244
size_type maxSize() const
Definition: dunefunctionslocalfunctionspace.hh:95
Definition: localfunctionspacetags.hh:40
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
LocalFunctionSpace(std::shared_ptr< const GFS > gfs)
Definition: dunefunctionslocalfunctionspace.hh:190
size_type localIndex(size_type index) const
map index in this local function space to root local function space
Definition: dunefunctionslocalfunctionspace.hh:102
const Entity & e
Definition: localfunctionspace.hh:121
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:147
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: dunefunctionslocalfunctionspace.hh:139
typename GFS::Traits::GridView GridView
Definition: dunefunctionslocalfunctionspace.hh:68
LocalFunctionSpace(std::shared_ptr< const GFS > gfs, TreePath tree_path=TreePath(), size_type offset=0)
Definition: dunefunctionslocalfunctionspace.hh:77
typename GFS::Traits::ConstraintsType ConstraintsType
Definition: dunefunctionslocalfunctionspace.hh:71
std::size_t SizeType
Definition: dunefunctionslocalfunctionspace.hh:69
A grid function space.
Definition: gridfunctionspace.hh:178
FiniteElement FiniteElementType
Definition: dunefunctionslocalfunctionspace.hh:44
size_type subSpaceDepth() const
Definition: dunefunctionslocalfunctionspace.hh:84
const Tree & tree() const
Definition: dunefunctionslocalfunctionspace.hh:154
Definition: dunefunctionslocalfunctionspace.hh:63
const Traits::ConstraintsType & constraints() const
Definition: dunefunctionslocalfunctionspace.hh:149
typename Experimental::GridFunctionSpace< DFBasis, V, CE > ::Basis Basis
Definition: dunefunctionslocalfunctionspace.hh:55
typename Experimental::GridFunctionSpace< DFBasis, V, CE > ::Ordering::Traits::DOFIndex DOFIndex
Definition: dunefunctionslocalfunctionspace.hh:58
auto containerIndex(size_type index) const
Definition: dunefunctionslocalfunctionspace.hh:131
Definition: dunefunctionslocalfunctionspace.hh:41
typename GFS::Ordering::Traits::DOFIndex DOFIndex
Definition: dunefunctionslocalfunctionspace.hh:70
typename Tree::FiniteElement FiniteElement
Definition: dunefunctionslocalfunctionspace.hh:43
A class for representing multi-indices.
Definition: multiindex.hh:27
Definition: dunefunctionslocalfunctionspace.hh:31
void bind(const typename GFS::Traits::EntitySet::template Codim< 0 >::Entity &e)
Definition: dunefunctionslocalfunctionspace.hh:144
LocalFunctionSpace(const GFS &gfs)
Definition: dunefunctionslocalfunctionspace.hh:194
size_type size() const
get current size
Definition: dunefunctionslocalfunctionspace.hh:90