3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH 4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH 12 #include <dune/common/deprecated.hh> 13 #include <dune/common/exceptions.hh> 14 #include <dune/common/shared_ptr.hh> 15 #include <dune/common/stdstreams.hh> 16 #include <dune/common/typetraits.hh> 18 #include <dune/geometry/referenceelements.hh> 19 #include <dune/geometry/type.hh> 21 #include <dune/localfunctions/common/interfaceswitch.hh> 22 #include <dune/localfunctions/common/localkey.hh> 24 #include <dune/typetree/typetree.hh> 31 #define _DUNE_PDELAB_SUPPRESS_ISTL_HH_WARNING 33 #undef _DUNE_PDELAB_SUPPRESS_ISTL_HH_WARNING 73 struct _lazy_extract_gridview
78 using type =
typename T::GridView;
83 template<
typename GV_or_ES>
84 using GridView =
typename std::conditional<
86 impl::_lazy_extract_gridview,
88 >::type::template evaluate<GV_or_ES>::type;
92 template<
typename GV_or_ES>
93 using EntitySet =
typename std::conditional<
94 isEntitySet<GV_or_ES>::value,
96 AllEntitySet<GV_or_ES>
111 template<
typename G,
typename L,
typename C,
typename B,
typename O>
115 static const bool isComposite =
false;
164 template<
typename GV,
typename FEM,
typename CE=
NoConstraints,
167 :
public TypeTree::LeafNode
169 GridFunctionSpace<GV,FEM,CE,B,O>,
170 GridFunctionSpaceTraits<GV,FEM,CE,B,O>
176 typedef TypeTree::TransformTree<GridFunctionSpace,gfs_to_ordering<GridFunctionSpace> > ordering_transformation;
178 template<
typename,
typename>
191 typedef typename GV::Traits::template Codim<0>::Entity
Element;
201 typedef typename ordering_transformation::Type
Ordering;
209 typedef typename std::conditional<
228 #if DUNE_PDELAB_WARN_ON_GRIDVIEW_BASED_GFS 229 DUNE_DEPRECATED_MSG(
"GridFunctionSpaces now internally use an EntitySet instead of a GridView, please replace the template parameter and the first constructor parameter by an EntitySet").
231 : BaseT(backend,ordering_tag)
233 , pfem(stackobject_to_shared_ptr(fem))
234 , _pce(stackobject_to_shared_ptr(ce))
239 GridFunctionSpace (
const typename Traits::GridView& gridview,
const std::shared_ptr<const FEM>& fem,
const std::shared_ptr<const CE>& ce,
const B& backend = B(),
const OrderingTag& ordering_tag = OrderingTag())
240 #if DUNE_PDELAB_WARN_ON_GRIDVIEW_BASED_GFS 241 DUNE_DEPRECATED_MSG(
"GridFunctionSpaces now internally use an EntitySet instead of a GridView, please replace the template parameter and the first constructor parameter by an EntitySet").
243 : BaseT(backend,ordering_tag)
251 #if DUNE_PDELAB_WARN_ON_GRIDVIEW_BASED_GFS 252 DUNE_DEPRECATED_MSG(
"GridFunctionSpaces now internally use an EntitySet instead of a GridView, please replace the template parameter and the first constructor parameter by an EntitySet").
254 : BaseT(backend,ordering_tag)
256 , pfem(stackobject_to_shared_ptr(fem))
257 , _pce(std::make_shared<CE>())
262 #if DUNE_PDELAB_WARN_ON_GRIDVIEW_BASED_GFS 263 DUNE_DEPRECATED_MSG(
"GridFunctionSpaces now internally use an EntitySet instead of a GridView, please replace the template parameter and the first constructor parameter by an EntitySet").
265 : BaseT(backend,ordering_tag)
268 , _pce(std::make_shared<CE>())
279 : BaseT(backend,ordering_tag)
281 , pfem(stackobject_to_shared_ptr(fem))
282 , _pce(stackobject_to_shared_ptr(ce))
287 GridFunctionSpace (
const typename Traits::EntitySet& entitySet,
const std::shared_ptr<const FEM>& fem,
const std::shared_ptr<const CE>& ce,
const B& backend = B(),
const OrderingTag& ordering_tag = OrderingTag())
288 : BaseT(backend,ordering_tag)
296 : BaseT(backend,ordering_tag)
298 , pfem(stackobject_to_shared_ptr(fem))
299 , _pce(
std::make_shared<CE>())
304 : BaseT(backend,ordering_tag)
307 , _pce(
std::make_shared<CE>())
314 return _es.gridView();
352 if (!this->isRootSpace())
355 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
360 this->update(*_ordering);
368 if (!this->isRootSpace())
371 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
376 this->update(*_ordering);
384 if (!this->isRootSpace())
387 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
392 this->update(*_ordering);
400 if (!this->isRootSpace())
403 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
408 this->update(*_ordering);
417 void create_ordering()
const 419 _ordering = std::make_shared<Ordering>(ordering_transformation::transform(*
this));
423 std::shared_ptr<FEM const> pfem;
424 std::shared_ptr<CE const> _pce;
426 mutable std::shared_ptr<Ordering> _ordering;
433 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH GridFunctionSpace(const typename Traits::EntitySet &entitySet, const std::shared_ptr< const FEM > &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:303
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
const FEM & finiteElementMap() const
get finite element map
Definition: gridfunctionspace.hh:324
const Traits::ConstraintsType & constraints() const
return constraints engine
Definition: gridfunctionspace.hh:336
A grid function space.
Definition: gridfunctionspace.hh:166
const Traits::GridView & gridView() const
get grid view
Definition: gridfunctionspace.hh:312
std::shared_ptr< Ordering > orderingStorage()
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:398
Definition: constraintstransformation.hh:111
Definition: gridfunctionspacebase.hh:134
Ordering & ordering()
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:366
ordering_transformation::Type Ordering
Definition: gridfunctionspace.hh:201
GridFunctionSpace(const typename Traits::GridView &gridview, const std::shared_ptr< const FEM > &fem, const std::shared_ptr< const CE > &ce, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:239
impl::EntitySet< G > EntitySet
the entity set of this function space.
Definition: gridfunctionspace.hh:121
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:124
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
std::conditional< std::is_same< CE, NoConstraints >::value, EmptyTransformation, ConstraintsTransformation< typename Ordering::Traits::DOFIndex, typename Ordering::Traits::ContainerIndex, E > >::type Type
define Type as the Type of a container of E's
Definition: gridfunctionspace.hh:216
Tag indicating a standard ordering for a leaf GridfunctionSpace.
Definition: gridfunctionspace/tags.hh:183
std::shared_ptr< const CE > constraintsStorage() const
return storage of constraints engine
Definition: gridfunctionspace.hh:342
L::Traits::FiniteElementType FiniteElementType
finite element
Definition: gridfunctionspace.hh:140
GridFunctionSpace(const typename Traits::GridView &gridview, const std::shared_ptr< const FEM > &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:261
GridFunctionSpaceTraits< GV, FEM, CE, B, O > Traits
export Traits class
Definition: gridfunctionspace.hh:183
C ConstraintsType
type representing constraints
Definition: gridfunctionspace.hh:145
Definition: noconstraints.hh:16
GridView GridViewType
Definition: gridfunctionspace.hh:123
GridFunctionSpace(const typename Traits::GridView &gridview, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:250
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
GridFunctionSpace(const typename Traits::GridView &gridview, const FEM &fem, const CE &ce, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:227
std::shared_ptr< const Ordering > orderingStorage() const
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:382
L FiniteElementMapType
finite element map
Definition: gridfunctionspace.hh:134
GridFunctionSpace(const typename Traits::EntitySet &entitySet, const FEM &fem, const CE &ce, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:278
collect types exported by a leaf grid function space
Definition: gridfunctionspace.hh:112
O OrderingTag
tag describing the ordering.
Definition: gridfunctionspace.hh:152
const Traits::EntitySet & entitySet() const
get EntitySet
Definition: gridfunctionspace.hh:318
GV::Traits::template Codim< 0 >::Entity Element
Definition: gridfunctionspace.hh:191
O SizeTag
Definition: gridfunctionspace.hh:195
GV::Traits::template Codim< 0 >::Iterator ElementIterator
Definition: gridfunctionspace.hh:192
Definition: datahandleprovider.hh:187
impl::GridView< G > GridView
the grid view where grid function is defined upon
Definition: gridfunctionspace.hh:118
Definition: gridfunctionspace/tags.hh:32
L::Traits::FiniteElementType FiniteElement
Definition: gridfunctionspace.hh:142
extract type for storing constraints
Definition: gridfunctionspace.hh:205
Definition: exceptions.hh:34
O OrderingTag
Definition: gridfunctionspace.hh:197
B Backend
Definition: gridfunctionspace.hh:128
LeafGridFunctionSpaceTag ImplementationTag
Definition: gridfunctionspace.hh:199
B::size_type SizeType
short cut for size type exported by Backend
Definition: gridfunctionspace.hh:131
L FiniteElementMap
finite element map
Definition: gridfunctionspace.hh:137
GridFunctionSpace(const typename Traits::EntitySet &entitySet, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:295
GridFunctionSpace(const typename Traits::EntitySet &entitySet, const std::shared_ptr< const FEM > &fem, const std::shared_ptr< const CE > &ce, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:287
const Ordering & ordering() const
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:350
B BackendType
vector backend
Definition: gridfunctionspace.hh:126
Definition: istl/descriptors.hh:47
std::shared_ptr< const FEM > finiteElementMapStorage() const
get finite element map
Definition: gridfunctionspace.hh:330