dune-pdelab 2.7-git
Loading...
Searching...
No Matches
localfunctionspace.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
4#define DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
5
6#include<vector>
7
8#include <dune/common/stdstreams.hh>
9#include <dune/common/shared_ptr.hh>
10
11#include <dune/geometry/referenceelements.hh>
12
13#include <dune/localfunctions/common/interfaceswitch.hh>
14#include <dune/localfunctions/common/localkey.hh>
15
16#include <dune/typetree/typetree.hh>
17
20
21namespace Dune {
22 namespace PDELab {
23
27
28 //=======================================
29 // local function space base: metaprograms
30 //=======================================
31
32 namespace {
33
34 // the bogus template parameter is necessary to make GCC honor the friend declaration
35 // in the LocalFunctionSpace (probably a GCC bug)
36 template<typename = int>
37 struct PropagateGlobalStorageVisitor
38 : public TypeTree::TreeVisitor
39 , public TypeTree::DynamicTraversal
40 {
41
42 template<typename LFS, typename Child, typename TreePath, typename ChildIndex>
43 void beforeChild(const LFS& lfs, Child& child, TreePath treePath, ChildIndex childIndex) const
44 {
45 child._dof_indices = lfs._dof_indices;
46 }
47 };
48
49 // This visitor is not used in standard PDELab code, but is necessary for MultiDomain
50 // It is defined here due to the necessary friend declarations in the local function spaces.
51 // for template parameter see above
52 template<typename = int>
53 struct ClearSizeVisitor
54 : public TypeTree::TreeVisitor
55 , public TypeTree::DynamicTraversal
56 {
57
58 template<typename Node, typename TreePath>
59 void pre(Node& node, TreePath treePath)
60 {
61 leaf(node,treePath);
62 }
63
64 template<typename Node, typename TreePath>
65 void leaf(Node& node, TreePath treePath)
66 {
67 node.offset = offset;
68 node.n = 0;
69 }
70
71 ClearSizeVisitor(std::size_t offset_)
72 : offset(offset_)
73 {}
74
75 const std::size_t offset;
76
77 };
78
79
80 template<typename Entity, bool fast>
81 struct ComputeSizeVisitor
82 : public TypeTree::TreeVisitor
83 , public TypeTree::DynamicTraversal
84 {
85
86 template<typename Node, typename TreePath>
87 void pre(Node& node, TreePath treePath)
88 {
89 node.offset = offset;
90 }
91
92 template<typename Node, typename TreePath>
93 void post(Node& node, TreePath treePath)
94 {
95 node.n = offset - node.offset;
96 }
97
98 template<typename Node, typename TreePath>
99 void leaf(Node& node, TreePath treePath)
100 {
101 node.offset = offset;
102 node.pfe = nullptr;
103 node._in_entity_set = node.pgfs->entitySet().contains(e);
104 if (not node._in_entity_set) {
105 node.n = 0;
106 } else if (fast) {
107 node.n = node.pgfs->finiteElementMap().maxLocalSize();
108 Node::FESwitch::setStore(node.pfe,
109 node.pgfs->finiteElementMap().find(e));
110 } else {
111 Node::FESwitch::setStore(node.pfe,
112 node.pgfs->finiteElementMap().find(e));
113 node.n = Node::FESwitch::basis(*node.pfe).size();
114 }
115 offset += node.n;
116 }
117
118 ComputeSizeVisitor(const Entity& entity, std::size_t offset_ = 0)
119 : e(entity)
120 , offset(offset_)
121 {}
122
123 const Entity& e;
124 std::size_t offset;
125
126 };
127
128
129 template<typename Entity, bool fast>
130 struct FillIndicesVisitor
131 : public TypeTree::TreeVisitor
132 , public TypeTree::DynamicTraversal
133 {
134
135 template<typename Node, typename TreePath>
136 void leaf(Node& node, TreePath treePath)
137 {
138 // setup DOFIndices for this finite element
139 node.dofIndices(e,node._dof_indices->begin()+node.offset,node._dof_indices->begin()+node.offset+node.n,std::integral_constant<bool,fast>{});
140 }
141
142 template<typename Node, typename Child, typename TreePath, typename ChildIndex>
143 void afterChild(const Node& node, const Child& child, TreePath treePath, ChildIndex childIndex)
144 {
145 // Just skip the entire function space structure handling in fast mode
146 // This **really** breaks any attempt at using the DOFIndex for anything other
147 // than as input to the FastDGGridOperator machine.
148 // You have been warned!
149 if (not fast)
150 for (std::size_t i = 0; i<child.n; ++i)
151 {
152 // update tree path for the DOFIndices of the child
153 (*node._dof_indices)[child.offset+i].treeIndex().push_back(childIndex);
154 }
155 }
156
157 FillIndicesVisitor(const Entity& entity)
158 : e(entity)
159 {}
160
161 const Entity& e;
162 };
163
164 } // end empty namespace
165
166 //=======================================
167 // local function space base: base class
168 //=======================================
169
171 template<typename GFS, typename DI>
173 {
176
178 typedef GFS GridFunctionSpace;
179
181 typedef typename GFS::Traits::SizeType SizeType;
182
184 typedef typename std::vector<SizeType> IndexContainer;
185
187 typedef DI DOFIndex;
188
190 typedef typename std::vector<DI> DOFIndexContainer;
191
192 };
193
194 template <typename GFS, typename DOFIndex>
196 {
197 typedef typename GFS::Traits::Backend B;
198
199 template<typename>
201
202 template<typename,bool>
203 friend struct ComputeSizeVisitor;
204
205 template<typename,bool>
206 friend struct FillIndicesVisitor;
207
208 template<typename LFS, typename C, typename Tag, bool>
209 friend class LFSIndexCacheBase;
210
211 public:
213
215 LocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
216 : pgfs(gfs)
219 , n(0)
220 {}
221
223 typename Traits::IndexContainer::size_type size () const
224 {
225 return n;
226 }
227
228 std::size_t subSpaceDepth() const
229 {
230 return 0;
231 }
232
234 typename Traits::IndexContainer::size_type maxSize () const
235 {
236 // _dof_indices is always as large as the max local size of the root GFS
237 return _dof_indices->size();
238 }
239
241
247 typename Traits::IndexContainer::size_type localVectorSize () const
248 {
249 return _dof_indices->size();
250 }
251
253 typename Traits::IndexContainer::size_type localIndex (typename Traits::IndexContainer::size_type index) const
254 {
255 return offset+index;
256 }
257
259
266 const typename Traits::DOFIndex& dofIndex(typename Traits::IndexContainer::size_type index) const
267 {
268 return (*_dof_indices)[offset + index];
269 }
270
272 void debug () const
273 {
274 std::cout << n << " indices = (";
275 for (typename Traits::IndexContainer::size_type k=0; k<n; k++)
276 std::cout << (*_dof_indices)[localIndex(k)] << " ";
277 std::cout << ")" << std::endl;
278 }
279
281 const GFS& gridFunctionSpace() const
282 {
283 return *pgfs;
284 }
285
286 public:
287 template<typename NodeType>
288 void setup(NodeType& node)
289 {
290 _dof_index_storage.resize(gridFunctionSpace().ordering().maxLocalSize());
291 TypeTree::applyToTree(node,PropagateGlobalStorageVisitor<>());
292 }
293
294 std::shared_ptr<GFS const> pgfs;
297 typename Traits::IndexContainer::size_type n;
298 typename Traits::IndexContainer::size_type offset;
299 };
300
302 template<typename GFS, typename DOFIndex>
304 {
306 typedef typename GFS::Traits::GridViewType GridViewType;
307
309 typedef typename GFS::Traits::GridViewType GridView;
310
311 using EntitySet = typename GFS::Traits::EntitySet;
312
314 using Element = typename EntitySet::Element;
315 };
316
317 template <typename GFS, typename DOFIndex>
319 public LocalFunctionSpaceBaseNode<GFS,DOFIndex>
320 {
321 typedef typename GFS::Traits::Backend B;
323
324 public:
326
328 GridViewLocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
329 : BaseT(gfs)
330 {}
331
332 protected:
334
346 template<typename NodeType, bool fast = false>
347 void bind (NodeType& node, const typename Traits::Element& e, std::integral_constant<bool,fast> = std::integral_constant<bool,fast>{});
348 };
349
350 template <typename GFS, typename DOFIndex>
351 template <typename NodeType, bool fast>
354 std::integral_constant<bool,fast>)
355 {
357 assert(&node == this);
358
359 // compute sizes
360 ComputeSizeVisitor<Element,fast> csv(e);
361 TypeTree::applyToTree(node,csv);
362
363
364 // initialize iterators and fill indices
365 FillIndicesVisitor<Element,fast> fiv(e);
366 TypeTree::applyToTree(node,fiv);
367 }
368
369 //=======================================
370 // local function space base: power implementation
371 //=======================================
372
374 template<typename GFS, typename DOFIndex, typename N>
376 {
378 typedef N NodeType;
379 };
380
381 // local function space for a power grid function space
382 template<typename GFS, typename DOFIndex, typename ChildLFS, std::size_t k>
384 public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>,
385 public TypeTree::PowerNode<ChildLFS,k>
386 {
388 typedef TypeTree::PowerNode<ChildLFS,k> TreeNode;
389
390 template<typename>
392
393 template<typename>
394 friend struct ClearSizeVisitor;
395
396 template<typename,bool>
397 friend struct ComputeSizeVisitor;
398
399 template<typename,bool>
400 friend struct FillIndicesVisitor;
401
402 public:
404
406
408 template<typename Transformation>
409 PowerLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
410 const Transformation& t,
411 const std::array<std::shared_ptr<ChildLFS>,k>& children)
412 : BaseT(gfs)
413 , TreeNode(children)
414 {}
415
416 template<typename Transformation>
418 const Transformation& t,
419 const std::array<std::shared_ptr<ChildLFS>,k>& children)
420 : BaseT(stackobject_to_shared_ptr(gfs))
421 , TreeNode(children)
422 {}
423
425 template<bool fast = false>
426 void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
427 {
428 // call method on base class, this avoid the barton neckman trick
429 BaseT::bind(*this,e,fast_);
430 }
431
432 };
433
434
435 // transformation template, we need a custom template in order to inject the DOFIndex type into the LocalFunctionSpace
436 template<typename SourceNode, typename Transformation>
438 {
439 template<typename TC>
440 struct result
441 {
443 };
444 };
445
446 // register PowerGFS -> LocalFunctionSpace transformation
447 template<typename PowerGridFunctionSpace, typename Params>
448 TypeTree::TemplatizedGenericPowerNodeTransformation<
450 gfs_to_lfs<Params>,
452 >
454
455
456 //=======================================
457 // local function space base: composite implementation
458 //=======================================
459
460 // local function space for a power grid function space
461 template<typename GFS, typename DOFIndex, typename... Children>
463 : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
464 , public TypeTree::CompositeNode<Children...>
465 {
467 typedef TypeTree::CompositeNode<Children...> NodeType;
468
469 template<typename>
471
472 template<typename>
473 friend struct ClearSizeVisitor;
474
475 template<typename,bool>
476 friend struct ComputeSizeVisitor;
477
478 template<typename,bool>
479 friend struct FillIndicesVisitor;
480
481 public:
483
485
486 template<typename Transformation>
487 CompositeLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
488 const Transformation& t,
489 std::shared_ptr<Children>... children)
490 : BaseT(gfs)
491 , NodeType(children...)
492 {}
493
494 template<typename Transformation>
496 const Transformation& t,
497 std::shared_ptr<Children>... children)
498 : BaseT(stackobject_to_shared_ptr(gfs))
499 , NodeType(children...)
500 {}
501
503 template<bool fast = false>
504 void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
505 {
506 // call method on base class, this avoid the barton neckman trick
507 BaseT::bind(*this,e,fast_);
508 }
509
510 };
511
512 // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
513 template<typename SourceNode, typename Transformation>
515 {
516 template<typename... TC>
517 struct result
518 {
519 typedef CompositeLocalFunctionSpaceNode<SourceNode,typename Transformation::DOFIndex,TC...> type;
520 };
521 };
522
523 // register CompositeGFS -> LocalFunctionSpace transformation (variadic version)
524 template<typename CompositeGridFunctionSpace, typename Params>
525 TypeTree::TemplatizedGenericCompositeNodeTransformation<
527 gfs_to_lfs<Params>,
529 >
531
532
533 //=======================================
534 // local function space base: single component implementation
535 //=======================================
536
538 template<typename GFS, typename DOFIndex, typename N>
540 {
542 typedef typename GFS::Traits::FiniteElementType FiniteElementType;
543
544 typedef typename GFS::Traits::FiniteElementType FiniteElement;
545
547 typedef typename GFS::Traits::ConstraintsType ConstraintsType;
548
549 typedef typename GFS::Traits::ConstraintsType Constraints;
550
551 };
552
554 template<typename GFS, typename DOFIndex>
556 : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
557 , public TypeTree::LeafNode
558 {
560
561 template<typename>
563
564 template<typename>
565 friend struct ClearSizeVisitor;
566
567 template<typename,bool>
568 friend struct ComputeSizeVisitor;
569
570 template<typename,bool>
571 friend struct FillIndicesVisitor;
572
573 public:
575
577
578 private:
579 typedef FiniteElementInterfaceSwitch<
581 > FESwitch;
582
583 public:
584
586 template<typename Transformation>
587 LeafLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs, const Transformation& t)
588 : BaseT(gfs)
589 {
590 }
591
592 template<typename Transformation>
593 LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
594 : BaseT(stackobject_to_shared_ptr(gfs))
595 {
596 }
597
600 {
601 assert((_in_entity_set && pfe) &&
602 "Local function spaces outside their entity set should not "
603 "request `finiteElement()`. To check if function has support "
604 "use: `size()!= 0`");
605 assert(pfe);
606 return *pfe;
607 }
608
610 const typename Traits::ConstraintsType& constraints () const
611 {
612 return this->pgfs->constraints();
613 }
614
616 template<typename Entity, typename DOFIndexIterator, bool fast>
617 void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit, std::integral_constant<bool,fast>)
618 {
619 using EntitySet = typename GFS::Traits::EntitySet;
620 auto es = this->gridFunctionSpace().entitySet();
621
622 if (not es.contains(e))
623 return;
624 else if (fast) {
625 auto gt = e.type();
626 auto index = es.indexSet().index(e);
627 GFS::Ordering::Traits::DOFIndexAccessor::store(*it, gt, index, 0);
628 ++it;
629 } else {
630 // get layout of entity
631 const typename FESwitch::Coefficients &coeffs =
632 FESwitch::coefficients(*pfe);
633
634 auto refEl =
635 Dune::ReferenceElements<double, EntitySet::dimension>::general(
636 this->pfe->type());
637
638 for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it) {
639 // get geometry type of subentity
640 auto gt = refEl.type(coeffs.localKey(i).subEntity(),
641 coeffs.localKey(i).codim());
642
643 // evaluate consecutive index of subentity
644 auto index = es.indexSet().subIndex(
645 e, coeffs.localKey(i).subEntity(), coeffs.localKey(i).codim());
646
647 // store data
648 GFS::Ordering::Traits::DOFIndexAccessor::store(
649 *it, gt, index, coeffs.localKey(i).index());
650
651 // make sure we don't write past the end of the iterator range
652 assert(it != endit);
653 }
654 }
655 }
656
657
658 template<typename GC, typename LC>
659 void insert_constraints (const LC& lc, GC& gc) const
660 {
661 // LC and GC are maps of maps
662 typedef typename LC::const_iterator local_col_iterator;
663 typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
664 typedef typename GC::iterator global_col_iterator;
665 typedef typename GC::value_type::second_type global_row_type;
666
667 for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
668 {
669
670 // look up entry in global map, if not found, insert an empty one.
671 global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
672
673 // copy row to global container with transformed indices
674 for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
675 gcit->second[this->dofIndex(rit->first)] = rit->second;
676 }
677 }
678
680 template<bool fast = false>
681 void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
682 {
683 // call method on base class, this avoid the barton neckman trick
684 BaseT::bind(*this,e,fast_);
685 }
686
687 // private:
688 typename FESwitch::Store pfe;
689 private:
690 bool _in_entity_set;
691 };
692
693 // Register LeafGFS -> LocalFunctionSpace transformation
694 template<typename GridFunctionSpace, typename Params>
695 TypeTree::GenericLeafNodeTransformation<
697 gfs_to_lfs<Params>,
699 >
701
702 //=======================================
703 // local function facade
704 //=======================================
705
706 template <typename GFS, typename TAG=AnySpaceTag>
707 class LocalFunctionSpace;
708
722 template <typename GFS, typename TAG>
724 public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
725 {
726 typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
727 typedef typename BaseT::Traits::IndexContainer::size_type I;
728 typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
729
730 template<typename>
732
733 template<typename>
734 friend struct ClearSizeVisitor;
735
736 template<typename>
737 friend struct ComputeSizeVisitor;
738
739 template<typename>
740 friend struct FillIndicesVisitor;
741
742 public:
743 typedef typename BaseT::Traits Traits;
744
745 LocalFunctionSpace(const GFS & gfs)
746 : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
747 {
748 this->setup(*this);
749 }
750
752 : BaseT(lfs)
753 {
754 // We need to reset the DOFIndex storage pointers in the new LFS tree,
755 // as they are still pointing to the _dof_index_storage of the
756 // old tree.
757 this->_dof_indices = &(this->_dof_index_storage);
758 this->setup(*this);
759 }
760
761 LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
762 {
763 return LocalIndex(BaseT::localIndex(index));
764 }
765
766 private:
767 // we don't support getChild yet, so let's hide it!
768 template<int i>
769 void getChild () const;
770 template<int i>
771 void child () const;
772 };
773
774 // specialization for AnySpaceTag
775 // WARNING: If you modify this class, make sure to also fix the specialization in
776 // subspacelocalfunctionspace.hh!
777 template <typename GFS>
779 public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
780 {
781 typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
782
783 template<typename>
785
786 template<typename>
787 friend struct ClearSizeVisitor;
788
789 template<typename,bool>
790 friend struct ComputeSizeVisitor;
791
792 template<typename,bool>
793 friend struct FillIndicesVisitor;
794
795 public:
796
797 LocalFunctionSpace(const GFS & gfs)
798 : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
799 {
800 this->_dof_indices = &(this->_dof_index_storage);
801 this->setup(*this);
802 }
803
804 LocalFunctionSpace(std::shared_ptr<const GFS> pgfs)
805 : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
806 {
807 this->_dof_indices = &(this->_dof_index_storage);
808 this->setup(*this);
809 }
810
812 : BaseT(lfs)
813 {
814 // We need to reset the DOFIndex storage pointers in the new LFS tree,
815 // as they are still pointing to the _dof_index_storage of the
816 // old tree.
817 this->_dof_indices = &(this->_dof_index_storage);
818 this->setup(*this);
819 }
820
821 };
822
824 } // namespace PDELab
825} // namespace Dune
826
827#endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
std::size_t index
Definition: interpolate.hh:97
const std::size_t offset
Definition: localfunctionspace.hh:75
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Dune::TypeTree::GenericLeafNodeTransformation< LeafNode, GridFunctionToLocalViewTransformation, Imp::LocalGridViewFunctionAdapter< LeafNode > > registerNodeTransformation(LeafNode *l, GridFunctionToLocalViewTransformation *t, GridFunctionTag *tag)
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:148
base class for tuples of grid function spaces base class that holds implementation of the methods thi...
Definition: compositegridfunctionspace.hh:53
A grid function space.
Definition: gridfunctionspace.hh:191
Definition: lfsindexcache.hh:245
traits mapping global function space information to local function space
Definition: localfunctionspace.hh:173
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition: localfunctionspace.hh:178
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition: localfunctionspace.hh:184
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition: localfunctionspace.hh:181
GFS GridFunctionSpaceType
Type of the underlying grid function space.
Definition: localfunctionspace.hh:175
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition: localfunctionspace.hh:187
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition: localfunctionspace.hh:190
Definition: localfunctionspace.hh:196
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: localfunctionspace.hh:281
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:203
Traits::DOFIndexContainer _dof_index_storage
Definition: localfunctionspace.hh:295
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:212
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition: localfunctionspace.hh:247
Traits::IndexContainer::size_type n
Definition: localfunctionspace.hh:297
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:206
Traits::IndexContainer::size_type offset
Definition: localfunctionspace.hh:298
void debug() const
print debug information about this local function space
Definition: localfunctionspace.hh:272
Traits::DOFIndexContainer * _dof_indices
Definition: localfunctionspace.hh:296
Traits::IndexContainer::size_type maxSize() const
get maximum possible size (which is maxLocalSize from grid function space)
Definition: localfunctionspace.hh:234
Traits::IndexContainer::size_type localIndex(typename Traits::IndexContainer::size_type index) const
map index in this local function space to root local function space
Definition: localfunctionspace.hh:253
LocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:215
void setup(NodeType &node)
Definition: localfunctionspace.hh:288
std::shared_ptr< GFS const > pgfs
Definition: localfunctionspace.hh:294
Traits::IndexContainer::size_type size() const
number of degrees of freedom contained in this lfs node
Definition: localfunctionspace.hh:223
const Traits::DOFIndex & dofIndex(typename Traits::IndexContainer::size_type index) const
Maps given index in this local function space to its corresponding global MultiIndex.
Definition: localfunctionspace.hh:266
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:200
std::size_t subSpaceDepth() const
Definition: localfunctionspace.hh:228
traits for local function space on a gridview
Definition: localfunctionspace.hh:304
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:306
typename GFS::Traits::EntitySet EntitySet
Definition: localfunctionspace.hh:311
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:309
typename EntitySet::Element Element
Type of codim 0 entity in the grid.
Definition: localfunctionspace.hh:314
Definition: localfunctionspace.hh:320
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:325
void bind(NodeType &node, const typename Traits::Element &e, std::integral_constant< bool, fast >=std::integral_constant< bool, fast >{})
bind local function space to entity
GridViewLocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:328
traits for multi component local function space
Definition: localfunctionspace.hh:376
N NodeType
type of local function space node
Definition: localfunctionspace.hh:378
Definition: localfunctionspace.hh:386
PowerLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
initialize with grid function space
Definition: localfunctionspace.hh:409
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:397
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:394
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:400
PowerLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:405
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:403
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
Definition: localfunctionspace.hh:417
void bind(const typename Traits::Element &e, std::integral_constant< bool, fast > fast_=std::integral_constant< bool, fast >{})
bind local function space to entity
Definition: localfunctionspace.hh:426
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:391
Definition: localfunctionspace.hh:438
Definition: localfunctionspace.hh:441
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, TypeTree::StaticDegree< SourceNode >::value > type
Definition: localfunctionspace.hh:442
Definition: localfunctionspace.hh:465
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:495
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:476
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:473
void bind(const typename Traits::Element &e, std::integral_constant< bool, fast > fast_=std::integral_constant< bool, fast >{})
bind local function space to entity
Definition: localfunctionspace.hh:504
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:479
CompositeLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:487
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:482
CompositeLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:484
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:470
Definition: localfunctionspace.hh:515
Definition: localfunctionspace.hh:518
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC... > type
Definition: localfunctionspace.hh:519
traits for single component local function space
Definition: localfunctionspace.hh:540
GFS::Traits::FiniteElementType FiniteElement
Definition: localfunctionspace.hh:544
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition: localfunctionspace.hh:547
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition: localfunctionspace.hh:542
GFS::Traits::ConstraintsType Constraints
Definition: localfunctionspace.hh:549
single component local function space
Definition: localfunctionspace.hh:558
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition: localfunctionspace.hh:593
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition: localfunctionspace.hh:599
void dofIndices(const Entity &e, DOFIndexIterator it, DOFIndexIterator endit, std::integral_constant< bool, fast >)
Calculates the multiindices associated with the given entity.
Definition: localfunctionspace.hh:617
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:574
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:568
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:565
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:571
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition: localfunctionspace.hh:610
LeafLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition: localfunctionspace.hh:587
void insert_constraints(const LC &lc, GC &gc) const
Definition: localfunctionspace.hh:659
void bind(const typename Traits::Element &e, std::integral_constant< bool, fast > fast_=std::integral_constant< bool, fast >{})
bind local function space to entity
Definition: localfunctionspace.hh:681
LeafLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:576
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:562
FESwitch::Store pfe
Definition: localfunctionspace.hh:688
Create a local function space from a global function space.
Definition: localfunctionspace.hh:725
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:734
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:737
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition: localfunctionspace.hh:761
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:745
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:751
BaseT::Traits Traits
Definition: localfunctionspace.hh:743
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:740
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:731
LocalFunctionSpace(std::shared_ptr< const GFS > pgfs)
Definition: localfunctionspace.hh:804
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:797
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:811
Definition: localfunctionspacetags.hh:40
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:49
Definition: gridfunctionspace/tags.hh:26
Definition: gridfunctionspace/tags.hh:30
Definition: gridfunctionspace/tags.hh:32
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:194
Tag denoting a CompositeLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:197
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:200