3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
23 template<
typename GFS,
typename TreePath>
30 #if HAVE_TEMPLATE_ALIASES
35 template<
typename GFS,
typename TP>
38 typedef typename GFS::Ordering::Traits::DOFIndex
type;
41 #else // HAVE_TEMPLATE_ALIASES
48 template<
typename GFS,
typename TreePath>
54 template<
typename GFS,
typename TP>
57 typedef typename GFS::Ordering::Traits::DOFIndex
type;
60 #endif // HAVE_TEMPLATE_ALIASES
85 template<
typename Ordering,
typename GFS,
typename GFSTP,
typename OrderingTP = TypeTree::TreePath<> >
86 struct find_ordering_treepath_for_sub_gfs
90 typedef typename TypeTree::extract_child_type<Ordering,OrderingTP>::type SubOrdering;
93 typedef typename conditional<
100 typedef typename TypeTree::TreePathPushBack<
103 >::type SubOrderingTP;
106 typedef typename conditional<
108 typename TypeTree::TreePathPopFront<GFSTP>::type,
113 typedef typename find_ordering_treepath_for_sub_gfs<
123 template<
typename Ordering,
typename GFS,
typename OrderingTP>
124 struct find_ordering_treepath_for_sub_gfs<Ordering,GFS,TypeTree::TreePath<>,OrderingTP>
128 typedef OrderingTP type;
142 template<
typename GFS,
typename TreePath,
typename Tag>
152 return static_cast<const SubSpace&
>(*this);
170 typedef typename ChildGridFunctionSpace::Traits
Traits;
176 #if HAVE_TEMPLATE_ALIASES
180 using Constraintscontainer =
typename GFS::template ConstraintsContainer<E>;
182 #else // HAVE_TEMPLATE_ALIASES
190 #endif // HAVE_TEMPLATE_ALIASES
194 typename GFS::Ordering,
195 typename find_ordering_treepath_for_sub_gfs<
196 typename GFS::Ordering,
214 const typename Traits::GridViewType&
gridView()
const
222 return _ordering.
size();
233 typename Traits::SizeType
size()
const
235 return _ordering.
size();
249 : _ordering(gfs.orderingStorage())
260 template<
typename GFS,
typename TreePath,
typename Tag>
270 return static_cast<const SubSpace&
>(*this);
279 typedef typename ChildGridFunctionSpace::Traits
Traits;
303 const std::string&
name()
const
317 template<
typename GFS,
typename TreePath,
typename Tag>
334 template<
typename GFS,
typename TreePath,
typename Tag>
335 class SubSpaceFeatureProvider
336 :
public DefaultSubSpaceFeatures<GFS,TreePath,Tag>
348 template<
typename GFS,
typename TreePath>
349 class SubSpaceFeatureProvider<GFS,TreePath,LeafGridFunctionSpaceTag>
350 :
public DefaultSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
351 ,
public LeafSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
393 template<
typename GFS,
typename TreePath>
394 class GridFunctionSubSpace
395 :
public TypeTree::ProxyNode<const typename TypeTree::extract_child_type<GFS,TreePath>::type>
396 ,
public SubSpaceFeatureProvider<GFS,TreePath,typename TypeTree::extract_child_type<
399 >::type::ImplementationTag
403 typedef TypeTree::ProxyNode<
404 const typename TypeTree::extract_child_type<
413 typename TypeTree::extract_child_type<
416 >::type::ImplementationTag
419 #if HAVE_TEMPLATE_ALIASES
430 : NodeT(TypeTree::extract_child_storage(*gfs_storage,TreePath()))
432 , _base_gfs(gfs_storage)
435 #if HAVE_TEMPLATE_ALIASES
443 : NodeT(TypeTree::extract_child_storage(gfs,TreePath()))
445 , _base_gfs(stackobject_to_shared_ptr(gfs))
459 template<
typename TP>
466 #endif // HAVE_TEMPLATE_ALIASES
479 template<
typename TP>
495 typedef typename ChildGridFunctionSpace::Traits
Traits;
499 typename ChildGridFunctionSpace::ImplementationTag
522 return this->proxiedNode();
533 return this->proxiedNodeStorage();
538 shared_ptr<const GFS> _base_gfs;
542 #if HAVE_TEMPLATE_ALIASES && !DOXYGEN
546 template<
typename GFS,
typename TreePath>
547 struct construct_sub_space
556 template<
typename BaseGFS,
typename SubGFSTreePath,
typename TreePath>
564 typedef GridFunctionSubSpace<
566 typename TypeTree::TreePathConcat<
573 #endif // HAVE_TEMPLATE_ALIASES && !DOXYGEN
578 #if HAVE_TEMPLATE_ALIASES
583 template<
typename GFS,
typename TreePath>
584 using GridFunctionSubSpace = gfs::GridFunctionSubSpace<GFS,TreePath>;
589 template<
typename GFS,
typename TreePath>
590 using GridFunctionSubSpace =
typename gfs::construct_sub_space<GFS,TreePath>::type;
594 #else // HAVE_TEMPLATE_ALIASES
602 template<
typename GFS,
typename TreePath>
619 :
BaseT(stackobject_to_shared_ptr(gfs))
632 template<
typename BaseGFS,
typename SubSpaceTreePath,
typename TreePath>
633 class GridFunctionSubSpace<GridFunctionSubSpace<BaseGFS,SubSpaceTreePath>,TreePath>
634 :
public gfs::GridFunctionSubSpace<typename GridFunctionSubSpace<
637 >::BaseGridFunctionSpace,
638 typename TypeTree::TreePathConcat<
645 typedef gfs::GridFunctionSubSpace<
650 typename TypeTree::TreePathConcat<
656 typedef GridFunctionSubSpace<BaseGFS,SubSpaceTreePath> SubSpace;
672 #endif // HAVE_TEMPLATE_ALIASES
679 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:279
shared_ptr< const BaseGridFunctionSpace > baseGridFunctionSpaceStorage() const
Returns the storage object of the root GridFunctionSpace that this subspace view is based on...
Definition: subspace.hh:509
Additional features used by leaf subspaces.
Definition: subspace.hh:261
GridFunctionSubSpace(const GridFunctionSubSpace< GFS, TP > &gfs, typename enable_if<!is_same< TP, TreePath >::value, void * >::type=nullptr)
Construct a GridFunctionSubSpace another GridFunctionSubSpace.
Definition: subspace.hh:480
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:603
Default features used by every subspace implementation.
Definition: subspace.hh:143
ChildGridFunctionSpace::OrderingTag OrderingTag
Re-exported OrderingTag from the original GridFunctionSpace.
Definition: subspace.hh:173
Definition: gridfunctionspace/tags.hh:309
const std::string & name() const
Returns the name of this space.
Definition: subspace.hh:303
const ChildGridFunctionSpace & childGridFunctionSpace() const
Returns the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:520
GridFunctionSubSpaceTag< typename ChildGridFunctionSpace::ImplementationTag > ImplementationTag
Our ImplementationTag is derived from the tag of the original GridFunctionSpace.
Definition: subspace.hh:500
Traits::SizeType maxLocalSize() const
Returns the maximum number of DOFs per cells in this subspace.
Definition: subspace.hh:239
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:50
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:492
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:489
_build_dof_index_type< GFS, typename GFS::OrderingTag >::type type
Definition: gridfunctionspace/tags.hh:311
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:164
Definition: subspace.hh:318
Traits::SizeType size() const
Returns the global size of the root space.
Definition: subspace.hh:233
shared_ptr< const ChildGridFunctionSpace > childGridFunctionSpaceStorage() const
Returns the storage object of the original GridFunctionSpace that we provide a view for...
Definition: subspace.hh:531
std::size_t subSpaceDepth() const
Definition: subspace.hh:202
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:167
GridFunctionSubSpace(const GFS &gfs)
Definition: subspace.hh:618
const Ordering & ordering() const
Returns the ordering associated with this GridFunctionSubSpace.
Definition: subspace.hh:208
const Traits::FiniteElementMap & finiteElementMap() const
Returns the finite element map of this space.
Definition: subspace.hh:285
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:188
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:297
DefaultSubSpaceFeatures(const GFS &gfs)
Definition: subspace.hh:248
GridFunctionSubSpace(shared_ptr< const GFS > gfs_storage)
Definition: subspace.hh:614
SubSpaceFeatureProvider(const GFS &gfs)
Definition: subspace.hh:325
const BaseGridFunctionSpace & baseGridFunctionSpace() const
Returns the root GridFunctionSpace that this subspace view is based on.
Definition: subspace.hh:503
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:495
SubOrdering< typename GFS::Ordering, typename find_ordering_treepath_for_sub_gfs< typename GFS::Ordering, GFS, TreePath >::type > Ordering
The ordering used by this GridFunctionSubSpace.
Definition: subspace.hh:200
Definition: gridfunctionspace/tags.hh:31
TreePath SubSpacePath
The TreePath from the root of the space hierarchy to this subspace.
Definition: subspace.hh:161
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:24
GridFunctionSubSpace(shared_ptr< const GFS > gfs_storage)
Construct a GridFunctionSubSpace from the storage object of a root space.
Definition: subspace.hh:429
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:276
Re-exported constraints container from the original GridFunctionSpace.
Definition: subspace.hh:186
shared_ptr< const typename Traits::FiniteElementMap > finiteElementMapStorage() const
Returns the storage object for the finite element map of this space.
Definition: subspace.hh:291
Support infrastructure to make LocalFunctionSpaces of GridFunctionSubSpace work.
const Traits::GridViewType & gridView() const
Returns the underlying GridView.
Definition: subspace.hh:214
Traits::SizeType globalSize() const
Returns the global size of the root space.
Definition: subspace.hh:220
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:78
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:170
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:200