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 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 TypeTree::ChildForTreePath<GFS,TreePath>>
380 ,
public SubSpaceFeatureProvider<GFS,TreePath,typename TypeTree::ChildForTreePath<GFS,TreePath>::ImplementationTag>
381 ,
public GridFunctionSubSpaceOutputParameters<TypeTree::ChildForTreePath<GFS,TreePath>>
384 using NodeT = TypeTree::ProxyNode<const TypeTree::ChildForTreePath<GFS,TreePath>>;
389 typename TypeTree::ChildForTreePath<GFS,TreePath>::ImplementationTag
396 : NodeT(TypeTree::extract_child_storage(*gfs_storage,TreePath()))
398 , _base_gfs(gfs_storage)
409 : NodeT(TypeTree::extract_child_storage(gfs,TreePath()))
411 , _base_gfs(stackobject_to_shared_ptr(gfs))
427 template<
typename TP>
447 template<
typename TP>
465 typedef typename ChildGridFunctionSpace::Traits
Traits;
469 typename ChildGridFunctionSpace::ImplementationTag
492 return this->proxiedNode();
503 return this->proxiedNodeStorage();
518 std::shared_ptr<const GFS> _base_gfs;
526 template<
typename GFS,
typename TreePath>
527 struct construct_sub_space
536 template<
typename BaseGFS,
typename SubGFSTreePath,
typename TreePath>
546 typename TypeTree::TreePathConcat<
561 template<
typename GFS,
typename TreePath>
567 template<
typename GFS,
typename TreePath>
577 #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:490
void name(const std::string &name)
Definition: subspace.hh:511
GridFunctionSubSpace(const GFS &gfs)
Construct a GridFunctionSubSpace from a root space.
Definition: subspace.hh:408
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:465
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:241
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:395
TypeTree::ChildForTreePath< GFS, TreePath > ChildGridFunctionSpace
The type of the original GridFunctionSpace that is the root of this GridFunctionSpace.
Definition: subspace.hh:462
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:479
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:473
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:428
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:448
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:506
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:501
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:470
const Traits::ConstraintsType & constraints() const
Returns the constraints engine of this space.
Definition: subspace.hh:262
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:459
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
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:562