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