Go to the documentation of this file.
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 using SubOrdering = TypeTree::ChildForTreePath<Ordering,OrderingTP>;
70 typedef typename std::conditional<
77 typedef typename TypeTree::TreePathPushBack<
80 >::type SubOrderingTP;
83 typedef typename std::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>
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,
185 const typename Traits::GridViewType&
gridView()
const
193 return _ordering.
size();
204 typename Traits::SizeType
size()
const
206 return _ordering.
size();
220 : _ordering(gfs.orderingStorage())
231 template<
typename GFS,
typename TreePath,
typename Tag>
241 return static_cast<const SubSpace&
>(*this);
250 typedef typename ChildGridFunctionSpace::Traits
Traits;
274 const std::string&
name()
const
288 template<
typename GFS,
typename TreePath,
typename Tag>
305 template<
typename GFS,
typename TreePath,
typename Tag>
306 class SubSpaceFeatureProvider
307 :
public DefaultSubSpaceFeatures<GFS,TreePath,Tag>
319 template<
typename GFS,
typename TreePath>
320 class SubSpaceFeatureProvider<GFS,TreePath,LeafGridFunctionSpaceTag>
321 :
public DefaultSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
322 ,
public LeafSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
345 class GridFunctionSubSpaceOutputParameters<T,true> :
351 setDataSetType(t.dataSetType());
383 template<
typename GFS,
typename TreePath>
385 :
public TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>
386 ,
public SubSpaceFeatureProvider<GFS,TreePath,TypeTree::ImplementationTag<TypeTree::ChildForTreePath<GFS,TreePath>>>
387 ,
public GridFunctionSubSpaceOutputParameters<TypeTree::ChildForTreePath<GFS,TreePath>>
390 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>;
392 using FeatureT = SubSpaceFeatureProvider<
395 TypeTree::ImplementationTag<TypeTree::ChildForTreePath<GFS,TreePath>>
402 : NodeT(TypeTree::childStorage(*gfs_storage,TreePath()))
404 , _base_gfs(gfs_storage)
415 : NodeT(TypeTree::childStorage(gfs,TreePath()))
417 , _base_gfs(stackobject_to_shared_ptr(gfs))
433 template<
typename TP>
453 template<
typename TP>
471 typedef typename ChildGridFunctionSpace::Traits
Traits;
475 TypeTree::ImplementationTag<ChildGridFunctionSpace>
498 return this->proxiedNode();
509 return this->proxiedNodeStorage();
524 std::shared_ptr<const GFS> _base_gfs;
532 template<
typename GFS,
typename TreePath>
533 struct construct_sub_space
542 template<
typename BaseGFS,
typename SubGFSTreePath,
typename TreePath>
552 typename TypeTree::TreePathConcat<
567 template<
typename GFS,
typename TreePath>
573 template<
typename GFS,
typename TreePath>
583 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
GridFunctionSubSpaceTag< TypeTree::ImplementationTag< ChildGridFunctionSpace > > ImplementationTag
Our ImplementationTag is derived from the tag of the original GridFunctionSpace.
Definition: subspace.hh:476
std::shared_ptr< const typename Traits::FiniteElementMap > finiteElementMapStorage() const
Returns the storage object for the finite element map of this space.
Definition: subspace.hh:262
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:124
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:465
Traits::SizeType size() const
Returns the global size of the root space.
Definition: subspace.hh:204
std::shared_ptr< const ChildGridFunctionSpace > childGridFunctionSpaceStorage() const
Returns the storage object of the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:507
Definition: gridfunctionspace/tags.hh:35
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:75
GridFunctionSubSpace(const GFS &gfs)
Construct a GridFunctionSubSpace from a root space.
Definition: subspace.hh:414
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:179
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:468
_build_dof_index_type< GFS, typename GFS::OrderingTag >::type type
Definition: gridfunctionspace/tags.hh:240
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
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:485
Additional features used by leaf subspaces.
Definition: subspace.hh:232
Definition: gridfunctionspace/tags.hh:238
typename GFS::template ConstraintsContainer< E > Constraintscontainer
Re-exported constraints container from the original GridFunctionSpace.
Definition: subspace.hh:155
const std::string & name() const
Returns the name of this space.
Definition: subspace.hh:274
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:471
Support infrastructure to make LocalFunctionSpaces of GridFunctionSubSpace work.
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:250
std::size_t subSpaceDepth() const
Definition: subspace.hh:167
ChildGridFunctionSpace::OrderingTag OrderingTag
Re-exported OrderingTag from the original GridFunctionSpace.
Definition: subspace.hh:150
Mixin class which inherits from GridFunctionOutputParameters iff T inherits from GridFunctionOutputPa...
Definition: subspace.hh:337
Default features used by every subspace implementation.
Definition: subspace.hh:120
DefaultSubSpaceFeatures(const GFS &gfs)
Definition: subspace.hh:219
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:141
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:147
GridFunctionSubSpace(std::shared_ptr< const GFS > gfs_storage)
Construct a GridFunctionSubSpace from the storage object of a root space.
Definition: subspace.hh:401
const Traits::GridViewType & gridView() const
Returns the underlying GridView.
Definition: subspace.hh:185
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:191
Definition: subspace.hh:289
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:247
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:48
std::string name() const
Definition: subspace.hh:512
const Traits::EntitySet & entitySet() const
Returns the underlying EntitySet.
Definition: subspace.hh:179
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:24
gfs::GridFunctionSubSpace< GFS, TreePath > GridFunctionSubSpace
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:568
const Ordering & ordering() const
Returns the ordering associated with this GridFunctionSubSpace.
Definition: subspace.hh:173
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:268
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
Traits::SizeType maxLocalSize() const
Returns the maximum number of DOFs per cells in this subspace.
Definition: subspace.hh:210
const ChildGridFunctionSpace & childGridFunctionSpace() const
Returns the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:496
void inheritDataSetType(const T &t)
Definition: subspace.hh:340
TreePath SubSpacePath
The TreePath from the root of the space hierarchy to this subspace.
Definition: subspace.hh:138
GridFunctionSubSpace(std::shared_ptr< const GridFunctionSubSpace< GFS, TP > > gfs_storage, typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type=nullptr)
Construct a GridFunctionSubSpace from the storage of another GridFunctionSubSpace.
Definition: subspace.hh:434
const BaseGridFunctionSpace & baseGridFunctionSpace() const
Returns the root GridFunctionSpace that this subspace view is based on.
Definition: subspace.hh:479
GridFunctionSubSpace(const GridFunctionSubSpace< GFS, TP > &gfs, typename std::enable_if<!std::is_same< TP, TreePath >::value, void * >::type=nullptr)
Construct a GridFunctionSubSpace from another GridFunctionSubSpace.
Definition: subspace.hh:454
SubSpaceFeatureProvider(const GFS &gfs)
Definition: subspace.hh:296
void name(const std::string &name)
Definition: subspace.hh:517
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:144
Traits::SizeType globalSize() const
Returns the global size of the root space.
Definition: subspace.hh:191
const Traits::FiniteElementMap & finiteElementMap() const
Returns the finite element map of this space.
Definition: subspace.hh:256