3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH 4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH 12 #include <dune/common/exceptions.hh> 13 #include <dune/common/shared_ptr.hh> 14 #include <dune/common/stdstreams.hh> 15 #include <dune/common/typetraits.hh> 17 #include <dune/geometry/referenceelements.hh> 18 #include <dune/geometry/type.hh> 20 #include <dune/localfunctions/common/interfaceswitch.hh> 21 #include <dune/localfunctions/common/localkey.hh> 23 #include <dune/typetree/typetree.hh> 30 #define _DUNE_PDELAB_SUPPRESS_ISTL_HH_WARNING 32 #undef _DUNE_PDELAB_SUPPRESS_ISTL_HH_WARNING 72 struct _lazy_extract_gridview
77 using type =
typename T::GridView;
82 template<
typename GV_or_ES>
83 using GridView =
typename std::conditional<
85 impl::_lazy_extract_gridview,
87 >::type::template evaluate<GV_or_ES>::type;
91 template<
typename GV_or_ES>
92 using EntitySet =
typename std::conditional<
93 isEntitySet<GV_or_ES>::value,
95 AllEntitySet<GV_or_ES>
110 template<
typename G,
typename L,
typename C,
typename B,
typename O>
114 static const bool isComposite =
false;
167 template<
typename GV,
typename FEM,
typename CE=
NoConstraints,
170 :
public TypeTree::LeafNode
172 GridFunctionSpace<GV,FEM,CE,B,P>,
173 GridFunctionSpaceTraits<GV,FEM,CE,B,P>
179 typedef TypeTree::TransformTree<GridFunctionSpace,gfs_to_ordering<GridFunctionSpace> > ordering_transformation;
181 template<
typename,
typename>
194 typedef typename GV::Traits::template Codim<0>::Entity
Element;
203 typedef typename ordering_transformation::Type
Ordering;
211 typedef typename std::conditional<
230 : BaseT(backend,ordering_tag)
232 , pfem(stackobject_to_shared_ptr(fem))
233 , _pce(stackobject_to_shared_ptr(ce))
238 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())
239 : BaseT(backend,ordering_tag)
247 : BaseT(backend,ordering_tag)
249 , pfem(stackobject_to_shared_ptr(fem))
250 , _pce(
std::make_shared<CE>())
255 : BaseT(backend,ordering_tag)
258 , _pce(
std::make_shared<CE>())
269 : BaseT(backend,ordering_tag)
271 , pfem(stackobject_to_shared_ptr(fem))
272 , _pce(stackobject_to_shared_ptr(ce))
277 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())
278 : BaseT(backend,ordering_tag)
286 : BaseT(backend,ordering_tag)
288 , pfem(stackobject_to_shared_ptr(fem))
289 , _pce(
std::make_shared<CE>())
294 : BaseT(backend,ordering_tag)
297 , _pce(
std::make_shared<CE>())
304 return _es.gridView();
342 if (!this->isRootSpace())
345 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
350 this->update(*_ordering);
358 if (!this->isRootSpace())
361 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
366 this->update(*_ordering);
374 if (!this->isRootSpace())
377 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
382 this->update(*_ordering);
390 if (!this->isRootSpace())
393 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
398 this->update(*_ordering);
407 void create_ordering()
const 409 _ordering = std::make_shared<Ordering>(ordering_transformation::transform(*
this));
413 std::shared_ptr<FEM const> pfem;
414 std::shared_ptr<CE const> _pce;
416 mutable std::shared_ptr<Ordering> _ordering;
423 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_GRIDFUNCTIONSPACE_HH
const FEM & finiteElementMap() const
get finite element map
Definition: gridfunctionspace.hh:314
P OrderingTag
Definition: gridfunctionspace.hh:199
const Traits::ConstraintsType & constraints() const
return constraints engine
Definition: gridfunctionspace.hh:326
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:277
const Traits::GridView & gridView() const
get grid view
Definition: gridfunctionspace.hh:302
P SizeTag
Definition: gridfunctionspace.hh:197
Definition: istl/descriptors.hh:50
GridFunctionSpace(const typename Traits::EntitySet &entitySet, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:285
O OrderingTag
tag describing the ordering.
Definition: gridfunctionspace.hh:151
L::Traits::FiniteElementType FiniteElement
Definition: gridfunctionspace.hh:141
extract type for storing constraints
Definition: gridfunctionspace.hh:207
B BackendType
vector backend
Definition: gridfunctionspace.hh:125
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
L FiniteElementMap
finite element map
Definition: gridfunctionspace.hh:136
Tag indicating a standard ordering for a leaf GridfunctionSpace.
Definition: gridfunctionspace/tags.hh:183
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:254
std::shared_ptr< const Ordering > orderingStorage() const
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:372
ordering_transformation::Type Ordering
Definition: gridfunctionspace.hh:203
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:229
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
LeafGridFunctionSpaceTag ImplementationTag
Definition: gridfunctionspace.hh:201
A grid function space.
Definition: gridfunctionspace.hh:169
GridView GridViewType
Definition: gridfunctionspace.hh:122
Definition: datahandleprovider.hh:187
const Traits::EntitySet & entitySet() const
get EntitySet
Definition: gridfunctionspace.hh:308
B::size_type SizeType
short cut for size type exported by Backend
Definition: gridfunctionspace.hh:130
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:293
Definition: gridfunctionspacebase.hh:134
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:123
Ordering & ordering()
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:356
Definition: noconstraints.hh:16
collect types exported by a leaf grid function space
Definition: gridfunctionspace.hh:111
B Backend
Definition: gridfunctionspace.hh:127
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
impl::GridView< G > GridView
the grid view where grid function is defined upon
Definition: gridfunctionspace.hh:117
GV::Traits::template Codim< 0 >::Entity Element
Definition: gridfunctionspace.hh:194
GridFunctionSpace(const typename Traits::GridView &gridview, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:246
Definition: gridfunctionspace/tags.hh:32
GV::Traits::template Codim< 0 >::Iterator ElementIterator
Definition: gridfunctionspace.hh:195
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:238
const Ordering & ordering() const
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:340
std::shared_ptr< const CE > constraintsStorage() const
return storage of constraints engine
Definition: gridfunctionspace.hh:332
Definition: exceptions.hh:34
L::Traits::FiniteElementType FiniteElementType
finite element
Definition: gridfunctionspace.hh:139
GridFunctionSpaceTraits< GV, FEM, CE, B, P > Traits
export Traits class
Definition: gridfunctionspace.hh:186
Definition: constraintstransformation.hh:111
std::shared_ptr< Ordering > orderingStorage()
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:388
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:218
impl::EntitySet< G > EntitySet
the entity set of this function space.
Definition: gridfunctionspace.hh:120
C ConstraintsType
type representing constraints
Definition: gridfunctionspace.hh:144
std::shared_ptr< const FEM > finiteElementMapStorage() const
get finite element map
Definition: gridfunctionspace.hh:320
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:268
L FiniteElementMapType
finite element map
Definition: gridfunctionspace.hh:133