dune-pdelab  2.5-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_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_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, bool fast>
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  if (fast)
102  {
103  node.pfe = nullptr;
104  node.n = node.pgfs->finiteElementMap().maxLocalSize();
105  Node::FESwitch::setStore(node.pfe, node.pgfs->finiteElementMap().find(e));
106  }
107  else
108  {
109  Node::FESwitch::setStore(node.pfe, node.pgfs->finiteElementMap().find(e));
110  node.n = Node::FESwitch::basis(*node.pfe).size();
111  }
112  offset += node.n;
113  }
114 
115  ComputeSizeVisitor(const Entity& entity, std::size_t offset_ = 0)
116  : e(entity)
117  , offset(offset_)
118  {}
119 
120  const Entity& e;
121  std::size_t offset;
122 
123  };
124 
125 
126  template<typename Entity, bool fast>
127  struct FillIndicesVisitor
128  : public TypeTree::TreeVisitor
129  , public TypeTree::DynamicTraversal
130  {
131 
132  template<typename Node, typename TreePath>
133  void leaf(Node& node, TreePath treePath)
134  {
135  // setup DOFIndices for this finite element
136  node.dofIndices(e,node._dof_indices->begin()+node.offset,node._dof_indices->begin()+node.offset+node.n,std::integral_constant<bool,fast>{});
137  }
138 
139  template<typename Node, typename Child, typename TreePath, typename ChildIndex>
140  void afterChild(const Node& node, const Child& child, TreePath treePath, ChildIndex childIndex)
141  {
142  // Just skip the entire function space structure handling in fast mode
143  // This **really** breaks any attempt at using the DOFIndex for anything other
144  // than as input to the FastDGGridOperator machine.
145  // You have been warned!
146  if (not fast)
147  for (std::size_t i = 0; i<child.n; ++i)
148  {
149  // update tree path for the DOFIndices of the child
150  (*node._dof_indices)[child.offset+i].treeIndex().push_back(childIndex);
151  }
152  }
153 
154  FillIndicesVisitor(const Entity& entity)
155  : e(entity)
156  {}
157 
158  const Entity& e;
159  };
160 
161  } // end empty namespace
162 
163  //=======================================
164  // local function space base: base class
165  //=======================================
166 
168  template<typename GFS, typename DI>
170  {
173 
175  typedef GFS GridFunctionSpace;
176 
178  typedef typename GFS::Traits::SizeType SizeType;
179 
181  typedef typename std::vector<SizeType> IndexContainer;
182 
184  typedef DI DOFIndex;
185 
187  typedef typename std::vector<DI> DOFIndexContainer;
188 
189  };
190 
191  template <typename GFS, typename DOFIndex>
193  {
194  typedef typename GFS::Traits::Backend B;
195 
196  template<typename>
197  friend struct PropagateGlobalStorageVisitor;
198 
199  template<typename,bool>
200  friend struct ComputeSizeVisitor;
201 
202  template<typename,bool>
203  friend struct FillIndicesVisitor;
204 
205  template<typename LFS, typename C, typename Tag, bool>
206  friend class LFSIndexCacheBase;
207 
208  public:
210 
212  LocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
213  : pgfs(gfs)
214  , _dof_index_storage()
215  , _dof_indices(&_dof_index_storage)
216  , n(0)
217  {}
218 
220  typename Traits::IndexContainer::size_type size () const
221  {
222  return n;
223  }
224 
225  std::size_t subSpaceDepth() const
226  {
227  return 0;
228  }
229 
231  typename Traits::IndexContainer::size_type maxSize () const
232  {
233  // _dof_indices is always as large as the max local size of the root GFS
234  return _dof_indices->size();
235  }
236 
238 
244  typename Traits::IndexContainer::size_type localVectorSize () const
245  {
246  return _dof_indices->size();
247  }
248 
250  typename Traits::IndexContainer::size_type localIndex (typename Traits::IndexContainer::size_type index) const
251  {
252  return offset+index;
253  }
254 
256 
263  const typename Traits::DOFIndex& dofIndex(typename Traits::IndexContainer::size_type index) const
264  {
265  return (*_dof_indices)[offset + index];
266  }
267 
269  void debug () const
270  {
271  std::cout << n << " indices = (";
272  for (typename Traits::IndexContainer::size_type k=0; k<n; k++)
273  std::cout << (*_dof_indices)[localIndex(k)] << " ";
274  std::cout << ")" << std::endl;
275  }
276 
278  const GFS& gridFunctionSpace() const
279  {
280  return *pgfs;
281  }
282 
283  public:
284  template<typename NodeType>
285  void setup(NodeType& node)
286  {
287  _dof_index_storage.resize(gridFunctionSpace().ordering().maxLocalSize());
288  TypeTree::applyToTree(node,PropagateGlobalStorageVisitor<>());
289  }
290 
291  std::shared_ptr<GFS const> pgfs;
292  typename Traits::DOFIndexContainer _dof_index_storage;
293  typename Traits::DOFIndexContainer* _dof_indices;
294  typename Traits::IndexContainer::size_type n;
295  typename Traits::IndexContainer::size_type offset;
296  };
297 
299  template<typename GFS, typename DOFIndex>
301  {
303  typedef typename GFS::Traits::GridViewType GridViewType;
304 
306  typedef typename GFS::Traits::GridViewType GridView;
307 
308  using EntitySet = typename GFS::Traits::EntitySet;
309 
311  using Element = typename EntitySet::Element;
312  };
313 
314  template <typename GFS, typename DOFIndex>
316  public LocalFunctionSpaceBaseNode<GFS,DOFIndex>
317  {
318  typedef typename GFS::Traits::Backend B;
320 
321  public:
323 
325  GridViewLocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
326  : BaseT(gfs)
327  {}
328 
329  protected:
331 
343  template<typename NodeType, bool fast = false>
344  void bind (NodeType& node, const typename Traits::Element& e, std::integral_constant<bool,fast> = std::integral_constant<bool,fast>{});
345  };
346 
347  template <typename GFS, typename DOFIndex>
348  template <typename NodeType, bool fast>
351  std::integral_constant<bool,fast>)
352  {
354  assert(&node == this);
355 
356  // compute sizes
357  ComputeSizeVisitor<Element,fast> csv(e);
358  TypeTree::applyToTree(node,csv);
359 
360 
361  // initialize iterators and fill indices
362  FillIndicesVisitor<Element,fast> fiv(e);
363  TypeTree::applyToTree(node,fiv);
364  }
365 
366  //=======================================
367  // local function space base: power implementation
368  //=======================================
369 
371  template<typename GFS, typename DOFIndex, typename N>
373  {
375  typedef N NodeType;
376  };
377 
378  // local function space for a power grid function space
379  template<typename GFS, typename DOFIndex, typename ChildLFS, std::size_t k>
381  public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>,
382  public TypeTree::PowerNode<ChildLFS,k>
383  {
385  typedef TypeTree::PowerNode<ChildLFS,k> TreeNode;
386 
387  template<typename>
388  friend struct PropagateGlobalStorageVisitor;
389 
390  template<typename>
391  friend struct ClearSizeVisitor;
392 
393  template<typename,bool>
394  friend struct ComputeSizeVisitor;
395 
396  template<typename,bool>
397  friend struct FillIndicesVisitor;
398 
399  public:
401 
403 
405  template<typename Transformation>
406  PowerLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
407  const Transformation& t,
408  const std::array<std::shared_ptr<ChildLFS>,k>& children)
409  : BaseT(gfs)
410  , TreeNode(children)
411  {}
412 
413  template<typename Transformation>
415  const Transformation& t,
416  const std::array<std::shared_ptr<ChildLFS>,k>& children)
417  : BaseT(stackobject_to_shared_ptr(gfs))
418  , TreeNode(children)
419  {}
420 
422  template<bool fast = false>
423  void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
424  {
425  // call method on base class, this avoid the barton neckman trick
426  BaseT::bind(*this,e,fast_);
427  }
428 
429  };
430 
431 
432  // transformation template, we need a custom template in order to inject the DOFIndex type into the LocalFunctionSpace
433  template<typename SourceNode, typename Transformation>
435  {
436  template<typename TC>
437  struct result
438  {
440  };
441  };
442 
443  // register PowerGFS -> LocalFunctionSpace transformation
444  template<typename PowerGridFunctionSpace, typename Params>
445  TypeTree::TemplatizedGenericPowerNodeTransformation<
447  gfs_to_lfs<Params>,
449  >
450  registerNodeTransformation(PowerGridFunctionSpace* pgfs, gfs_to_lfs<Params>* t, PowerGridFunctionSpaceTag* tag);
451 
452 
453  //=======================================
454  // local function space base: composite implementation
455  //=======================================
456 
457  // local function space for a power grid function space
458  template<typename GFS, typename DOFIndex, typename... Children>
460  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
461  , public TypeTree::CompositeNode<Children...>
462  {
464  typedef TypeTree::CompositeNode<Children...> NodeType;
465 
466  template<typename>
467  friend struct PropagateGlobalStorageVisitor;
468 
469  template<typename>
470  friend struct ClearSizeVisitor;
471 
472  template<typename,bool>
473  friend struct ComputeSizeVisitor;
474 
475  template<typename,bool>
476  friend struct FillIndicesVisitor;
477 
478  public:
480 
482 
483  template<typename Transformation>
484  CompositeLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
485  const Transformation& t,
486  std::shared_ptr<Children>... children)
487  : BaseT(gfs)
488  , NodeType(children...)
489  {}
490 
491  template<typename Transformation>
493  const Transformation& t,
494  std::shared_ptr<Children>... children)
495  : BaseT(stackobject_to_shared_ptr(gfs))
496  , NodeType(children...)
497  {}
498 
500  template<bool fast = false>
501  void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
502  {
503  // call method on base class, this avoid the barton neckman trick
504  BaseT::bind(*this,e,fast_);
505  }
506 
507  };
508 
509  // transformation template, we need a custom template in order to inject the MultiIndex type into the LocalFunctionSpace
510  template<typename SourceNode, typename Transformation>
512  {
513  template<typename... TC>
514  struct result
515  {
516  typedef CompositeLocalFunctionSpaceNode<SourceNode,typename Transformation::DOFIndex,TC...> type;
517  };
518  };
519 
520  // register CompositeGFS -> LocalFunctionSpace transformation (variadic version)
521  template<typename CompositeGridFunctionSpace, typename Params>
522  TypeTree::TemplatizedGenericCompositeNodeTransformation<
524  gfs_to_lfs<Params>,
526  >
527  registerNodeTransformation(CompositeGridFunctionSpace* cgfs, gfs_to_lfs<Params>* t, CompositeGridFunctionSpaceTag* tag);
528 
529 
530  //=======================================
531  // local function space base: single component implementation
532  //=======================================
533 
535  template<typename GFS, typename DOFIndex, typename N>
537  {
539  typedef typename GFS::Traits::FiniteElementType FiniteElementType;
540 
541  typedef typename GFS::Traits::FiniteElementType FiniteElement;
542 
544  typedef typename GFS::Traits::ConstraintsType ConstraintsType;
545 
546  typedef typename GFS::Traits::ConstraintsType Constraints;
547 
548  };
549 
551  template<typename GFS, typename DOFIndex>
553  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
554  , public TypeTree::LeafNode
555  {
557 
558  template<typename>
559  friend struct PropagateGlobalStorageVisitor;
560 
561  template<typename>
562  friend struct ClearSizeVisitor;
563 
564  template<typename,bool>
565  friend struct ComputeSizeVisitor;
566 
567  template<typename,bool>
568  friend struct FillIndicesVisitor;
569 
570  public:
572 
574 
575  private:
576  typedef FiniteElementInterfaceSwitch<
577  typename Traits::FiniteElementType
578  > FESwitch;
579 
580  public:
581 
583  template<typename Transformation>
584  LeafLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs, const Transformation& t)
585  : BaseT(gfs)
586  {
587  }
588 
589  template<typename Transformation>
590  LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
591  : BaseT(stackobject_to_shared_ptr(gfs))
592  {
593  }
594 
596  const typename Traits::FiniteElementType& finiteElement () const
597  {
598  assert(pfe);
599  return *pfe;
600  }
601 
603  const typename Traits::ConstraintsType& constraints () const
604  {
605  return this->pgfs->constraints();
606  }
607 
609  template<typename Entity, typename DOFIndexIterator, bool fast>
610  void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit, std::integral_constant<bool,fast>)
611  {
612  if (fast)
613  {
614  auto gt = e.type();
615  auto index = this->gridFunctionSpace().entitySet().indexSet().index(e);
616  GFS::Ordering::Traits::DOFIndexAccessor::store(*it,gt,index,0);
617  ++it;
618  }
619  else
620  {
621  // get layout of entity
622  const typename FESwitch::Coefficients &coeffs =
623  FESwitch::coefficients(*pfe);
624 
625  using EntitySet = typename GFS::Traits::EntitySet;
626  auto es = this->gridFunctionSpace().entitySet();
627 
628  auto refEl = Dune::ReferenceElements<double,EntitySet::dimension>::general(this->pfe->type());
629 
630  for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it)
631  {
632  // get geometry type of subentity
633  auto gt = refEl.type(coeffs.localKey(i).subEntity(),
634  coeffs.localKey(i).codim());
635 
636  // evaluate consecutive index of subentity
637  auto index = es.indexSet().subIndex(e,
638  coeffs.localKey(i).subEntity(),
639  coeffs.localKey(i).codim());
640 
641  // store data
642  GFS::Ordering::Traits::DOFIndexAccessor::store(*it,gt,index,coeffs.localKey(i).index());
643 
644  // make sure we don't write past the end of the iterator range
645  assert(it != endit);
646  }
647  }
648  }
649 
650 
651  template<typename GC, typename LC>
652  void insert_constraints (const LC& lc, GC& gc) const
653  {
654  // LC and GC are maps of maps
655  typedef typename LC::const_iterator local_col_iterator;
656  typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
657  typedef typename GC::iterator global_col_iterator;
658  typedef typename GC::value_type::second_type global_row_type;
659 
660  for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
661  {
662 
663  // look up entry in global map, if not found, insert an empty one.
664  global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
665 
666  // copy row to global container with transformed indices
667  for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
668  gcit->second[this->dofIndex(rit->first)] = rit->second;
669  }
670  }
671 
673  template<bool fast = false>
674  void bind (const typename Traits::Element& e, std::integral_constant<bool,fast> fast_ = std::integral_constant<bool,fast>{})
675  {
676  // call method on base class, this avoid the barton neckman trick
677  BaseT::bind(*this,e,fast_);
678  }
679 
680  // private:
681  typename FESwitch::Store pfe;
682  };
683 
684  // Register LeafGFS -> LocalFunctionSpace transformation
685  template<typename GridFunctionSpace, typename Params>
686  TypeTree::GenericLeafNodeTransformation<
688  gfs_to_lfs<Params>,
690  >
691  registerNodeTransformation(GridFunctionSpace* gfs, gfs_to_lfs<Params>* t, LeafGridFunctionSpaceTag* tag);
692 
693  //=======================================
694  // local function facade
695  //=======================================
696 
697  template <typename GFS, typename TAG=AnySpaceTag>
699 
713  template <typename GFS, typename TAG>
714  class LocalFunctionSpace :
715  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
716  {
717  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
718  typedef typename BaseT::Traits::IndexContainer::size_type I;
719  typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
720 
721  template<typename>
722  friend struct PropagateGlobalStorageVisitor;
723 
724  template<typename>
725  friend struct ClearSizeVisitor;
726 
727  template<typename>
728  friend struct ComputeSizeVisitor;
729 
730  template<typename>
731  friend struct FillIndicesVisitor;
732 
733  public:
734  typedef typename BaseT::Traits Traits;
735 
736  LocalFunctionSpace(const GFS & gfs)
737  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
738  {
739  this->setup(*this);
740  }
741 
743  : BaseT(lfs)
744  {
745  // We need to reset the DOFIndex storage pointers in the new LFS tree,
746  // as they are still pointing to the _dof_index_storage of the
747  // old tree.
748  this->_dof_indices = &(this->_dof_index_storage);
749  this->setup(*this);
750  }
751 
752  LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
753  {
754  return LocalIndex(BaseT::localIndex(index));
755  }
756 
757  private:
758  // we don't support getChild yet, so let's hide it!
759  template<int i>
760  void getChild () const;
761  template<int i>
762  void child () const;
763  };
764 
765  // specialization for AnySpaceTag
766  // WARNING: If you modify this class, make sure to also fix the specialization in
767  // subspacelocalfunctionspace.hh!
768  template <typename GFS>
770  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
771  {
772  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
773 
774  template<typename>
775  friend struct PropagateGlobalStorageVisitor;
776 
777  template<typename>
778  friend struct ClearSizeVisitor;
779 
780  template<typename,bool>
781  friend struct ComputeSizeVisitor;
782 
783  template<typename,bool>
784  friend struct FillIndicesVisitor;
785 
786  public:
787 
788  LocalFunctionSpace(const GFS & gfs)
789  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
790  {
791  this->_dof_indices = &(this->_dof_index_storage);
792  this->setup(*this);
793  }
794 
795  LocalFunctionSpace(std::shared_ptr<const GFS> pgfs)
796  : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
797  {
798  this->_dof_indices = &(this->_dof_index_storage);
799  this->setup(*this);
800  }
801 
803  : BaseT(lfs)
804  {
805  // We need to reset the DOFIndex storage pointers in the new LFS tree,
806  // as they are still pointing to the _dof_index_storage of the
807  // old tree.
808  this->_dof_indices = &(this->_dof_index_storage);
809  this->setup(*this);
810  }
811 
812  };
813 
815  } // namespace PDELab
816 } // namespace Dune
817 
818 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:742
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:194
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:571
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:147
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:610
N NodeType
type of local function space node
Definition: localfunctionspace.hh:375
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:209
const Entity & e
Definition: localfunctionspace.hh:120
Definition: gridfunctionspace/tags.hh:30
Definition: localfunctionspace.hh:514
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition: localfunctionspace.hh:175
base class for tuples of grid function spaces base class that holds implementation of the methods thi...
Definition: compositegridfunctionspace.hh:40
typename GFS::Traits::EntitySet EntitySet
Definition: localfunctionspace.hh:308
Definition: localfunctionspace.hh:437
A grid function space.
Definition: gridfunctionspace.hh:166
traits for multi component local function space
Definition: localfunctionspace.hh:372
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
Definition: localfunctionspace.hh:414
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:423
Traits::IndexContainer::size_type offset
Definition: localfunctionspace.hh:295
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:306
BaseT::Traits Traits
Definition: localfunctionspace.hh:734
Definition: localfunctionspacetags.hh:40
CompositeLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:484
void setup(NodeType &node)
Definition: localfunctionspace.hh:285
single component local function space
Definition: localfunctionspace.hh:552
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition: localfunctionspace.hh:596
GFS::Traits::FiniteElementType FiniteElement
Definition: localfunctionspace.hh:541
Definition: localfunctionspace.hh:511
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:406
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:263
GFS GridFunctionSpaceType
Type of the underlying grid function space.
Definition: localfunctionspace.hh:172
void insert_constraints(const LC &lc, GC &gc) const
Definition: localfunctionspace.hh:652
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:322
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:400
CompositeLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:481
PowerLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:402
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:501
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition: localfunctionspace.hh:181
void debug() const
print debug information about this local function space
Definition: localfunctionspace.hh:269
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition: localfunctionspace.hh:244
GridViewLocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:325
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:479
const std::size_t offset
Definition: localfunctionspace.hh:74
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:303
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition: localfunctionspace.hh:539
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:674
GFS::Traits::ConstraintsType Constraints
Definition: localfunctionspace.hh:546
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition: localfunctionspace.hh:544
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
LocalFunctionSpace(std::shared_ptr< const GFS > pgfs)
Definition: localfunctionspace.hh:795
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition: localfunctionspace.hh:184
Definition: localfunctionspace.hh:192
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:200
Traits::IndexContainer::size_type n
Definition: localfunctionspace.hh:294
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:40
LeafLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:573
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition: localfunctionspace.hh:590
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, TypeTree::StaticDegree< SourceNode >::value > type
Definition: localfunctionspace.hh:439
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:736
Definition: localfunctionspace.hh:434
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:250
FESwitch::Store pfe
Definition: localfunctionspace.hh:681
Definition: localfunctionspace.hh:315
Traits::DOFIndexContainer _dof_index_storage
Definition: localfunctionspace.hh:292
std::shared_ptr< GFS const > pgfs
Definition: localfunctionspace.hh:291
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:492
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:788
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC... > type
Definition: localfunctionspace.hh:516
Definition: gridfunctionspace/tags.hh:32
traits for single component local function space
Definition: localfunctionspace.hh:536
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:802
Definition: lfsindexcache.hh:244
Definition: gridfunctionspace/tags.hh:26
Definition: localfunctionspace.hh:459
Dune::TypeTree::GenericLeafNodeTransformation< LeafNode, GridFunctionToLocalViewTransformation, Imp::LocalGridViewFunctionAdapter< LeafNode > > registerNodeTransformation(LeafNode *l, GridFunctionToLocalViewTransformation *t, GridFunctionTag *tag)
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition: localfunctionspace.hh:178
LocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:212
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: localfunctionspace.hh:278
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
LeafLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition: localfunctionspace.hh:584
traits mapping global function space information to local function space
Definition: localfunctionspace.hh:169
Tag denoting a CompositeLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:197
Create a local function space from a global function space.
Definition: localfunctionspace.hh:698
std::size_t index
Definition: interpolate.hh:118
Traits::IndexContainer::size_type maxSize() const
get maximum possible size (which is maxLocalSize from grid function space)
Definition: localfunctionspace.hh:231
std::size_t subSpaceDepth() const
Definition: localfunctionspace.hh:225
Traits::DOFIndexContainer * _dof_indices
Definition: localfunctionspace.hh:293
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition: localfunctionspace.hh:752
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition: localfunctionspace.hh:603
Definition: localfunctionspace.hh:380
traits for local function space on a gridview
Definition: localfunctionspace.hh:300
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition: localfunctionspace.hh:187
typename EntitySet::Element Element
Type of codim 0 entity in the grid.
Definition: localfunctionspace.hh:311
Traits::IndexContainer::size_type size() const
get current size
Definition: localfunctionspace.hh:220