3#ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACELOCALFUNCTIONSPACE_HH
4#define DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACELOCALFUNCTIONSPACE_HH
13#include <dune/pdelab/gridfunctionspace/gridfunctionspace.hh>
14#include <dune/pdelab/gridfunctionspace/localfunctionspace.hh>
26 void extract_tree_path_elements(TypeTree::StaticTreePath<>, It it)
31 template<
typename TP,
typename It>
32 void extract_tree_path_elements(TP, It it)
34 *it = TypeTree::TreePathBack<TP>::value;
35 extract_tree_path_elements(
typename TypeTree::TreePathPopBack<TP>::type(),++it);
44 template<
typename GFS,
typename LFS>
45 class SubSpaceLocalFunctionSpaceNode
51 typedef typename LFS::Traits Traits;
53 template<
typename... T>
54 SubSpaceLocalFunctionSpaceNode(T&&... t)
55 : LFS(
std::forward<T>(t)...)
57 extract_tree_path_elements(
typename GFS::SubSpacePath(),_tree_path.begin());
65 for (
auto di= this->_dof_index_storage.begin(), end=this->_dof_index_storage.end();
67 complete_dof_index(*di);
70 std::size_t subSpaceDepth()
const
72 return this->gridFunctionSpace().subSpaceDepth();
78 void complete_dof_index(
typename Traits::DOFIndex& di)
const
80 std::copy(_tree_path.begin(),_tree_path.end(),std::back_inserter(di.treeIndex()));
83 std::array<std::size_t,TypeTree::TreePathSize<typename GFS::SubSpacePath>::value> _tree_path;
88 template<
typename GFS,
typename TreePath>
96 template <
typename BaseGFS,
typename SubSpaceTreePath>
98 :
public gfs::SubSpaceLocalFunctionSpaceNode<gfs::GridFunctionSubSpace<BaseGFS,SubSpaceTreePath>,
99 typename TypeTree::TransformTree<
100 gfs::GridFunctionSubSpace<BaseGFS,SubSpaceTreePath>,
101 gfs_to_lfs<gfs::GridFunctionSubSpace<
110 typedef gfs::GridFunctionSubSpace<BaseGFS,SubSpaceTreePath> GFS;
112 typedef gfs::SubSpaceLocalFunctionSpaceNode<
114 typename TypeTree::TransformTree<
121 friend struct PropagateGlobalStorageVisitor;
124 friend struct ClearSizeVisitor;
126 template<
typename,
bool>
127 friend struct ComputeSizeVisitor;
129 template<
typename,
bool>
130 friend struct FillIndicesVisitor;
134 LocalFunctionSpace(
const GFS & gfs)
135 : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
137 this->_dof_indices = &(this->_dof_index_storage);
141 LocalFunctionSpace(std::shared_ptr<const GFS> pgfs)
142 : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
144 this->_dof_indices = &(this->_dof_index_storage);
148 LocalFunctionSpace(
const LocalFunctionSpace & lfs)
154 this->_dof_indices = &(this->_dof_index_storage);
gfs::GridFunctionSubSpace< GFS, TreePath > GridFunctionSubSpace
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:569
Dune namespace.
Definition: alignedallocator.hh:13