Go to the documentation of this file.
3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
10 #include <dune/common/shared_ptr.hh>
24 template<
typename GFS,
typename TreePath>
34 template<
typename GFS,
typename TP>
37 typedef typename GFS::Ordering::Traits::DOFIndex
type;
63 template<
typename Ordering,
typename GFS,
typename GFSTP,
typename OrderingTP = TypeTree::StaticTreePath<> >
64 struct find_ordering_treepath_for_sub_gfs
68 using SubOrdering = TypeTree::ChildForTreePath<Ordering,OrderingTP>;
71 typedef typename std::conditional<
78 typedef typename TypeTree::TreePathPushBack<
81 >::type SubOrderingTP;
84 typedef typename std::conditional<
86 typename TypeTree::TreePathPopFront<GFSTP>::type,
91 typedef typename find_ordering_treepath_for_sub_gfs<
101 template<
typename Ordering,
typename GFS,
typename OrderingTP>
102 struct find_ordering_treepath_for_sub_gfs<Ordering,GFS,TypeTree::StaticTreePath<>,OrderingTP>
106 typedef OrderingTP type;
120 template<
typename GFS,
typename TreePath,
typename Tag>
130 return static_cast<const SubSpace&
>(*this);
148 typedef typename ChildGridFunctionSpace::Traits
Traits;
160 typename GFS::Ordering,
161 typename find_ordering_treepath_for_sub_gfs<
162 typename GFS::Ordering,
186 const typename Traits::GridViewType&
gridView()
const
194 return _ordering.
size();
205 typename Traits::SizeType
size()
const
207 return _ordering.
size();
221 : _ordering(gfs.orderingStorage())
232 template<
typename GFS,
typename TreePath,
typename Tag>
242 return static_cast<const SubSpace&
>(*this);
251 typedef typename ChildGridFunctionSpace::Traits
Traits;
275 const std::string&
name()
const
289 template<
typename GFS,
typename TreePath,
typename Tag>
306 template<
typename GFS,
typename TreePath,
typename Tag>
307 class SubSpaceFeatureProvider
308 :
public DefaultSubSpaceFeatures<GFS,TreePath,Tag>
320 template<
typename GFS,
typename TreePath>
321 class SubSpaceFeatureProvider<GFS,TreePath,LeafGridFunctionSpaceTag>
322 :
public DefaultSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
323 ,
public LeafSubSpaceFeatures<GFS,TreePath,LeafGridFunctionSpaceTag>
346 class GridFunctionSubSpaceOutputParameters<T,true> :
352 setDataSetType(t.dataSetType());
384 template<
typename GFS,
typename TreePath>
386 :
public TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>
387 ,
public SubSpaceFeatureProvider<GFS,TreePath,TypeTree::ImplementationTag<TypeTree::ChildForTreePath<GFS,TreePath>>>
388 ,
public GridFunctionSubSpaceOutputParameters<TypeTree::ChildForTreePath<GFS,TreePath>>
391 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>;
393 using FeatureT = SubSpaceFeatureProvider<
396 TypeTree::ImplementationTag<TypeTree::ChildForTreePath<GFS,TreePath>>
403 : NodeT(TypeTree::childStorage(*gfs_storage,TreePath()))
405 , _base_gfs(gfs_storage)
416 : NodeT(TypeTree::childStorage(gfs,TreePath()))
418 , _base_gfs(stackobject_to_shared_ptr(gfs))
434 template<
typename TP>
454 template<
typename TP>
472 typedef typename ChildGridFunctionSpace::Traits
Traits;
476 TypeTree::ImplementationTag<ChildGridFunctionSpace>
499 return this->proxiedNode();
510 return this->proxiedNodeStorage();
525 std::shared_ptr<const GFS> _base_gfs;
533 template<
typename GFS,
typename TreePath>
534 struct construct_sub_space
543 template<
typename BaseGFS,
typename SubGFSTreePath,
typename TreePath>
553 typename TypeTree::TreePathConcat<
568 template<
typename GFS,
typename TreePath>
574 template<
typename GFS,
typename TreePath>
584 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_SUBSPACE_HH
DefaultSubSpaceFeatures(const GFS &gfs)
Definition: subspace.hh:220
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:142
void inheritDataSetType(const T &t)
Definition: subspace.hh:341
GridFunctionSubSpace(std::shared_ptr< const GFS > gfs_storage)
Construct a GridFunctionSubSpace from the storage object of a root space.
Definition: subspace.hh:402
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:269
void name(const std::string &name)
Definition: subspace.hh:518
const Traits::FiniteElementMap & finiteElementMap() const
Returns the finite element map of this space.
Definition: subspace.hh:257
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:145
Traits::SizeType size() const
Returns the global size of the root space.
Definition: subspace.hh:205
const Ordering & ordering() const
Returns the ordering associated with this GridFunctionSubSpace.
Definition: subspace.hh:174
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:472
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:486
std::string name() const
Definition: subspace.hh:513
Default features used by every subspace implementation.
Definition: subspace.hh:121
const Traits::EntitySet & entitySet() const
Returns the underlying EntitySet.
Definition: subspace.hh:180
GFS BaseGridFunctionSpace
The base GridFunctionSpace that this GridFunctionSubSpace is based on.
Definition: subspace.hh:466
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:469
Definition: subspace.hh:290
Support infrastructure to make LocalFunctionSpaces of GridFunctionSubSpace work.
std::shared_ptr< const typename Traits::FiniteElementMap > finiteElementMapStorage() const
Returns the storage object for the finite element map of this space.
Definition: subspace.hh:263
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:435
_build_dof_index_type< GFS, typename GFS::OrderingTag >::type type
Definition: gridfunctionspace/tags.hh:240
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:25
Traits::SizeType globalSize() const
Returns the global size of the root space.
Definition: subspace.hh:192
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
ChildGridFunctionSpace::OrderingTag OrderingTag
Re-exported OrderingTag from the original GridFunctionSpace.
Definition: subspace.hh:151
typename GFS::template ConstraintsContainer< E > Constraintscontainer
Re-exported constraints container from the original GridFunctionSpace.
Definition: subspace.hh:156
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:148
TreePath SubSpacePath
The TreePath from the root of the space hierarchy to this subspace.
Definition: subspace.hh:139
std::size_t subSpaceDepth() const
Definition: subspace.hh:168
const Traits::GridViewType & gridView() const
Returns the underlying GridView.
Definition: subspace.hh:186
Traits::SizeType maxLocalSize() const
Returns the maximum per-entity size of the TargetOrdering.
Definition: subordering.hh:191
A view on a subtree of a multi-component ordering.
Definition: subordering.hh:48
ChildGridFunctionSpace::Traits Traits
Re-exported Traits from the original GridFunctionSpace.
Definition: subspace.hh:251
SubSpaceFeatureProvider(const GFS &gfs)
Definition: subspace.hh:297
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:248
Additional features used by leaf subspaces.
Definition: subspace.hh:233
const BaseGridFunctionSpace & baseGridFunctionSpace() const
Returns the root GridFunctionSpace that this subspace view is based on.
Definition: subspace.hh:480
const std::string & name() const
Returns the name of this space.
Definition: subspace.hh:275
Definition: gridfunctionspace/tags.hh:35
std::shared_ptr< const ChildGridFunctionSpace > childGridFunctionSpaceStorage() const
Returns the storage object of the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:508
GridFunctionSubSpace(const GFS &gfs)
Construct a GridFunctionSubSpace from a root space.
Definition: subspace.hh:415
Mixin class which inherits from GridFunctionOutputParameters iff T inherits from GridFunctionOutputPa...
Definition: subspace.hh:338
static const bool consume_tree_index
Forwarded ordering property from TargetOrdering, required by PDELab internals.
Definition: subordering.hh:75
Traits::SizeType maxLocalSize() const
Returns the maximum number of DOFs per cells in this subspace.
Definition: subspace.hh:211
const ChildGridFunctionSpace & childGridFunctionSpace() const
Returns the original GridFunctionSpace that we provide a view for.
Definition: subspace.hh:497
gfs::GridFunctionSubSpace< GFS, TreePath > GridFunctionSubSpace
Non-nesting implementation of GridFunctionSubSpace.
Definition: subspace.hh:569
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:455
GridFunctionSubSpaceTag< TypeTree::ImplementationTag< ChildGridFunctionSpace > > ImplementationTag
Our ImplementationTag is derived from the tag of the original GridFunctionSpace.
Definition: subspace.hh:477
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:125
Traits::SizeType size() const
Returns the size of the BaseOrdering.
Definition: subordering.hh:179
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:166
Definition: gridfunctionspace/tags.hh:238