dune-pdelab  2.0.0
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 (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  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 (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 (shared_ptr<const GFS> gfs,
390  const Transformation& t,
391  const array<shared_ptr<ChildLFS>,k>& children)
392  : BaseT(gfs)
393  , TreeNode(children)
394  {}
395 
396  template<typename Transformation>
398  const Transformation& t,
399  const array<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  Dune::TypeTree::TemplatizedGenericPowerNodeTransformation<
429  gfs_to_lfs<Params>,
431  >
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, DUNE_TYPETREE_COMPOSITENODE_TEMPLATE_CHILDREN>
442  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
443  , public DUNE_TYPETREE_COMPOSITENODE_BASETYPE
444  {
446  typedef DUNE_TYPETREE_COMPOSITENODE_BASETYPE 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 (shared_ptr<const GFS> gfs,
467  const Transformation& t,
468  DUNE_TYPETREE_COMPOSITENODE_STORAGE_CONSTRUCTOR_SIGNATURE)
469  : BaseT(gfs)
470  , NodeType(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES)
471  {}
472 
473  template<typename Transformation>
475  const Transformation& t,
476  DUNE_TYPETREE_COMPOSITENODE_STORAGE_CONSTRUCTOR_SIGNATURE)
477  : BaseT(stackobject_to_shared_ptr(gfs))
478  , NodeType(DUNE_TYPETREE_COMPOSITENODE_CHILDVARIABLES)
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 #if HAVE_VARIADIC_TEMPLATES
491 
492  // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
493  template<typename SourceNode, typename Transformation>
494  struct variadic_composite_gfs_to_lfs_template
495  {
496  template<typename... TC>
497  struct result
498  {
499  typedef CompositeLocalFunctionSpaceNode<SourceNode,typename Transformation::DOFIndex,TC...> type;
500  };
501  };
502 
503  // register CompositeGFS -> LocalFunctionSpace transformation (variadic version)
504  template<typename CompositeGridFunctionSpace, typename Params>
505  Dune::TypeTree::TemplatizedGenericVariadicCompositeNodeTransformation<
506  CompositeGridFunctionSpace,
507  gfs_to_lfs<Params>,
508  variadic_composite_gfs_to_lfs_template<CompositeGridFunctionSpace,gfs_to_lfs<Params> >::template result
509  >
510  registerNodeTransformation(CompositeGridFunctionSpace* cgfs, gfs_to_lfs<Params>* t, CompositeGridFunctionSpaceTag* tag);
511 
512 #else
513 
514  // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
515  template<typename SourceNode, typename Transformation>
517  {
518  template<typename TC0,
519  typename TC1,
520  typename TC2,
521  typename TC3,
522  typename TC4,
523  typename TC5,
524  typename TC6,
525  typename TC7,
526  typename TC8,
527  typename TC9>
528  struct result
529  {
531  };
532  };
533 
534  // register CompositeGFS -> LocalFunctionSpace transformation (non-variadic version)
535  template<typename CompositeGridFunctionSpace, typename Params>
536  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation<
538  gfs_to_lfs<Params>,
540  >
542 
543 #endif
544 
545  //=======================================
546  // local function space base: single component implementation
547  //=======================================
548 
550  template<typename GFS, typename DOFIndex, typename N>
552  {
554  typedef typename GFS::Traits::FiniteElementType FiniteElementType;
555 
556  typedef typename GFS::Traits::FiniteElementType FiniteElement;
557 
559  typedef typename GFS::Traits::ConstraintsType ConstraintsType;
560 
561  typedef typename GFS::Traits::ConstraintsType Constraints;
562 
563  };
564 
566  template<typename GFS, typename DOFIndex>
568  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
569  , public TypeTree::LeafNode
570  {
572 
573  template<typename>
575 
576  template<typename>
577  friend struct ClearSizeVisitor;
578 
579  template<typename>
580  friend struct ComputeSizeVisitor;
581 
582  template<typename>
583  friend struct FillIndicesVisitor;
584 
585  public:
587 
589 
590  private:
591  typedef FiniteElementInterfaceSwitch<
593  > FESwitch;
594 
595  public:
596 
598  template<typename Transformation>
599  LeafLocalFunctionSpaceNode (shared_ptr<const GFS> gfs, const Transformation& t)
600  : BaseT(gfs)
601  {
602  }
603 
604  template<typename Transformation>
605  LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
606  : BaseT(stackobject_to_shared_ptr(gfs))
607  {
608  }
609 
611  const typename Traits::FiniteElementType& finiteElement () const
612  {
613  return *pfe;
614  }
615 
617  const typename Traits::ConstraintsType& constraints () const
618  {
619  return this->pgfs->constraints();
620  }
621 
623  template<typename Entity, typename DOFIndexIterator>
624  void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit)
625  {
626  // get layout of entity
627  const typename FESwitch::Coefficients &coeffs =
628  FESwitch::coefficients(*pfe);
629 
630  typedef typename GFS::Traits::GridViewType GV;
631  GV gv = this->gridFunctionSpace().gridView();
632 
633  const Dune::ReferenceElement<double,GV::Grid::dimension>& refEl =
634  Dune::ReferenceElements<double,GV::Grid::dimension>::general(this->pfe->type());
635 
636  for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it)
637  {
638  // get geometry type of subentity
639  Dune::GeometryType gt = refEl.type(coeffs.localKey(i).subEntity(),
640  coeffs.localKey(i).codim());
641 
642  // evaluate consecutive index of subentity
643  typename GV::IndexSet::IndexType index = gv.indexSet().subIndex(e,
644  coeffs.localKey(i).subEntity(),
645  coeffs.localKey(i).codim());
646 
647  // store data
648  GFS::Ordering::Traits::DOFIndexAccessor::store(*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  template<typename GC, typename LC>
657  void insert_constraints (const LC& lc, GC& gc) const
658  {
659  // LC and GC are maps of maps
660  typedef typename LC::const_iterator local_col_iterator;
661  typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
662  typedef typename GC::iterator global_col_iterator;
663  typedef typename GC::value_type::second_type global_row_type;
664 
665  for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
666  {
667 
668  // look up entry in global map, if not found, insert an empty one.
669  global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
670 
671  // copy row to global container with transformed indices
672  for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
673  gcit->second[this->dofIndex(rit->first)] = rit->second;
674  }
675  }
676 
678  void bind (const typename Traits::Element& e)
679  {
680  // call method on base class, this avoid the barton neckman trick
681  BaseT::bind(*this,e);
682  }
683 
684  // private:
685  typename FESwitch::Store pfe;
686  };
687 
688  // Register LeafGFS -> LocalFunctionSpace transformation
689  template<typename GridFunctionSpace, typename Params>
690  Dune::TypeTree::GenericLeafNodeTransformation<
692  gfs_to_lfs<Params>,
694  >
695  registerNodeTransformation(GridFunctionSpace* gfs, gfs_to_lfs<Params>* t, LeafGridFunctionSpaceTag* tag);
696 
697  //=======================================
698  // local function facade
699  //=======================================
700 
701  template <typename GFS, typename TAG=AnySpaceTag>
703 
717  template <typename GFS, typename TAG>
718  class LocalFunctionSpace :
719  public Dune::TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
720  {
721  typedef typename Dune::TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
722  typedef typename BaseT::Traits::IndexContainer::size_type I;
723  typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
724 
725  template<typename>
727 
728  template<typename>
729  friend struct ClearSizeVisitor;
730 
731  template<typename>
732  friend struct ComputeSizeVisitor;
733 
734  template<typename>
735  friend struct FillIndicesVisitor;
736 
737  public:
738  typedef typename BaseT::Traits Traits;
739 
740  LocalFunctionSpace(const GFS & gfs)
741  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
742  {
743  this->setup(*this);
744  }
745 
747  : BaseT(lfs)
748  {
749  // We need to reset the DOFIndex storage pointers in the new LFS tree,
750  // as they are still pointing to the _dof_index_storage of the
751  // old tree.
752  this->_dof_indices = &(this->_dof_index_storage);
753  this->setup(*this);
754  }
755 
756  LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
757  {
758  return LocalIndex(BaseT::localIndex(index));
759  }
760 
761  private:
762  // we don't support getChild yet, so let's hide it!
763  template<int i>
764  void getChild () const;
765  template<int i>
766  void child () const;
767  };
768 
769  // specialization for AnySpaceTag
770  // WARNING: If you modify this class, make sure to also fix the specialization in
771  // subspacelocalfunctionspace.hh!
772  template <typename GFS>
774  public Dune::TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
775  {
776  typedef typename Dune::TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
777 
778  template<typename>
780 
781  template<typename>
782  friend struct ClearSizeVisitor;
783 
784  template<typename>
785  friend struct ComputeSizeVisitor;
786 
787  template<typename>
788  friend struct FillIndicesVisitor;
789 
790  public:
791 
792  LocalFunctionSpace(const GFS & gfs)
793  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
794  {
795  this->_dof_indices = &(this->_dof_index_storage);
796  this->setup(*this);
797  }
798 
799  LocalFunctionSpace(shared_ptr<const GFS> pgfs)
800  : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
801  {
802  this->_dof_indices = &(this->_dof_index_storage);
803  this->setup(*this);
804  }
805 
807  : BaseT(lfs)
808  {
809  // We need to reset the DOFIndex storage pointers in the new LFS tree,
810  // as they are still pointing to the _dof_index_storage of the
811  // old tree.
812  this->_dof_indices = &(this->_dof_index_storage);
813  this->setup(*this);
814  }
815 
816  };
817 
819  } // namespace PDELab
820 } // namespace Dune
821 
822 #endif
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition: localfunctionspace.hh:559
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:458
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:624
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:374
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:186
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition: localfunctionspace.hh:173
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:270
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:678
single component local function space
Definition: localfunctionspace.hh:567
FESwitch::Store pfe
Definition: localfunctionspace.hh:685
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:806
traits for local function space on a gridview
Definition: localfunctionspace.hh:286
Definition: localfunctionspace.hh:441
LocalFunctionSpace(shared_ptr< const GFS > pgfs)
Definition: localfunctionspace.hh:799
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, SourceNode::CHILDREN > type
Definition: localfunctionspace.hh:421
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:380
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 GridFunctionSpaceType
Type of the underlying grid function space.
Definition: localfunctionspace.hh:158
Definition: gridfunctionspace/tags.hh:22
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:449
GridViewLocalFunctionSpaceBaseNode(shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:309
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:746
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:289
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:455
Definition: localfunctionspace.hh:363
PowerLocalFunctionSpaceNode(shared_ptr< const GFS > gfs, const Transformation &t, const array< shared_ptr< ChildLFS >, k > &children)
initialize with grid function space
Definition: localfunctionspace.hh:389
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition: localfunctionspace.hh:170
traits mapping global function space information to local function space
Definition: localfunctionspace.hh:155
traits for multi component local function space
Definition: localfunctionspace.hh:355
LocalFunctionSpaceBaseNode(shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:198
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:732
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:452
N NodeType
type of local function space node
Definition: localfunctionspace.hh:358
const Entity & e
Definition: localfunctionspace.hh:111
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:306
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const array< shared_ptr< ChildLFS >, k > &children)
Definition: localfunctionspace.hh:397
GFS::Traits::ConstraintsType Constraints
Definition: localfunctionspace.hh:561
Definition: gridfunctionspace/tags.hh:26
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:792
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition: localfunctionspace.hh:164
const std::size_t offset
Definition: localfunctionspace.hh:74
Traits::IndexContainer::size_type n
Definition: localfunctionspace.hh:280
void setup(NodeType &node)
Definition: localfunctionspace.hh:271
LeafLocalFunctionSpaceNode(shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition: localfunctionspace.hh:599
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:574
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:41
std::size_t subSpaceDepth() const
Definition: localfunctionspace.hh:211
traits for single component local function space
Definition: localfunctionspace.hh:551
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition: localfunctionspace.hh:167
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:735
shared_ptr< GFS const > pgfs
Definition: localfunctionspace.hh:277
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:292
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:740
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition: localfunctionspace.hh:617
LeafLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:588
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:371
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:482
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition: localfunctionspace.hh:605
Traits::IndexContainer::size_type size() const
get current size
Definition: localfunctionspace.hh:206
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:405
Dune::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)
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition: localfunctionspace.hh:756
Definition: localfunctionspace.hh:178
Definition: lfsindexcache.hh:240
Traits::DOFIndexContainer * _dof_indices
Definition: localfunctionspace.hh:279
Create a local function space from a global function space.
Definition: localfunctionspace.hh:702
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:583
Definition: gridfunctionspace/tags.hh:28
PowerLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:385
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: localfunctionspace.hh:264
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:377
void bind(NodeType &node, const typename Traits::Element &e)
bind local function space to entity
A grid function space.
Definition: gridfunctionspace.hh:109
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:577
CompositeLocalFunctionSpaceNode(shared_ptr< const GFS > gfs, const Transformation &t, DUNE_TYPETREE_COMPOSITENODE_STORAGE_CONSTRUCTOR_SIGNATURE)
Definition: localfunctionspace.hh:466
Traits::DOFIndexContainer _dof_index_storage
Definition: localfunctionspace.hh:278
CompositeLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:463
Definition: localfunctionspace.hh:516
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:726
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition: localfunctionspace.hh:161
friend struct FillIndicesVisitor
Definition: localfunctionspace.hh:189
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:586
GFS::Traits::FiniteElementType FiniteElement
Definition: localfunctionspace.hh:556
friend struct ClearSizeVisitor
Definition: localfunctionspace.hh:729
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:461
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition: localfunctionspace.hh:554
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, DUNE_TYPETREE_COMPOSITENODE_STORAGE_CONSTRUCTOR_SIGNATURE)
Definition: localfunctionspace.hh:474
friend struct ComputeSizeVisitor
Definition: localfunctionspace.hh:580
Definition: localfunctionspacetags.hh:40
GridViewType::Traits::template Codim< 0 >::Entity Element
Type of codim 0 entity in the grid.
Definition: localfunctionspace.hh:295
Definition: localfunctionspace.hh:419
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:276
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
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9 > type
Definition: localfunctionspace.hh:530
base class for tuples of grid function spaces base class that holds implementation of the methods thi...
Definition: compositegridfunctionspace.hh:40
Tag denoting a CompositeLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:273
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:195
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition: localfunctionspace.hh:230
Definition: localfunctionspace.hh:299
void insert_constraints(const LC &lc, GC &gc) const
Definition: localfunctionspace.hh:657
Traits::IndexContainer::size_type offset
Definition: localfunctionspace.hh:281
BaseT::Traits Traits
Definition: localfunctionspace.hh:738
Definition: localfunctionspace.hh:416
Definition: localfunctionspace.hh:528
friend struct PropagateGlobalStorageVisitor
Definition: localfunctionspace.hh:183
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:383
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition: localfunctionspace.hh:611