dune-pdelab  2.4-dev
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_LOCALFUNCTIONSPACE_HH
4 #define DUNE_PDELAB_LOCALFUNCTIONSPACE_HH
5 
6 #include<vector>
7 
8 #include <dune/common/stdstreams.hh>
9 
10 #include <dune/geometry/referenceelements.hh>
11 
12 #include <dune/localfunctions/common/interfaceswitch.hh>
13 #include <dune/localfunctions/common/localkey.hh>
14 
15 #include <dune/typetree/typetree.hh>
16 
19 
20 namespace Dune {
21  namespace PDELab {
22 
26 
27  //=======================================
28  // local function space base: metaprograms
29  //=======================================
30 
31  namespace {
32 
33  // the bogus template parameter is necessary to make GCC honor the friend declaration
34  // in the LocalFunctionSpace (probably a GCC bug)
35  template<typename = int>
36  struct PropagateGlobalStorageVisitor
37  : public TypeTree::TreeVisitor
38  , public TypeTree::DynamicTraversal
39  {
40 
41  template<typename LFS, typename Child, typename TreePath, typename ChildIndex>
42  void beforeChild(const LFS& lfs, Child& child, TreePath treePath, ChildIndex childIndex) const
43  {
44  child._dof_indices = lfs._dof_indices;
45  }
46  };
47 
48  // This visitor is not used in standard PDELab code, but is necessary for MultiDomain
49  // It is defined here due to the necessary friend declarations in the local function spaces.
50  // for template parameter see above
51  template<typename = int>
52  struct ClearSizeVisitor
53  : public TypeTree::TreeVisitor
54  , public TypeTree::DynamicTraversal
55  {
56 
57  template<typename Node, typename TreePath>
58  void pre(Node& node, TreePath treePath)
59  {
60  leaf(node,treePath);
61  }
62 
63  template<typename Node, typename TreePath>
64  void leaf(Node& node, TreePath treePath)
65  {
66  node.offset = offset;
67  node.n = 0;
68  }
69 
70  ClearSizeVisitor(std::size_t offset_)
71  : offset(offset_)
72  {}
73 
74  const std::size_t offset;
75 
76  };
77 
78 
79  template<typename Entity>
80  struct ComputeSizeVisitor
81  : public TypeTree::TreeVisitor
82  , public TypeTree::DynamicTraversal
83  {
84 
85  template<typename Node, typename TreePath>
86  void pre(Node& node, TreePath treePath)
87  {
88  node.offset = offset;
89  }
90 
91  template<typename Node, typename TreePath>
92  void post(Node& node, TreePath treePath)
93  {
94  node.n = offset - node.offset;
95  }
96 
97  template<typename Node, typename TreePath>
98  void leaf(Node& node, TreePath treePath)
99  {
100  node.offset = offset;
101  Node::FESwitch::setStore(node.pfe, node.pgfs->finiteElementMap().find(e));
102  node.n = Node::FESwitch::basis(*node.pfe).size();
103  offset += node.n;
104  }
105 
106  ComputeSizeVisitor(const Entity& entity, std::size_t offset_ = 0)
107  : e(entity)
108  , offset(offset_)
109  {}
110 
111  const Entity& e;
112  std::size_t offset;
113 
114  };
115 
116 
117  template<typename Entity>
118  struct FillIndicesVisitor
119  : public TypeTree::TreeVisitor
120  , public TypeTree::DynamicTraversal
121  {
122 
123  template<typename Node, typename TreePath>
124  void leaf(Node& node, TreePath treePath)
125  {
126  // setup DOFIndices for this finite element
127  node.dofIndices(e,node._dof_indices->begin()+node.offset,node._dof_indices->begin()+node.offset+node.n);
128  }
129 
130  template<typename Node, typename Child, typename TreePath, typename ChildIndex>
131  void afterChild(const Node& node, const Child& child, TreePath treePath, ChildIndex childIndex)
132  {
133  for (std::size_t i = 0; i<child.n; ++i)
134  {
135  // update tree path for the DOFIndices of the child
136  (*node._dof_indices)[child.offset+i].treeIndex().push_back(childIndex);
137  }
138  }
139 
140  FillIndicesVisitor(const Entity& entity)
141  : e(entity)
142  {}
143 
144  const Entity& e;
145  };
146 
147  } // end empty namespace
148 
149  //=======================================
150  // local function space base: base class
151  //=======================================
152 
154  template<typename GFS, typename DI>
156  {
159 
161  typedef GFS GridFunctionSpace;
162 
164  typedef typename GFS::Traits::SizeType SizeType;
165 
167  typedef typename std::vector<SizeType> IndexContainer;
168 
170  typedef DI DOFIndex;
171 
173  typedef typename std::vector<DI> DOFIndexContainer;
174 
175  };
176 
177  template <typename GFS, typename DOFIndex>
179  {
180  typedef typename GFS::Traits::Backend B;
181 
182  template<typename>
184 
185  template<typename>
186  friend struct ComputeSizeVisitor;
187 
188  template<typename>
189  friend struct FillIndicesVisitor;
190 
191  template<typename LFS, typename C, typename Tag>
192  friend class LFSIndexCacheBase;
193 
194  public:
196 
198  LocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
199  : pgfs(gfs)
202  , n(0)
203  {}
204 
206  typename Traits::IndexContainer::size_type size () const
207  {
208  return n;
209  }
210 
211  std::size_t subSpaceDepth() const
212  {
213  return 0;
214  }
215 
217  typename Traits::IndexContainer::size_type maxSize () const
218  {
219  // _dof_indices is always as large as the max local size of the root GFS
220  return _dof_indices->size();
221  }
222 
224 
230  typename Traits::IndexContainer::size_type localVectorSize () const
231  {
232  return _dof_indices->size();
233  }
234 
236  typename Traits::IndexContainer::size_type localIndex (typename Traits::IndexContainer::size_type index) const
237  {
238  return offset+index;
239  }
240 
242 
249  const typename Traits::DOFIndex& dofIndex(typename Traits::IndexContainer::size_type index) const
250  {
251  return (*_dof_indices)[offset + index];
252  }
253 
255  void debug () const
256  {
257  std::cout << n << " indices = (";
258  for (typename Traits::IndexContainer::size_type k=0; k<n; k++)
259  std::cout << (*_dof_indices)[localIndex(k)] << " ";
260  std::cout << ")" << std::endl;
261  }
262 
264  const GFS& gridFunctionSpace() const
265  {
266  return *pgfs;
267  }
268 
269  public:
270  template<typename NodeType>
271  void setup(NodeType& node)
272  {
273  _dof_index_storage.resize(gridFunctionSpace().ordering().maxLocalSize());
274  TypeTree::applyToTree(node,PropagateGlobalStorageVisitor<>());
275  }
276 
277  std::shared_ptr<GFS const> pgfs;
280  typename Traits::IndexContainer::size_type n;
281  typename Traits::IndexContainer::size_type offset;
282  };
283 
285  template<typename GFS, typename DOFIndex>
287  {
289  typedef typename GFS::Traits::GridViewType GridViewType;
290 
292  typedef typename GFS::Traits::GridViewType GridView;
293 
295  typedef typename GridViewType::Traits::template Codim<0>::Entity Element;
296  };
297 
298  template <typename GFS, typename DOFIndex>
300  public LocalFunctionSpaceBaseNode<GFS,DOFIndex>
301  {
302  typedef typename GFS::Traits::Backend B;
304 
305  public:
307 
309  GridViewLocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
310  : BaseT(gfs)
311  {}
312 
313  protected:
315 
327  template<typename NodeType>
328  void bind (NodeType& node, const typename Traits::Element& e);
329  };
330 
331  template <typename GFS, typename DOFIndex>
332  template <typename NodeType>
335  {
337  assert(&node == this);
338 
339  // compute sizes
340  ComputeSizeVisitor<Element> csv(e);
341  TypeTree::applyToTree(node,csv);
342 
343 
344  // initialize iterators and fill indices
345  FillIndicesVisitor<Element> fiv(e);
346  TypeTree::applyToTree(node,fiv);
347  }
348 
349  //=======================================
350  // local function space base: power implementation
351  //=======================================
352 
354  template<typename GFS, typename DOFIndex, typename N>
356  {
358  typedef N NodeType;
359  };
360 
361  // local function space for a power grid function space
362  template<typename GFS, typename DOFIndex, typename ChildLFS, std::size_t k>
364  public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>,
365  public TypeTree::PowerNode<ChildLFS,k>
366  {
368  typedef TypeTree::PowerNode<ChildLFS,k> TreeNode;
369 
370  template<typename>
372 
373  template<typename>
374  friend struct ClearSizeVisitor;
375 
376  template<typename>
377  friend struct ComputeSizeVisitor;
378 
379  template<typename>
380  friend struct FillIndicesVisitor;
381 
382  public:
384 
386 
388  template<typename Transformation>
389  PowerLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
390  const Transformation& t,
391  const std::array<std::shared_ptr<ChildLFS>,k>& children)
392  : BaseT(gfs)
393  , TreeNode(children)
394  {}
395 
396  template<typename Transformation>
398  const Transformation& t,
399  const std::array<std::shared_ptr<ChildLFS>,k>& children)
400  : BaseT(stackobject_to_shared_ptr(gfs))
401  , TreeNode(children)
402  {}
403 
405  void bind (const typename Traits::Element& e)
406  {
407  // call method on base class, this avoid the barton neckman trick
408  BaseT::bind(*this,e);
409  }
410 
411  };
412 
413 
414  // transformation template, we need a custom template in order to inject the DOFIndex type into the LocalFunctionSpace
415  template<typename SourceNode, typename Transformation>
417  {
418  template<typename TC>
419  struct result
420  {
422  };
423  };
424 
425  // register PowerGFS -> LocalFunctionSpace transformation
426  template<typename PowerGridFunctionSpace, typename Params>
427  TypeTree::TemplatizedGenericPowerNodeTransformation<
429  gfs_to_lfs<Params>,
431  >
432  registerNodeTransformation(PowerGridFunctionSpace* pgfs, gfs_to_lfs<Params>* t, PowerGridFunctionSpaceTag* tag);
433 
434 
435  //=======================================
436  // local function space base: composite implementation
437  //=======================================
438 
439  // local function space for a power grid function space
440  template<typename GFS, typename DOFIndex, typename... Children>
442  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
443  , public TypeTree::CompositeNode<Children...>
444  {
446  typedef TypeTree::CompositeNode<Children...> NodeType;
447 
448  template<typename>
450 
451  template<typename>
452  friend struct ClearSizeVisitor;
453 
454  template<typename>
455  friend struct ComputeSizeVisitor;
456 
457  template<typename>
458  friend struct FillIndicesVisitor;
459 
460  public:
462 
464 
465  template<typename Transformation>
466  CompositeLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
467  const Transformation& t,
468  std::shared_ptr<Children>... children)
469  : BaseT(gfs)
470  , NodeType(children...)
471  {}
472 
473  template<typename Transformation>
475  const Transformation& t,
476  std::shared_ptr<Children>... children)
477  : BaseT(stackobject_to_shared_ptr(gfs))
478  , NodeType(children...)
479  {}
480 
482  void bind (const typename Traits::Element& e)
483  {
484  // call method on base class, this avoid the barton neckman trick
485  BaseT::bind(*this,e);
486  }
487 
488  };
489 
490  // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
491  template<typename SourceNode, typename Transformation>
493  {
494  template<typename... TC>
495  struct result
496  {
497  typedef CompositeLocalFunctionSpaceNode<SourceNode,typename Transformation::DOFIndex,TC...> type;
498  };
499  };
500 
501  // register CompositeGFS -> LocalFunctionSpace transformation (variadic version)
502  template<typename CompositeGridFunctionSpace, typename Params>
503  TypeTree::TemplatizedGenericCompositeNodeTransformation<
505  gfs_to_lfs<Params>,
507  >
508  registerNodeTransformation(CompositeGridFunctionSpace* cgfs, gfs_to_lfs<Params>* t, CompositeGridFunctionSpaceTag* tag);
509 
510 
511  //=======================================
512  // local function space base: single component implementation
513  //=======================================
514 
516  template<typename GFS, typename DOFIndex, typename N>
518  {
520  typedef typename GFS::Traits::FiniteElementType FiniteElementType;
521 
522  typedef typename GFS::Traits::FiniteElementType FiniteElement;
523 
525  typedef typename GFS::Traits::ConstraintsType ConstraintsType;
526 
527  typedef typename GFS::Traits::ConstraintsType Constraints;
528 
529  };
530 
532  template<typename GFS, typename DOFIndex>
534  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
535  , public TypeTree::LeafNode
536  {
538 
539  template<typename>
541 
542  template<typename>
543  friend struct ClearSizeVisitor;
544 
545  template<typename>
546  friend struct ComputeSizeVisitor;
547 
548  template<typename>
549  friend struct FillIndicesVisitor;
550 
551  public:
553 
555 
556  private:
557  typedef FiniteElementInterfaceSwitch<
559  > FESwitch;
560 
561  public:
562 
564  template<typename Transformation>
565  LeafLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs, const Transformation& t)
566  : BaseT(gfs)
567  {
568  }
569 
570  template<typename Transformation>
571  LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
572  : BaseT(stackobject_to_shared_ptr(gfs))
573  {
574  }
575 
577  const typename Traits::FiniteElementType& finiteElement () const
578  {
579  return *pfe;
580  }
581 
583  const typename Traits::ConstraintsType& constraints () const
584  {
585  return this->pgfs->constraints();
586  }
587 
589  template<typename Entity, typename DOFIndexIterator>
590  void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit)
591  {
592  // get layout of entity
593  const typename FESwitch::Coefficients &coeffs =
594  FESwitch::coefficients(*pfe);
595 
596  typedef typename GFS::Traits::GridViewType GV;
597  GV gv = this->gridFunctionSpace().gridView();
598 
599  const Dune::ReferenceElement<double,GV::Grid::dimension>& refEl =
600  Dune::ReferenceElements<double,GV::Grid::dimension>::general(this->pfe->type());
601 
602  for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it)
603  {
604  // get geometry type of subentity
605  Dune::GeometryType gt = refEl.type(coeffs.localKey(i).subEntity(),
606  coeffs.localKey(i).codim());
607 
608  // evaluate consecutive index of subentity
609  typename GV::IndexSet::IndexType index = gv.indexSet().subIndex(e,
610  coeffs.localKey(i).subEntity(),
611  coeffs.localKey(i).codim());
612 
613  // store data
614  GFS::Ordering::Traits::DOFIndexAccessor::store(*it,gt,index,coeffs.localKey(i).index());
615 
616  // make sure we don't write past the end of the iterator range
617  assert(it != endit);
618  }
619  }
620 
621 
622  template<typename GC, typename LC>
623  void insert_constraints (const LC& lc, GC& gc) const
624  {
625  // LC and GC are maps of maps
626  typedef typename LC::const_iterator local_col_iterator;
627  typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
628  typedef typename GC::iterator global_col_iterator;
629  typedef typename GC::value_type::second_type global_row_type;
630 
631  for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
632  {
633 
634  // look up entry in global map, if not found, insert an empty one.
635  global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
636 
637  // copy row to global container with transformed indices
638  for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
639  gcit->second[this->dofIndex(rit->first)] = rit->second;
640  }
641  }
642 
644  void bind (const typename Traits::Element& e)
645  {
646  // call method on base class, this avoid the barton neckman trick
647  BaseT::bind(*this,e);
648  }
649 
650  // private:
651  typename FESwitch::Store pfe;
652  };
653 
654  // Register LeafGFS -> LocalFunctionSpace transformation
655  template<typename GridFunctionSpace, typename Params>
656  TypeTree::GenericLeafNodeTransformation<
658  gfs_to_lfs<Params>,
660  >
661  registerNodeTransformation(GridFunctionSpace* gfs, gfs_to_lfs<Params>* t, LeafGridFunctionSpaceTag* tag);
662 
663  //=======================================
664  // local function facade
665  //=======================================
666 
667  template <typename GFS, typename TAG=AnySpaceTag>
669 
683  template <typename GFS, typename TAG>
684  class LocalFunctionSpace :
685  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
686  {
687  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
688  typedef typename BaseT::Traits::IndexContainer::size_type I;
689  typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
690 
691  template<typename>
693 
694  template<typename>
695  friend struct ClearSizeVisitor;
696 
697  template<typename>
698  friend struct ComputeSizeVisitor;
699 
700  template<typename>
701  friend struct FillIndicesVisitor;
702 
703  public:
704  typedef typename BaseT::Traits Traits;
705 
706  LocalFunctionSpace(const GFS & gfs)
707  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
708  {
709  this->setup(*this);
710  }
711 
713  : BaseT(lfs)
714  {
715  // We need to reset the DOFIndex storage pointers in the new LFS tree,
716  // as they are still pointing to the _dof_index_storage of the
717  // old tree.
718  this->_dof_indices = &(this->_dof_index_storage);
719  this->setup(*this);
720  }
721 
722  LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
723  {
724  return LocalIndex(BaseT::localIndex(index));
725  }
726 
727  private:
728  // we don't support getChild yet, so let's hide it!
729  template<int i>
730  void getChild () const;
731  template<int i>
732  void child () const;
733  };
734 
735  // specialization for AnySpaceTag
736  // WARNING: If you modify this class, make sure to also fix the specialization in
737  // subspacelocalfunctionspace.hh!
738  template <typename GFS>
740  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
741  {
742  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
743 
744  template<typename>
746 
747  template<typename>
748  friend struct ClearSizeVisitor;
749 
750  template<typename>
751  friend struct ComputeSizeVisitor;
752 
753  template<typename>
754  friend struct FillIndicesVisitor;
755 
756  public:
757 
758  LocalFunctionSpace(const GFS & gfs)
759  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
760  {
761  this->_dof_indices = &(this->_dof_index_storage);
762  this->setup(*this);
763  }
764 
765  LocalFunctionSpace(std::shared_ptr<const GFS> pgfs)
766  : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
767  {
768  this->_dof_indices = &(this->_dof_index_storage);
769  this->setup(*this);
770  }
771 
773  : BaseT(lfs)
774  {
775  // We need to reset the DOFIndex storage pointers in the new LFS tree,
776  // as they are still pointing to the _dof_index_storage of the
777  // old tree.
778  this->_dof_indices = &(this->_dof_index_storage);
779  this->setup(*this);
780  }
781 
782  };
783 
785  } // namespace PDELab
786 } // namespace Dune
787 
788 #endif
GridViewLocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:309
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:449
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition: localfunctionspace.hh:525
const std::size_t offset
Definition: localfunctionspace.hh:74
Traits::DOFIndexContainer _dof_index_storage
Definition: localfunctionspace.hh:278
traits for local function space on a gridview
Definition: localfunctionspace.hh:286
Definition: localfunctionspace.hh:419
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:540
Definition: localfunctionspacetags.hh:40
Create a local function space from a global function space.
Definition: localfunctionspace.hh:668
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition: localfunctionspace.hh:520
Traits::IndexContainer::size_type offset
Definition: localfunctionspace.hh:281
Traits::DOFIndexContainer * _dof_indices
Definition: localfunctionspace.hh:279
PowerLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:385
Tag denoting a CompositeLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:273
Definition: localfunctionspace.hh:495
CompositeLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< Children >...children)
Definition: localfunctionspace.hh:466
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:712
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:377
traits mapping global function space information to local function space
Definition: localfunctionspace.hh:155
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:405
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:236
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition: localfunctionspace.hh:161
void bind(NodeType &node, const typename Traits::Element &e)
bind local function space to entity
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:546
LeafLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:554
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:371
LocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:198
traits for single component local function space
Definition: localfunctionspace.hh:517
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:183
base class for tuples of grid function spaces base class that holds implementation of the methods thi...
Definition: compositegridfunctionspace.hh:40
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:461
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition: localfunctionspace.hh:722
void insert_constraints(const LC &lc, GC &gc) const
Definition: localfunctionspace.hh:623
BaseT::Traits Traits
Definition: localfunctionspace.hh:704
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:549
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, std::shared_ptr< Children >...children)
Definition: localfunctionspace.hh:474
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
Definition: localfunctionspace.hh:397
Definition: localfunctionspace.hh:492
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:543
LeafLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition: localfunctionspace.hh:565
CompositeLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:463
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition: localfunctionspace.hh:173
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC...> type
Definition: localfunctionspace.hh:497
Definition: localfunctionspace.hh:299
LocalFunctionSpace(std::shared_ptr< const GFS > pgfs)
Definition: localfunctionspace.hh:765
Traits::IndexContainer::size_type size() const
get current size
Definition: localfunctionspace.hh:206
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:383
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:692
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:189
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:552
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:146
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:772
Definition: localfunctionspace.hh:178
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:455
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:458
Definition: lfsindexcache.hh:240
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:270
std::shared_ptr< GFS const > pgfs
Definition: localfunctionspace.hh:277
Definition: gridfunctionspace/tags.hh:32
GFS GridFunctionSpaceType
Type of the underlying grid function space.
Definition: localfunctionspace.hh:158
N NodeType
type of local function space node
Definition: localfunctionspace.hh:358
const Entity & e
Definition: localfunctionspace.hh:111
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:374
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:276
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition: localfunctionspace.hh:577
Definition: adaptivity.hh:27
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:701
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:452
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:306
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:195
Definition: localfunctionspace.hh:416
TypeTree::TemplatizedGenericPowerNodeTransformation< PowerGridFunctionSpace, gfs_to_lfs< Params >, power_gfs_to_lfs_template< PowerGridFunctionSpace, gfs_to_lfs< Params > >::template result > registerNodeTransformation(PowerGridFunctionSpace *pgfs, gfs_to_lfs< Params > *t, PowerGridFunctionSpaceTag *tag)
void debug() const
print debug information about this local function space
Definition: localfunctionspace.hh:255
void dofIndices(const Entity &e, DOFIndexIterator it, DOFIndexIterator endit)
Calculates the multiindices associated with the given entity.
Definition: localfunctionspace.hh:590
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:389
Definition: gridfunctionspace/tags.hh:26
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:698
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: localfunctionspace.hh:264
Definition: gridfunctionspace/tags.hh:30
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:380
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:644
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:482
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:758
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition: localfunctionspace.hh:164
Definition: localfunctionspace.hh:363
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:289
FESwitch::Store pfe
Definition: localfunctionspace.hh:651
traits for multi component local function space
Definition: localfunctionspace.hh:355
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:249
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:292
std::size_t subSpaceDepth() const
Definition: localfunctionspace.hh:211
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition: localfunctionspace.hh:230
Traits::IndexContainer::size_type maxSize() const
get maximum possible size (which is maxLocalSize from grid function space)
Definition: localfunctionspace.hh:217
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:186
A grid function space.
Definition: gridfunctionspace.hh:108
Traits::IndexContainer::size_type n
Definition: localfunctionspace.hh:280
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:40
GFS::Traits::ConstraintsType Constraints
Definition: localfunctionspace.hh:527
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition: localfunctionspace.hh:167
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:695
GFS::Traits::FiniteElementType FiniteElement
Definition: localfunctionspace.hh:522
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition: localfunctionspace.hh:170
Definition: localfunctionspace.hh:441
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:706
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition: localfunctionspace.hh:583
single component local function space
Definition: localfunctionspace.hh:533
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, SourceNode::CHILDREN > type
Definition: localfunctionspace.hh:421
void setup(NodeType &node)
Definition: localfunctionspace.hh:271
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition: localfunctionspace.hh:571
GridViewType::Traits::template Codim< 0 >::Entity Element
Type of codim 0 entity in the grid.
Definition: localfunctionspace.hh:295