dune-pdelab 2.9
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#include <memory>
8
11
13
16
18
21
22namespace Dune {
23 namespace PDELab {
24
28
29 //=======================================
30 // local function space base: metaprograms
31 //=======================================
32
33 namespace {
34
35 // the bogus template parameter is necessary to make GCC honor the friend declaration
36 // in the LocalFunctionSpace (probably a GCC bug)
37 template<typename = int>
38 struct PropagateGlobalStorageVisitor
39 : public TypeTree::TreeVisitor
40 , public TypeTree::DynamicTraversal
41 {
42
43 template<typename LFS, typename Child, typename TreePath, typename ChildIndex>
44 void beforeChild(const LFS& lfs, Child& child, TreePath treePath, ChildIndex childIndex) const
45 {
46 child._dof_indices = lfs._dof_indices;
47 }
48 };
49
50 // This visitor is not used in standard PDELab code, but is necessary for MultiDomain
51 // It is defined here due to the necessary friend declarations in the local function spaces.
52 // for template parameter see above
53 template<typename = int>
54 struct ClearSizeVisitor
55 : public TypeTree::TreeVisitor
56 , public TypeTree::DynamicTraversal
57 {
58
59 template<typename Node, typename TreePath>
60 void pre(Node& node, TreePath treePath)
61 {
62 leaf(node,treePath);
63 }
64
65 template<typename Node, typename TreePath>
66 void leaf(Node& node, TreePath treePath)
67 {
68 node.offset = offset;
69 node.n = 0;
70 }
71
72 ClearSizeVisitor(std::size_t offset_)
73 : offset(offset_)
74 {}
75
77
78 };
79
80
81 template<typename Entity, bool fast>
82 struct ComputeSizeVisitor
83 : public TypeTree::TreeVisitor
84 , public TypeTree::DynamicTraversal
85 {
86
87 template<typename Node, typename TreePath>
88 void pre(Node& node, TreePath treePath)
89 {
90 node.offset = offset;
91 }
92
93 template<typename Node, typename TreePath>
94 void post(Node& node, TreePath treePath)
95 {
96 node.n = offset - node.offset;
97 }
98
99 template<typename Node, typename TreePath>
100 void leaf(Node& node, TreePath treePath)
101 {
102 node.offset = offset;
103 node.unbindFiniteElement();
104 node._in_entity_set = node.pgfs->entitySet().contains(e);
105 if (not node._in_entity_set) {
106 node.n = 0;
107 } else if (fast) {
108 node.n = node.pgfs->finiteElementMap().maxLocalSize();
109 node.bindFiniteElement(node.pgfs->finiteElementMap().find(e));
110 } else {
111 node.bindFiniteElement(node.pgfs->finiteElementMap().find(e));
112 node.n = Node::FESwitch::basis(node.finiteElement()).size();
113 }
114 offset += node.n;
115 }
116
117 ComputeSizeVisitor(const Entity& entity, std::size_t offset_ = 0)
118 : e(entity)
119 , offset(offset_)
120 {}
121
122 const Entity& e;
124
125 };
126
127
128 template<typename Entity, bool fast>
129 struct FillIndicesVisitor
130 : public TypeTree::TreeVisitor
131 , public TypeTree::DynamicTraversal
132 {
133
134 template<typename Node, typename TreePath>
135 void leaf(Node& node, TreePath treePath)
136 {
137 // setup DOFIndices for this finite element
138 node.dofIndices(e,node._dof_indices->begin()+node.offset,node._dof_indices->begin()+node.offset+node.n,std::integral_constant<bool,fast>{});
139 }
140
141 template<typename Node, typename Child, typename TreePath, typename ChildIndex>
142 void afterChild(const Node& node, const Child& child, TreePath treePath, ChildIndex childIndex)
143 {
144 // Just skip the entire function space structure handling in fast mode
145 // This **really** breaks any attempt at using the DOFIndex for anything other
146 // than as input to the FastDGGridOperator machine.
147 // You have been warned!
148 if (not fast)
149 for (std::size_t i = 0; i<child.n; ++i)
150 {
151 // update tree path for the DOFIndices of the child
152 (*node._dof_indices)[child.offset+i].treeIndex().push_back(childIndex);
153 }
154 }
155
156 FillIndicesVisitor(const Entity& entity)
157 : e(entity)
158 {}
159
160 const Entity& e;
161 };
162
163 } // end empty namespace
164
165 //=======================================
166 // local function space base: base class
167 //=======================================
168
170 template<typename GFS, typename DI>
172 {
175
177 typedef GFS GridFunctionSpace;
178
180 typedef typename GFS::Traits::SizeType SizeType;
181
184
186 typedef DI DOFIndex;
187
190
191 };
192
193 template <typename GFS, typename DOFIndex>
195 {
196 typedef typename GFS::Traits::Backend B;
197
198 template<typename>
200
201 template<typename,bool>
202 friend struct ComputeSizeVisitor;
203
204 template<typename,bool>
205 friend struct FillIndicesVisitor;
206
207 template<typename LFS, typename C, typename Tag, bool>
208 friend class LFSIndexCacheBase;
209
210 public:
212
220
222 typename Traits::IndexContainer::size_type size () const
223 {
224 return n;
225 }
226
228 {
229 return 0;
230 }
231
233 typename Traits::IndexContainer::size_type maxSize () const
234 {
235 // _dof_indices is always as large as the max local size of the root GFS
236 return _dof_indices->size();
237 }
238
240
246 typename Traits::IndexContainer::size_type localVectorSize () const
247 {
248 return _dof_indices->size();
249 }
250
252 typename Traits::IndexContainer::size_type localIndex (typename Traits::IndexContainer::size_type index) const
253 {
254 return offset+index;
255 }
256
258
265 const typename Traits::DOFIndex& dofIndex(typename Traits::IndexContainer::size_type index) const
266 {
267 return (*_dof_indices)[offset + index];
268 }
269
271 void debug () const
272 {
273 std::cout << n << " indices = (";
274 for (typename Traits::IndexContainer::size_type k=0; k<n; k++)
275 std::cout << (*_dof_indices)[localIndex(k)] << " ";
276 std::cout << ")" << std::endl;
277 }
278
280 const GFS& gridFunctionSpace() const
281 {
282 return *pgfs;
283 }
284
285 public:
286 template<typename NodeType>
287 void setup(NodeType& node)
288 {
289 _dof_index_storage.resize(gridFunctionSpace().ordering().maxLocalSize());
290 TypeTree::applyToTree(node,PropagateGlobalStorageVisitor<>());
291 }
292
296 typename Traits::IndexContainer::size_type n;
297 typename Traits::IndexContainer::size_type offset;
298 };
299
301 template<typename GFS, typename DOFIndex>
303 {
305 typedef typename GFS::Traits::GridViewType GridViewType;
306
308 typedef typename GFS::Traits::GridViewType GridView;
309
310 using EntitySet = typename GFS::Traits::EntitySet;
311
313 using Element = typename EntitySet::Element;
314 };
315
316 template <typename GFS, typename DOFIndex>
318 public LocalFunctionSpaceBaseNode<GFS,DOFIndex>
319 {
320 typedef typename GFS::Traits::Backend B;
322
323 public:
325
330
331 protected:
333
345 template<typename NodeType, bool fast = false>
347 };
348
349 template <typename GFS, typename DOFIndex>
350 template <typename NodeType, bool fast>
354 {
356 assert(&node == this);
357
358 // compute sizes
359 ComputeSizeVisitor<Element,fast> csv(e);
360 TypeTree::applyToTree(node,csv);
361
362
363 // initialize iterators and fill indices
364 FillIndicesVisitor<Element,fast> fiv(e);
365 TypeTree::applyToTree(node,fiv);
366 }
367
368 //=======================================
369 // local function space base: power implementation
370 //=======================================
371
373 template<typename GFS, typename DOFIndex, typename N>
379
380 // local function space for a power grid function space
381 template<typename GFS, typename DOFIndex, typename ChildLFS, std::size_t k>
383 public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>,
384 public TypeTree::PowerNode<ChildLFS,k>
385 {
388
389 template<typename>
391
392 template<typename>
393 friend struct ClearSizeVisitor;
394
395 template<typename,bool>
396 friend struct ComputeSizeVisitor;
397
398 template<typename,bool>
399 friend struct FillIndicesVisitor;
400
401 public:
403
405
407 template<typename Transformation>
409 const Transformation& t,
410 const std::array<std::shared_ptr<ChildLFS>,k>& children)
411 : BaseT(gfs)
412 , TreeNode(children)
413 {}
414
415 template<typename Transformation>
417 const Transformation& t,
418 const std::array<std::shared_ptr<ChildLFS>,k>& children)
420 , TreeNode(children)
421 {}
422
424 template<bool fast = false>
426 {
427 // call method on base class, this avoid the barton neckman trick
428 BaseT::bind(*this,e,fast_);
429 }
430
431 };
432
433
434 // transformation template, we need a custom template in order to inject the DOFIndex type into the LocalFunctionSpace
435 template<typename SourceNode, typename Transformation>
444
445 // register PowerGFS -> LocalFunctionSpace transformation
446 template<typename PowerGridFunctionSpace, typename Params>
449 gfs_to_lfs<Params>,
451 >
453
454
455 //=======================================
456 // local function space base: composite implementation
457 //=======================================
458
459 // local function space for a power grid function space
460 template<typename GFS, typename DOFIndex, typename... Children>
462 : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
463 , public TypeTree::CompositeNode<Children...>
464 {
466 typedef TypeTree::CompositeNode<Children...> NodeType;
467
468 template<typename>
470
471 template<typename>
472 friend struct ClearSizeVisitor;
473
474 template<typename,bool>
475 friend struct ComputeSizeVisitor;
476
477 template<typename,bool>
478 friend struct FillIndicesVisitor;
479
480 public:
482
484
485 template<typename Transformation>
487 const Transformation& t,
488 std::shared_ptr<Children>... children)
489 : BaseT(gfs)
490 , NodeType(children...)
491 {}
492
493 template<typename Transformation>
495 const Transformation& t,
496 std::shared_ptr<Children>... children)
498 , NodeType(children...)
499 {}
500
502 template<bool fast = false>
504 {
505 // call method on base class, this avoid the barton neckman trick
506 BaseT::bind(*this,e,fast_);
507 }
508
509 };
510
511 // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
512 template<typename SourceNode, typename Transformation>
514 {
515 template<typename... TC>
516 struct result
517 {
518 typedef CompositeLocalFunctionSpaceNode<SourceNode,typename Transformation::DOFIndex,TC...> type;
519 };
520 };
521
522 // register CompositeGFS -> LocalFunctionSpace transformation (variadic version)
523 template<typename CompositeGridFunctionSpace, typename Params>
526 gfs_to_lfs<Params>,
528 >
530
531
532 //=======================================
533 // local function space base: single component implementation
534 //=======================================
535
537 template<typename GFS, typename DOFIndex, typename N>
539 {
541 typedef typename GFS::Traits::FiniteElementType FiniteElementType;
542
543 typedef typename GFS::Traits::FiniteElementType FiniteElement;
544
546 typedef typename GFS::Traits::ConstraintsType ConstraintsType;
547
548 typedef typename GFS::Traits::ConstraintsType Constraints;
549
550 };
551
553 template<typename GFS, typename DOFIndex>
555 : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
556 , public TypeTree::LeafNode
557 {
559
560 template<typename>
562
563 template<typename>
564 friend struct ClearSizeVisitor;
565
566 template<typename,bool>
567 friend struct ComputeSizeVisitor;
568
569 template<typename,bool>
570 friend struct FillIndicesVisitor;
571
572 public:
574
576
577 private:
580 > FESwitch;
581
582 public:
583
585 template<typename Transformation>
587 : BaseT(gfs)
588 {
589 }
590
591 template<typename Transformation>
592 LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
594 {
595 }
596
599 {
600 assert((_in_entity_set && pfe) &&
601 "Local function spaces outside their entity set should not "
602 "request `finiteElement()`. To check if function has support "
603 "use: `size()!= 0`");
604 assert(pfe);
605 return *pfe;
606 }
607
609 const typename Traits::ConstraintsType& constraints () const
610 {
611 return this->pgfs->constraints();
612 }
613
615 template<typename Entity, typename DOFIndexIterator, bool fast>
616 void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit, std::integral_constant<bool,fast>)
617 {
618 using EntitySet = typename GFS::Traits::EntitySet;
619 auto es = this->gridFunctionSpace().entitySet();
620
621 if (not es.contains(e))
622 return;
623 else if (fast) {
624 auto gt = e.type();
625 auto index = es.indexSet().index(e);
626 GFS::Ordering::Traits::DOFIndexAccessor::store(*it, gt, index, 0);
627 ++it;
628 } else {
629 // get layout of entity
630 const typename FESwitch::Coefficients &coeffs =
632
633 auto refEl =
634 Dune::ReferenceElements<double, EntitySet::dimension>::general(
635 this->pfe->type());
636
637 for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it) {
638 // get geometry type of subentity
639 auto gt = refEl.type(coeffs.localKey(i).subEntity(),
640 coeffs.localKey(i).codim());
641
642 // evaluate consecutive index of subentity
643 auto index = es.indexSet().subIndex(
644 e, coeffs.localKey(i).subEntity(), coeffs.localKey(i).codim());
645
646 // store data
647 GFS::Ordering::Traits::DOFIndexAccessor::store(
648 *it, gt, index, coeffs.localKey(i).index());
649
650 // make sure we don't write past the end of the iterator range
651 assert(it != endit);
652 }
653 }
654 }
655
656
657 template<typename GC, typename LC>
658 void insert_constraints (const LC& lc, GC& gc) const
659 {
660 // LC and GC are maps of maps
661 typedef typename LC::const_iterator local_col_iterator;
662 typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
663 typedef typename GC::iterator global_col_iterator;
664 typedef typename GC::value_type::second_type global_row_type;
665
666 for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
667 {
668
669 // look up entry in global map, if not found, insert an empty one.
670 global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
671
672 // copy row to global container with transformed indices
673 for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
674 gcit->second[this->dofIndex(rit->first)] = rit->second;
675 }
676 }
677
679 template<bool fast = false>
681 {
682 // call method on base class, this avoid the barton neckman trick
683 BaseT::bind(*this,e,fast_);
684 }
685
695 template<class FE>
696 void bindFiniteElement(FE&& fe) {
697 static_assert(std::is_same_v<std::decay_t<FE>, typename Traits::FiniteElementType>);
698 if constexpr (std::is_rvalue_reference_v<FE&&>) {
699 static_assert(std::is_move_constructible_v<FE>);
700 static_assert(std::is_move_assignable_v<FE>);
701 if (spe)
702 (*spe) = std::move(fe);
703 else
704 spe = std::make_shared<typename Traits::FiniteElementType>(std::move(fe));
705 pfe = spe.get();
706 } else {
707 pfe = &fe;
708 }
709 }
710
712 void unbindFiniteElement() noexcept {
713 pfe = nullptr;
714 }
715
716 private:
717 const typename Traits::FiniteElementType * pfe;
719 bool _in_entity_set;
720 };
721
722 // Register LeafGFS -> LocalFunctionSpace transformation
723 template<typename GridFunctionSpace, typename Params>
725 GridFunctionSpace,
726 gfs_to_lfs<Params>,
727 LeafLocalFunctionSpaceNode<GridFunctionSpace,typename gfs_to_lfs<Params>::DOFIndex>
728 >
730
731 //=======================================
732 // local function facade
733 //=======================================
734
735 template <typename GFS, typename TAG=AnySpaceTag>
736 class LocalFunctionSpace;
737
751 template <typename GFS, typename TAG>
753 public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
754 {
755 typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
756 typedef typename BaseT::Traits::IndexContainer::size_type I;
757 typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
758
759 template<typename>
761
762 template<typename>
763 friend struct ClearSizeVisitor;
764
765 template<typename>
766 friend struct ComputeSizeVisitor;
767
768 template<typename>
769 friend struct FillIndicesVisitor;
770
771 public:
772 typedef typename BaseT::Traits Traits;
773
774 LocalFunctionSpace(const GFS & gfs)
775 : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
776 {
777 this->setup(*this);
778 }
779
781 : BaseT(lfs)
782 {
783 // We need to reset the DOFIndex storage pointers in the new LFS tree,
784 // as they are still pointing to the _dof_index_storage of the
785 // old tree.
786 this->_dof_indices = &(this->_dof_index_storage);
787 this->setup(*this);
788 }
789
790 LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
791 {
792 return LocalIndex(BaseT::localIndex(index));
793 }
794
795 private:
796 // we don't support getChild yet, so let's hide it!
797 template<int i>
798 void getChild () const;
799 template<int i>
800 void child () const;
801 };
802
803 // specialization for AnySpaceTag
804 // WARNING: If you modify this class, make sure to also fix the specialization in
805 // subspacelocalfunctionspace.hh!
806 template <typename GFS>
808 public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
809 {
810 typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
811
812 template<typename>
814
815 template<typename>
816 friend struct ClearSizeVisitor;
817
818 template<typename,bool>
819 friend struct ComputeSizeVisitor;
820
821 template<typename,bool>
822 friend struct FillIndicesVisitor;
823
824 public:
825
826 LocalFunctionSpace(const GFS & gfs)
827 : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
828 {
829 this->_dof_indices = &(this->_dof_index_storage);
830 this->setup(*this);
831 }
832
834 : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
835 {
836 this->_dof_indices = &(this->_dof_index_storage);
837 this->setup(*this);
838 }
839
841 : BaseT(lfs)
842 {
843 // We need to reset the DOFIndex storage pointers in the new LFS tree,
844 // as they are still pointing to the _dof_index_storage of the
845 // old tree.
846 this->_dof_indices = &(this->_dof_index_storage);
847 this->setup(*this);
848 }
849
850 };
851
853 } // namespace PDELab
854} // namespace Dune
855
856#endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
void applyToTree(Tree &&tree, Visitor &&visitor)
ImplementationDefined child(Node &&node, Indices... indices)
constexpr HybridTreePath< T... > treePath(const T &... t)
HybridTreePath< Dune::index_constant< i >... > TreePath
void pre(Domain &x, Range &b)
void post(Domain &x)
iterator end()
static constexpr size_type N()
std::shared_ptr< T > stackobject_to_shared_ptr(T &t)
std::size_t index
Definition interpolate.hh:97
const std::size_t offset
Definition localfunctionspace.hh:76
Dune::TypeTree::GenericLeafNodeTransformation< LeafNode, GridFunctionToLocalViewTransformation, Imp::LocalGridViewFunctionAdapter< LeafNode > > registerNodeTransformation(LeafNode *l, GridFunctionToLocalViewTransformation *t, GridFunctionTag *tag)
For backward compatibility – Do not use this!
static const Coefficients & coefficients(const FiniteElement &fe)
FiniteElement::Traits::Coefficients Coefficients
GridImp::template Codim< cd >::Entity Entity
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:172
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition localfunctionspace.hh:177
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition localfunctionspace.hh:183
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition localfunctionspace.hh:180
GFS GridFunctionSpaceType
Type of the underlying grid function space.
Definition localfunctionspace.hh:174
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition localfunctionspace.hh:186
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition localfunctionspace.hh:189
Definition localfunctionspace.hh:195
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition localfunctionspace.hh:280
friend struct ComputeSizeVisitor
Definition localfunctionspace.hh:202
Traits::DOFIndexContainer _dof_index_storage
Definition localfunctionspace.hh:294
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition localfunctionspace.hh:211
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition localfunctionspace.hh:246
Traits::IndexContainer::size_type n
Definition localfunctionspace.hh:296
friend struct FillIndicesVisitor
Definition localfunctionspace.hh:205
Traits::IndexContainer::size_type offset
Definition localfunctionspace.hh:297
void debug() const
print debug information about this local function space
Definition localfunctionspace.hh:271
Traits::DOFIndexContainer * _dof_indices
Definition localfunctionspace.hh:295
Traits::IndexContainer::size_type maxSize() const
get maximum possible size (which is maxLocalSize from grid function space)
Definition localfunctionspace.hh:233
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:252
LocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition localfunctionspace.hh:214
void setup(NodeType &node)
Definition localfunctionspace.hh:287
std::shared_ptr< GFS const > pgfs
Definition localfunctionspace.hh:293
Traits::IndexContainer::size_type size() const
number of degrees of freedom contained in this lfs node
Definition localfunctionspace.hh:222
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:265
friend struct PropagateGlobalStorageVisitor
Definition localfunctionspace.hh:199
std::size_t subSpaceDepth() const
Definition localfunctionspace.hh:227
traits for local function space on a gridview
Definition localfunctionspace.hh:303
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition localfunctionspace.hh:305
typename GFS::Traits::EntitySet EntitySet
Definition localfunctionspace.hh:310
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition localfunctionspace.hh:308
typename EntitySet::Element Element
Type of codim 0 entity in the grid.
Definition localfunctionspace.hh:313
Definition localfunctionspace.hh:319
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition localfunctionspace.hh:324
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:327
traits for multi component local function space
Definition localfunctionspace.hh:375
N NodeType
type of local function space node
Definition localfunctionspace.hh:377
Definition localfunctionspace.hh:385
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:408
friend struct ComputeSizeVisitor
Definition localfunctionspace.hh:396
friend struct ClearSizeVisitor
Definition localfunctionspace.hh:393
friend struct FillIndicesVisitor
Definition localfunctionspace.hh:399
PowerLocalFunctionSpaceTag ImplementationTag
Definition localfunctionspace.hh:404
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition localfunctionspace.hh:402
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
Definition localfunctionspace.hh:416
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:425
friend struct PropagateGlobalStorageVisitor
Definition localfunctionspace.hh:390
Definition localfunctionspace.hh:437
Definition localfunctionspace.hh:440
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, TypeTree::StaticDegree< SourceNode >::value > type
Definition localfunctionspace.hh:441
Definition localfunctionspace.hh:464
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition localfunctionspace.hh:494
friend struct ComputeSizeVisitor
Definition localfunctionspace.hh:475
friend struct ClearSizeVisitor
Definition localfunctionspace.hh:472
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:503
friend struct FillIndicesVisitor
Definition localfunctionspace.hh:478
CompositeLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition localfunctionspace.hh:486
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition localfunctionspace.hh:481
CompositeLocalFunctionSpaceTag ImplementationTag
Definition localfunctionspace.hh:483
friend struct PropagateGlobalStorageVisitor
Definition localfunctionspace.hh:469
Definition localfunctionspace.hh:514
Definition localfunctionspace.hh:517
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC... > type
Definition localfunctionspace.hh:518
traits for single component local function space
Definition localfunctionspace.hh:539
GFS::Traits::FiniteElementType FiniteElement
Definition localfunctionspace.hh:543
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition localfunctionspace.hh:546
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition localfunctionspace.hh:541
GFS::Traits::ConstraintsType Constraints
Definition localfunctionspace.hh:548
single component local function space
Definition localfunctionspace.hh:557
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition localfunctionspace.hh:592
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition localfunctionspace.hh:598
void unbindFiniteElement() noexcept
Release view of the bound finite element.
Definition localfunctionspace.hh:712
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:616
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition localfunctionspace.hh:573
friend struct ComputeSizeVisitor
Definition localfunctionspace.hh:567
friend struct ClearSizeVisitor
Definition localfunctionspace.hh:564
friend struct FillIndicesVisitor
Definition localfunctionspace.hh:570
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition localfunctionspace.hh:609
LeafLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition localfunctionspace.hh:586
void insert_constraints(const LC &lc, GC &gc) const
Definition localfunctionspace.hh:658
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:680
void bindFiniteElement(FE &&fe)
Binds a finite element to the local space If the finite element is lvalue, the caller (i....
Definition localfunctionspace.hh:696
LeafLocalFunctionSpaceTag ImplementationTag
Definition localfunctionspace.hh:575
friend struct PropagateGlobalStorageVisitor
Definition localfunctionspace.hh:561
Create a local function space from a global function space.
Definition localfunctionspace.hh:754
friend struct ClearSizeVisitor
Definition localfunctionspace.hh:763
friend struct ComputeSizeVisitor
Definition localfunctionspace.hh:766
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition localfunctionspace.hh:790
LocalFunctionSpace(const GFS &gfs)
Definition localfunctionspace.hh:774
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition localfunctionspace.hh:780
BaseT::Traits Traits
Definition localfunctionspace.hh:772
friend struct FillIndicesVisitor
Definition localfunctionspace.hh:769
friend struct PropagateGlobalStorageVisitor
Definition localfunctionspace.hh:760
LocalFunctionSpace(std::shared_ptr< const GFS > pgfs)
Definition localfunctionspace.hh:833
LocalFunctionSpace(const GFS &gfs)
Definition localfunctionspace.hh:826
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition localfunctionspace.hh:840
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
T endl(T... args)
T get(T... args)
T make_pair(T... args)
T ref(T... args)
T resize(T... args)
T size(T... args)