3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
23 template<
typename GFS,
typename TreePath>
33 template<
typename GFS,
typename TP>
36 typedef typename GFS::Ordering::Traits::DOFIndex
type;
62 template<
typename Ordering,
typename GFS,
typename GFSTP,
typename OrderingTP = TypeTree::TreePath<> >
63 struct find_ordering_treepath_for_sub_gfs
67 typedef typename TypeTree::extract_child_type<Ordering,OrderingTP>::type
SubOrdering;
70 typedef typename conditional<
77 typedef typename TypeTree::TreePathPushBack<
80 >::type SubOrderingTP;
83 typedef typename conditional<
85 typename TypeTree::TreePathPopFront<GFSTP>::type,
90 typedef typename find_ordering_treepath_for_sub_gfs<
100 template<
typename Ordering,
typename GFS,
typename OrderingTP>
101 struct find_ordering_treepath_for_sub_gfs<Ordering,GFS,TypeTree::TreePath<>,OrderingTP>
105 typedef OrderingTP type;
119 template<
typename GFS,
typename TreePath,
typename Tag>
127 const SubSpace& subSpace()
const
129 return static_cast<const SubSpace&
>(*this);
147 typedef typename ChildGridFunctionSpace::Traits
Traits;
159 typename GFS::Ordering,
160 typename find_ordering_treepath_for_sub_gfs<
161 typename GFS::Ordering,
179 const typename Traits::GridViewType&
gridView()
const
187 return _ordering.
size();
198 typename Traits::SizeType
size()
const
200 return _ordering.
size();
214 : _ordering(gfs.orderingStorage())
225 template<
typename GFS,
typename TreePath,
typename Tag>
233 const SubSpace& subSpace()
const
235 return static_cast<const SubSpace&
>(*this);
244 typedef typename ChildGridFunctionSpace::Traits
Traits;
268 const std::string&
name()
const
282 template<
typename GFS,
typename TreePath,
typename Tag>
299 template<
typename GFS,
typename TreePath,
typename Tag>
300 class SubSpaceFeatureProvider
301 :
public DefaultSubSpaceFeatures<GFS,TreePath,Tag>
313 template<
typename GFS,
typename TreePath>
314 class SubSpaceFeatureProvider<GFS,TreePath,LeafGridFunctionSpaceTag>
315 :
public DefaultSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
316 ,
public LeafSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
339 class GridFunctionSubSpaceOutputParameters<T,true> :
345 setDataSetType(t.dataSetType());
377 template<
typename GFS,
typename TreePath>
379 :
public TypeTree::ProxyNode<const typename TypeTree::extract_child_type<GFS,TreePath>::type>
380 ,
public SubSpaceFeatureProvider<GFS,TreePath,typename TypeTree::extract_child_type<
383 >::type::ImplementationTag
385 ,
public GridFunctionSubSpaceOutputParameters<typename TypeTree::extract_child_type<GFS,TreePath>::type>
388 typedef TypeTree::ProxyNode<
389 const typename TypeTree::extract_child_type<
398 typename TypeTree::extract_child_type<
401 >::type::ImplementationTag
408 : NodeT(TypeTree::extract_child_storage(*gfs_storage,TreePath()))
409 , FeatureT(*gfs_storage)
410 , _base_gfs(gfs_storage)
421 : NodeT(TypeTree::extract_child_storage(gfs,TreePath()))
423 , _base_gfs(stackobject_to_shared_ptr(gfs))
439 template<
typename TP>
459 template<
typename TP>
477 typedef typename ChildGridFunctionSpace::Traits
Traits;
481 typename ChildGridFunctionSpace::ImplementationTag
504 return this->proxiedNode();
515 return this->proxiedNodeStorage();
530 std::shared_ptr<const GFS> _base_gfs;
538 template<
typename GFS,
typename TreePath>
539 struct construct_sub_space
548 template<
typename BaseGFS,
typename SubGFSTreePath,
typename TreePath>
558 typename TypeTree::TreePathConcat<
573 template<
typename GFS,
typename TreePath>
579 template<
typename GFS,
typename TreePath>
589 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
Default features used by every subspace implementation.
Definition: subspace.hh:120
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:244
ChildGridFunctionSpace::OrderingTag OrderingTag
Re-exported OrderingTag from the original GridFunctionSpace.
Definition: subspace.hh:150
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:188
Definition: gridfunctionspace/tags.hh:35
const std::string & name() const
Returns the name of this space.
Definition: subspace.hh:268
_build_dof_index_type< GFS, typename GFS::OrderingTag >::type type
Definition: gridfunctionspace/tags.hh:311
const ChildGridFunctionSpace & childGridFunctionSpace() const
Returns the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:502
void name(const std::string &name)
Definition: subspace.hh:523
GridFunctionSubSpace(const GFS &gfs)
Construct a GridFunctionSubSpace from a root space.
Definition: subspace.hh:420
Traits::SizeType maxLocalSize() const
Returns the maximum number of DOFs per cells in this subspace.
Definition: subspace.hh:204
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:477
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:50
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:24
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:141
GridFunctionSubSpace(std::shared_ptr< const GFS > gfs_storage)
Construct a GridFunctionSubSpace from the storage object of a root space.
Definition: subspace.hh:407
Traits::SizeType size() const
Returns the global size of the root space.
Definition: subspace.hh:198
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:123
Additional features used by leaf subspaces.
Definition: subspace.hh:226
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:78
std::shared_ptr< const BaseGridFunctionSpace > baseGridFunctionSpaceStorage() const
Returns the storage object of the root GridFunctionSpace that this subspace view is based on...
Definition: subspace.hh:491
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:474
std::size_t subSpaceDepth() const
Definition: subspace.hh:167
const BaseGridFunctionSpace & baseGridFunctionSpace() const
Returns the root GridFunctionSpace that this subspace view is based on.
Definition: subspace.hh:485
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:144
GridFunctionSubSpace(std::shared_ptr< const GridFunctionSubSpace< GFS, TP > > gfs_storage, typename enable_if<!is_same< TP, TreePath >::value, void * >::type=nullptr)
Construct a GridFunctionSubSpace from the storage of another GridFunctionSubSpace.
Definition: subspace.hh:440
Mixin class which inherits from GridFunctionOutputParameters iff T inherits from GridFunctionOutputPa...
Definition: subspace.hh:331
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:200
const Ordering & ordering() const
Returns the ordering associated with this GridFunctionSubSpace.
Definition: subspace.hh:173
GridFunctionSubSpace(const GridFunctionSubSpace< GFS, TP > &gfs, typename enable_if<!is_same< TP, TreePath >::value, void * >::type=nullptr)
Construct a GridFunctionSubSpace from another GridFunctionSubSpace.
Definition: subspace.hh:460
std::shared_ptr< const typename Traits::FiniteElementMap > finiteElementMapStorage() const
Returns the storage object for the finite element map of this space.
Definition: subspace.hh:256
Definition: adaptivity.hh:27
typename GFS::template ConstraintsContainer< E > Constraintscontainer
Re-exported constraints container from the original GridFunctionSpace.
Definition: subspace.hh:155
void inheritDataSetType(const T &t)
Definition: subspace.hh:334
std::string name() const
Definition: subspace.hh:518
DefaultSubSpaceFeatures(const GFS &gfs)
Definition: subspace.hh:213
Definition: gridfunctionspace/tags.hh:309
std::shared_ptr< const ChildGridFunctionSpace > childGridFunctionSpaceStorage() const
Returns the storage object of the original GridFunctionSpace that we provide a view for...
Definition: subspace.hh:513
Support infrastructure to make LocalFunctionSpaces of GridFunctionSubSpace work.
GridFunctionSubSpaceTag< typename ChildGridFunctionSpace::ImplementationTag > ImplementationTag
Our ImplementationTag is derived from the tag of the original GridFunctionSpace.
Definition: subspace.hh:482
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:262
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:471
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:165
TreePath SubSpacePath
The TreePath from the root of the space hierarchy to this subspace.
Definition: subspace.hh:138
const Traits::GridViewType & gridView() const
Returns the underlying GridView.
Definition: subspace.hh:179
const Traits::FiniteElementMap & finiteElementMap() const
Returns the finite element map of this space.
Definition: subspace.hh:250
Definition: subspace.hh:283
Traits::SizeType globalSize() const
Returns the global size of the root space.
Definition: subspace.hh:185
SubSpaceFeatureProvider(const GFS &gfs)
Definition: subspace.hh:290
TypeTree::extract_child_type< GFS, TreePath >::type ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:241
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:147
gfs::GridFunctionSubSpace< GFS, TreePath > GridFunctionSubSpace
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:574