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>
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,
181 return subSpace().childGridFunctionSpace().entitySet();
185 const typename Traits::GridViewType&
gridView()
const 187 return subSpace().childGridFunctionSpace().gridView();
193 return _ordering.size();
204 typename Traits::SizeType
size()
const 206 return _ordering.size();
212 return _ordering.maxLocalSize();
220 : _ordering(gfs.orderingStorage())
231 template<
typename GFS,
typename TreePath,
typename Tag>
239 const SubSpace& subSpace()
const 241 return static_cast<const SubSpace&
>(*this);
250 typedef typename ChildGridFunctionSpace::Traits
Traits;
258 return subSpace().childGridFunctionSpace().finiteElementMap();
264 return subSpace().childGridFunctionSpace().finiteElementMapStorage();
270 return subSpace().childGridFunctionSpace().constraints();
274 const std::string&
name()
const 276 return subSpace().childGridFunctionSpace().name();
288 template<
typename GFS,
typename TreePath,
typename Tag>
305 template<
typename GFS,
typename TreePath,
typename Tag>
319 template<
typename GFS,
typename TreePath>
349 void inheritDataSetType(
const T & t)
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>>>
390 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>;
395 TypeTree::ImplementationTag<TypeTree::ChildForTreePath<GFS,TreePath>>
402 : NodeT(TypeTree::childStorage(*gfs_storage,TreePath()))
404 , _base_gfs(gfs_storage)
406 this->inheritDataSetType(childGridFunctionSpace());
415 : NodeT(TypeTree::childStorage(gfs,TreePath()))
417 , _base_gfs(stackobject_to_shared_ptr(gfs))
419 this->inheritDataSetType(childGridFunctionSpace());
433 template<
typename TP>
435 : NodeT(TypeTree::childStorage(gfs_storage->baseGridFunctionSpace(),TreePath()))
436 ,
FeatureT(gfs_storage->baseGridFunctionSpace())
437 , _base_gfs(gfs_storage->baseGridFunctionSpaceStorage())
439 setDataSetType(childGridFunctionSpace().dataSetType());
453 template<
typename TP>
455 : NodeT(TypeTree::childStorage(gfs.baseGridFunctionSpace(),TreePath()))
456 ,
FeatureT(gfs.baseGridFunctionSpace())
457 , _base_gfs(gfs.baseGridFunctionSpaceStorage())
459 this->inheritDataSetType(childGridFunctionSpace());
471 typedef typename ChildGridFunctionSpace::Traits
Traits;
475 TypeTree::ImplementationTag<ChildGridFunctionSpace>
498 return this->proxiedNode();
509 return this->proxiedNodeStorage();
514 return childGridFunctionSpace().name();
517 void name(
const std::string& name)
519 childGridFunctionSpace().name(name);
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 const std::string & name() const
Returns the name of this space.
Definition: subspace.hh:274
GridFunctionSubSpace(std::shared_ptr< const GFS > gfs_storage)
Construct a GridFunctionSubSpace from the storage object of a root space.
Definition: subspace.hh:401
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:49
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:268
void inheritDataSetType(const T &t)
Definition: subspace.hh:340
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
Additional features used by leaf subspaces.
Definition: subspace.hh:232
const BaseGridFunctionSpace & baseGridFunctionSpace() const
Returns the root GridFunctionSpace that this subspace view is based on.
Definition: subspace.hh:479
GridFunctionSubSpaceTag< TypeTree::ImplementationTag< ChildGridFunctionSpace > > ImplementationTag
Our ImplementationTag is derived from the tag of the original GridFunctionSpace.
Definition: subspace.hh:476
Traits::SizeType globalSize() const
Returns the global size of the root space.
Definition: subspace.hh:191
DefaultSubSpaceFeatures(const GFS &gfs)
Definition: subspace.hh:219
TreePath SubSpacePath
The TreePath from the root of the space hierarchy to this subspace.
Definition: subspace.hh:138
Definition: gridfunctionspace/tags.hh:233
Mixin class which inherits from GridFunctionOutputParameters iff T inherits from GridFunctionOutputPa...
Definition: subspace.hh:337
std::size_t subSpaceDepth() const
Definition: subspace.hh:167
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
SubSpaceFeatureProvider(const GFS &gfs)
Definition: subspace.hh:296
const Ordering & ordering() const
Returns the ordering associated with this GridFunctionSubSpace.
Definition: subspace.hh:173
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
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:147
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
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
void name(const std::string &name)
Definition: subspace.hh:517
const Traits::EntitySet & entitySet() const
Returns the underlying EntitySet.
Definition: subspace.hh:179
Default features used by every subspace implementation.
Definition: subspace.hh:120
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:250
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:24
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:76
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:247
typename GFS::template ConstraintsContainer< E > Constraintscontainer
Re-exported constraints container from the original GridFunctionSpace.
Definition: subspace.hh:155
Definition: subspace.hh:289
ChildGridFunctionSpace::OrderingTag OrderingTag
Re-exported OrderingTag from the original GridFunctionSpace.
Definition: subspace.hh:150
const Traits::GridViewType & gridView() const
Returns the underlying GridView.
Definition: subspace.hh:185
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:144
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:465
std::string name() const
Definition: subspace.hh:512
Definition: gridfunctionspace/tags.hh:35
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:123
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:471
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:468
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:141
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
const Traits::FiniteElementMap & finiteElementMap() const
Returns the finite element map of this space.
Definition: subspace.hh:256
Traits::SizeType size() const
Returns the global size of the root space.
Definition: subspace.hh:204
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
GridFunctionSubSpace(const GFS &gfs)
Construct a GridFunctionSubSpace from a root space.
Definition: subspace.hh:414
Support infrastructure to make LocalFunctionSpaces of GridFunctionSubSpace work.
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