3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_HH 4 #define DUNE_PDELAB_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> 66 struct _lazy_extract_gridview
71 using type =
typename T::GridView;
76 template<
typename GV_or_ES>
77 using GridView =
typename std::conditional<
79 impl::_lazy_extract_gridview,
81 >::type::template evaluate<GV_or_ES>::type;
85 template<
typename GV_or_ES>
86 using EntitySet =
typename std::conditional<
87 isEntitySet<GV_or_ES>::value,
89 AllEntitySet<GV_or_ES>
104 template<
typename G,
typename L,
typename C,
typename B,
typename O>
108 static const bool isComposite =
false;
161 template<
typename GV,
typename FEM,
typename CE=
NoConstraints,
164 :
public TypeTree::LeafNode
166 GridFunctionSpace<GV,FEM,CE,B,P>,
167 GridFunctionSpaceTraits<GV,FEM,CE,B,P>
173 typedef TypeTree::TransformTree<GridFunctionSpace,gfs_to_ordering<GridFunctionSpace> > ordering_transformation;
175 template<
typename,
typename>
188 typedef typename GV::Traits::template Codim<0>::Entity
Element;
197 typedef typename ordering_transformation::Type
Ordering;
205 typedef typename conditional<
224 : BaseT(backend,ordering_tag)
226 , pfem(stackobject_to_shared_ptr(fem))
227 , _pce(stackobject_to_shared_ptr(ce))
232 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())
233 : BaseT(backend,ordering_tag)
241 : BaseT(backend,ordering_tag)
243 , pfem(stackobject_to_shared_ptr(fem))
244 , _pce(
std::make_shared<CE>())
249 : BaseT(backend,ordering_tag)
252 , _pce(
std::make_shared<CE>())
263 : BaseT(backend,ordering_tag)
265 , pfem(stackobject_to_shared_ptr(fem))
266 , _pce(stackobject_to_shared_ptr(ce))
271 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())
272 : BaseT(backend,ordering_tag)
280 : BaseT(backend,ordering_tag)
282 , pfem(stackobject_to_shared_ptr(fem))
283 , _pce(
std::make_shared<CE>())
288 : BaseT(backend,ordering_tag)
291 , _pce(
std::make_shared<CE>())
298 return _es.gridView();
336 if (!this->isRootSpace())
339 "Ordering can only be obtained for root space in GridFunctionSpace tree.");
344 this->update(*_ordering);
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);
401 void create_ordering()
const 403 _ordering = std::make_shared<Ordering>(ordering_transformation::transform(*
this));
407 std::shared_ptr<FEM const> pfem;
408 std::shared_ptr<CE const> _pce;
410 mutable std::shared_ptr<Ordering> _ordering;
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:262
Definition: exceptions.hh:34
std::shared_ptr< const Ordering > orderingStorage() const
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:366
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:232
L FiniteElementMap
finite element map
Definition: gridfunctionspace.hh:130
Tag indicating a standard ordering for a leaf GridfunctionSpace.
Definition: gridfunctionspace/tags.hh:221
L FiniteElementMapType
finite element map
Definition: gridfunctionspace.hh:127
static const unsigned int value
Definition: gridfunctionspace/tags.hh:177
impl::GridView< G > GridView
the grid view where grid function is defined upon
Definition: gridfunctionspace.hh:111
Definition: noconstraints.hh:16
std::shared_ptr< Ordering > orderingStorage()
Direct access to the storage of the DOF ordering.
Definition: gridfunctionspace.hh:382
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
std::shared_ptr< const FEM > finiteElementMapStorage() const
get finite element map
Definition: gridfunctionspace.hh:314
Definition: adaptivity.hh:27
impl::EntitySet< G > EntitySet
the entity set of this function space.
Definition: gridfunctionspace.hh:114
P SizeTag
Definition: gridfunctionspace.hh:191
const Traits::GridView & gridView() const
get grid view
Definition: gridfunctionspace.hh:296
B BackendType
vector backend
Definition: gridfunctionspace.hh:119
Ordering & ordering()
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:350
B::size_type SizeType
short cut for size type exported by Backend
Definition: gridfunctionspace.hh:124
P OrderingTag
Definition: gridfunctionspace.hh:193
LeafGridFunctionSpaceTag ImplementationTag
Definition: gridfunctionspace.hh:195
Definition: datahandleprovider.hh:188
ordering_transformation::Type Ordering
Definition: gridfunctionspace.hh:197
collect types exported by a leaf grid function space
Definition: gridfunctionspace.hh:105
GridView GridViewType
Definition: gridfunctionspace.hh:116
const Traits::ConstraintsType & constraints() const
return constraints engine
Definition: gridfunctionspace.hh:320
GridFunctionSpace(const typename Traits::EntitySet &entitySet, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:279
GridFunctionSpace(const typename Traits::GridView &gridview, const FEM &fem, const B &backend=B(), const OrderingTag &ordering_tag=OrderingTag())
constructor
Definition: gridfunctionspace.hh:240
extract type for storing constraints
Definition: gridfunctionspace.hh:201
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:271
Definition: gridfunctionspace/tags.hh:32
Mixin base class for specifying output hints to I/O routines like VTK.
Definition: function.hh:123
const Ordering & ordering() const
Direct access to the DOF ordering.
Definition: gridfunctionspace.hh:334
GV::Traits::template Codim< 0 >::Iterator ElementIterator
Definition: gridfunctionspace.hh:189
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:287
L::Traits::FiniteElementType FiniteElement
Definition: gridfunctionspace.hh:135
Definition: constraintstransformation.hh:111
Definition: istl/descriptors.hh:47
GridFunctionSpaceTraits< GV, FEM, CE, B, P > Traits
export Traits class
Definition: gridfunctionspace.hh:180
GV::Traits::template Codim< 0 >::Entity Element
Definition: gridfunctionspace.hh:188
C ConstraintsType
type representing constraints
Definition: gridfunctionspace.hh:138
conditional< 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:212
Definition: gridfunctionspacebase.hh:134
std::shared_ptr< const CE > constraintsStorage() const
return storage of constraints engine
Definition: gridfunctionspace.hh:326
const Traits::EntitySet & entitySet() const
get EntitySet
Definition: gridfunctionspace.hh:302
L::Traits::FiniteElementType FiniteElementType
finite element
Definition: gridfunctionspace.hh:133
B Backend
Definition: gridfunctionspace.hh:121
const FEM & finiteElementMap() const
get finite element map
Definition: gridfunctionspace.hh:308
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:248
O OrderingTag
tag describing the ordering.
Definition: gridfunctionspace.hh:145
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:223
A grid function space.
Definition: gridfunctionspace.hh:163