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>
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>
183  friend struct PropagateGlobalStorageVisitor;
184 
185  template<typename>
186  friend struct ComputeSizeVisitor;
187 
188  template<typename>
189  friend struct FillIndicesVisitor;
190 
191  template<typename LFS, typename C, typename Tag>
192  friend class LFSIndexCacheBase;
193 
194  public:
196 
198  LocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
199  : pgfs(gfs)
200  , _dof_index_storage()
201  , _dof_indices(&_dof_index_storage)
202  , n(0)
203  {}
204 
206  typename Traits::IndexContainer::size_type size () const
207  {
208  return n;
209  }
210 
211  std::size_t subSpaceDepth() const
212  {
213  return 0;
214  }
215 
217  typename Traits::IndexContainer::size_type maxSize () const
218  {
219  // _dof_indices is always as large as the max local size of the root GFS
220  return _dof_indices->size();
221  }
222 
224 
230  typename Traits::IndexContainer::size_type localVectorSize () const
231  {
232  return _dof_indices->size();
233  }
234 
236  typename Traits::IndexContainer::size_type localIndex (typename Traits::IndexContainer::size_type index) const
237  {
238  return offset+index;
239  }
240 
242 
249  const typename Traits::DOFIndex& dofIndex(typename Traits::IndexContainer::size_type index) const
250  {
251  return (*_dof_indices)[offset + index];
252  }
253 
255  void debug () const
256  {
257  std::cout << n << " indices = (";
258  for (typename Traits::IndexContainer::size_type k=0; k<n; k++)
259  std::cout << (*_dof_indices)[localIndex(k)] << " ";
260  std::cout << ")" << std::endl;
261  }
262 
264  const GFS& gridFunctionSpace() const
265  {
266  return *pgfs;
267  }
268 
269  public:
270  template<typename NodeType>
271  void setup(NodeType& node)
272  {
273  _dof_index_storage.resize(gridFunctionSpace().ordering().maxLocalSize());
274  TypeTree::applyToTree(node,PropagateGlobalStorageVisitor<>());
275  }
276 
277  std::shared_ptr<GFS const> pgfs;
278  typename Traits::DOFIndexContainer _dof_index_storage;
279  typename Traits::DOFIndexContainer* _dof_indices;
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 
294  using EntitySet = typename GFS::Traits::EntitySet;
295 
297  using Element = typename EntitySet::Element;
298  };
299 
300  template <typename GFS, typename DOFIndex>
302  public LocalFunctionSpaceBaseNode<GFS,DOFIndex>
303  {
304  typedef typename GFS::Traits::Backend B;
306 
307  public:
309 
311  GridViewLocalFunctionSpaceBaseNode (std::shared_ptr<const GFS> gfs)
312  : BaseT(gfs)
313  {}
314 
315  protected:
317 
329  template<typename NodeType>
330  void bind (NodeType& node, const typename Traits::Element& e);
331  };
332 
333  template <typename GFS, typename DOFIndex>
334  template <typename NodeType>
337  {
339  assert(&node == this);
340 
341  // compute sizes
342  ComputeSizeVisitor<Element> csv(e);
343  TypeTree::applyToTree(node,csv);
344 
345 
346  // initialize iterators and fill indices
347  FillIndicesVisitor<Element> fiv(e);
348  TypeTree::applyToTree(node,fiv);
349  }
350 
351  //=======================================
352  // local function space base: power implementation
353  //=======================================
354 
356  template<typename GFS, typename DOFIndex, typename N>
358  {
360  typedef N NodeType;
361  };
362 
363  // local function space for a power grid function space
364  template<typename GFS, typename DOFIndex, typename ChildLFS, std::size_t k>
366  public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>,
367  public TypeTree::PowerNode<ChildLFS,k>
368  {
370  typedef TypeTree::PowerNode<ChildLFS,k> TreeNode;
371 
372  template<typename>
373  friend struct PropagateGlobalStorageVisitor;
374 
375  template<typename>
376  friend struct ClearSizeVisitor;
377 
378  template<typename>
379  friend struct ComputeSizeVisitor;
380 
381  template<typename>
382  friend struct FillIndicesVisitor;
383 
384  public:
386 
388 
390  template<typename Transformation>
391  PowerLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
392  const Transformation& t,
393  const std::array<std::shared_ptr<ChildLFS>,k>& children)
394  : BaseT(gfs)
395  , TreeNode(children)
396  {}
397 
398  template<typename Transformation>
400  const Transformation& t,
401  const std::array<std::shared_ptr<ChildLFS>,k>& children)
402  : BaseT(stackobject_to_shared_ptr(gfs))
403  , TreeNode(children)
404  {}
405 
407  void bind (const typename Traits::Element& e)
408  {
409  // call method on base class, this avoid the barton neckman trick
410  BaseT::bind(*this,e);
411  }
412 
413  };
414 
415 
416  // transformation template, we need a custom template in order to inject the DOFIndex type into the LocalFunctionSpace
417  template<typename SourceNode, typename Transformation>
419  {
420  template<typename TC>
421  struct result
422  {
424  };
425  };
426 
427  // register PowerGFS -> LocalFunctionSpace transformation
428  template<typename PowerGridFunctionSpace, typename Params>
429  TypeTree::TemplatizedGenericPowerNodeTransformation<
431  gfs_to_lfs<Params>,
433  >
434  registerNodeTransformation(PowerGridFunctionSpace* pgfs, gfs_to_lfs<Params>* t, PowerGridFunctionSpaceTag* tag);
435 
436 
437  //=======================================
438  // local function space base: composite implementation
439  //=======================================
440 
441  // local function space for a power grid function space
442  template<typename GFS, typename DOFIndex, typename... Children>
444  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
445  , public TypeTree::CompositeNode<Children...>
446  {
448  typedef TypeTree::CompositeNode<Children...> NodeType;
449 
450  template<typename>
451  friend struct PropagateGlobalStorageVisitor;
452 
453  template<typename>
454  friend struct ClearSizeVisitor;
455 
456  template<typename>
457  friend struct ComputeSizeVisitor;
458 
459  template<typename>
460  friend struct FillIndicesVisitor;
461 
462  public:
464 
466 
467  template<typename Transformation>
468  CompositeLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs,
469  const Transformation& t,
470  std::shared_ptr<Children>... children)
471  : BaseT(gfs)
472  , NodeType(children...)
473  {}
474 
475  template<typename Transformation>
477  const Transformation& t,
478  std::shared_ptr<Children>... children)
479  : BaseT(stackobject_to_shared_ptr(gfs))
480  , NodeType(children...)
481  {}
482 
484  void bind (const typename Traits::Element& e)
485  {
486  // call method on base class, this avoid the barton neckman trick
487  BaseT::bind(*this,e);
488  }
489 
490  };
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>
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  TypeTree::TemplatizedGenericCompositeNodeTransformation<
507  gfs_to_lfs<Params>,
509  >
510  registerNodeTransformation(CompositeGridFunctionSpace* cgfs, gfs_to_lfs<Params>* t, CompositeGridFunctionSpaceTag* tag);
511 
512 
513  //=======================================
514  // local function space base: single component implementation
515  //=======================================
516 
518  template<typename GFS, typename DOFIndex, typename N>
520  {
522  typedef typename GFS::Traits::FiniteElementType FiniteElementType;
523 
524  typedef typename GFS::Traits::FiniteElementType FiniteElement;
525 
527  typedef typename GFS::Traits::ConstraintsType ConstraintsType;
528 
529  typedef typename GFS::Traits::ConstraintsType Constraints;
530 
531  };
532 
534  template<typename GFS, typename DOFIndex>
536  : public GridViewLocalFunctionSpaceBaseNode<GFS,DOFIndex>
537  , public TypeTree::LeafNode
538  {
540 
541  template<typename>
542  friend struct PropagateGlobalStorageVisitor;
543 
544  template<typename>
545  friend struct ClearSizeVisitor;
546 
547  template<typename>
548  friend struct ComputeSizeVisitor;
549 
550  template<typename>
551  friend struct FillIndicesVisitor;
552 
553  public:
555 
557 
558  private:
559  typedef FiniteElementInterfaceSwitch<
560  typename Traits::FiniteElementType
561  > FESwitch;
562 
563  public:
564 
566  template<typename Transformation>
567  LeafLocalFunctionSpaceNode (std::shared_ptr<const GFS> gfs, const Transformation& t)
568  : BaseT(gfs)
569  {
570  }
571 
572  template<typename Transformation>
573  LeafLocalFunctionSpaceNode (const GFS& gfs, const Transformation& t)
574  : BaseT(stackobject_to_shared_ptr(gfs))
575  {
576  }
577 
579  const typename Traits::FiniteElementType& finiteElement () const
580  {
581  return *pfe;
582  }
583 
585  const typename Traits::ConstraintsType& constraints () const
586  {
587  return this->pgfs->constraints();
588  }
589 
591  template<typename Entity, typename DOFIndexIterator>
592  void dofIndices(const Entity& e, DOFIndexIterator it, DOFIndexIterator endit)
593  {
594  // get layout of entity
595  const typename FESwitch::Coefficients &coeffs =
596  FESwitch::coefficients(*pfe);
597 
598  using EntitySet = typename GFS::Traits::EntitySet;
599  auto es = this->gridFunctionSpace().entitySet();
600 
601  const Dune::ReferenceElement<double,EntitySet::dimension>& refEl =
602  Dune::ReferenceElements<double,EntitySet::dimension>::general(this->pfe->type());
603 
604  for (std::size_t i = 0; i < std::size_t(coeffs.size()); ++i, ++it)
605  {
606  // get geometry type of subentity
607  auto gt = refEl.type(coeffs.localKey(i).subEntity(),
608  coeffs.localKey(i).codim());
609 
610  // evaluate consecutive index of subentity
611  auto index = es.indexSet().subIndex(e,
612  coeffs.localKey(i).subEntity(),
613  coeffs.localKey(i).codim());
614 
615  // store data
616  GFS::Ordering::Traits::DOFIndexAccessor::store(*it,gt,index,coeffs.localKey(i).index());
617 
618  // make sure we don't write past the end of the iterator range
619  assert(it != endit);
620  }
621  }
622 
623 
624  template<typename GC, typename LC>
625  void insert_constraints (const LC& lc, GC& gc) const
626  {
627  // LC and GC are maps of maps
628  typedef typename LC::const_iterator local_col_iterator;
629  typedef typename LC::value_type::second_type::const_iterator local_row_iterator;
630  typedef typename GC::iterator global_col_iterator;
631  typedef typename GC::value_type::second_type global_row_type;
632 
633  for (local_col_iterator cit=lc.begin(); cit!=lc.end(); ++cit)
634  {
635 
636  // look up entry in global map, if not found, insert an empty one.
637  global_col_iterator gcit = gc.insert(std::make_pair(std::ref(this->dofIndex(cit->first)),global_row_type())).first;
638 
639  // copy row to global container with transformed indices
640  for (local_row_iterator rit=(cit->second).begin(); rit!=(cit->second).end(); ++rit)
641  gcit->second[this->dofIndex(rit->first)] = rit->second;
642  }
643  }
644 
646  void bind (const typename Traits::Element& e)
647  {
648  // call method on base class, this avoid the barton neckman trick
649  BaseT::bind(*this,e);
650  }
651 
652  // private:
653  typename FESwitch::Store pfe;
654  };
655 
656  // Register LeafGFS -> LocalFunctionSpace transformation
657  template<typename GridFunctionSpace, typename Params>
658  TypeTree::GenericLeafNodeTransformation<
660  gfs_to_lfs<Params>,
662  >
663  registerNodeTransformation(GridFunctionSpace* gfs, gfs_to_lfs<Params>* t, LeafGridFunctionSpaceTag* tag);
664 
665  //=======================================
666  // local function facade
667  //=======================================
668 
669  template <typename GFS, typename TAG=AnySpaceTag>
671 
685  template <typename GFS, typename TAG>
686  class LocalFunctionSpace :
687  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
688  {
689  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
690  typedef typename BaseT::Traits::IndexContainer::size_type I;
691  typedef typename BaseT::Traits::IndexContainer::size_type LocalIndex;
692 
693  template<typename>
694  friend struct PropagateGlobalStorageVisitor;
695 
696  template<typename>
697  friend struct ClearSizeVisitor;
698 
699  template<typename>
700  friend struct ComputeSizeVisitor;
701 
702  template<typename>
703  friend struct FillIndicesVisitor;
704 
705  public:
706  typedef typename BaseT::Traits Traits;
707 
708  LocalFunctionSpace(const GFS & gfs)
709  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
710  {
711  this->setup(*this);
712  }
713 
715  : BaseT(lfs)
716  {
717  // We need to reset the DOFIndex storage pointers in the new LFS tree,
718  // as they are still pointing to the _dof_index_storage of the
719  // old tree.
720  this->_dof_indices = &(this->_dof_index_storage);
721  this->setup(*this);
722  }
723 
724  LocalIndex localIndex (typename Traits::IndexContainer::size_type index) const
725  {
726  return LocalIndex(BaseT::localIndex(index));
727  }
728 
729  private:
730  // we don't support getChild yet, so let's hide it!
731  template<int i>
732  void getChild () const;
733  template<int i>
734  void child () const;
735  };
736 
737  // specialization for AnySpaceTag
738  // WARNING: If you modify this class, make sure to also fix the specialization in
739  // subspacelocalfunctionspace.hh!
740  template <typename GFS>
742  public TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type
743  {
744  typedef typename TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::Type BaseT;
745 
746  template<typename>
747  friend struct PropagateGlobalStorageVisitor;
748 
749  template<typename>
750  friend struct ClearSizeVisitor;
751 
752  template<typename>
753  friend struct ComputeSizeVisitor;
754 
755  template<typename>
756  friend struct FillIndicesVisitor;
757 
758  public:
759 
760  LocalFunctionSpace(const GFS & gfs)
761  : BaseT(TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform(gfs))
762  {
763  this->_dof_indices = &(this->_dof_index_storage);
764  this->setup(*this);
765  }
766 
767  LocalFunctionSpace(std::shared_ptr<const GFS> pgfs)
768  : BaseT(*TypeTree::TransformTree<GFS,gfs_to_lfs<GFS> >::transform_storage(pgfs))
769  {
770  this->_dof_indices = &(this->_dof_index_storage);
771  this->setup(*this);
772  }
773 
775  : BaseT(lfs)
776  {
777  // We need to reset the DOFIndex storage pointers in the new LFS tree,
778  // as they are still pointing to the _dof_index_storage of the
779  // old tree.
780  this->_dof_indices = &(this->_dof_index_storage);
781  this->setup(*this);
782  }
783 
784  };
785 
787  } // namespace PDELab
788 } // namespace Dune
789 
790 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_LOCALFUNCTIONSPACE_HH
PowerLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:387
LeafLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t)
initialize with grid function space
Definition: localfunctionspace.hh:567
Traits::IndexContainer::size_type n
Definition: localfunctionspace.hh:280
Traits::IndexContainer::size_type size() const
get current size
Definition: localfunctionspace.hh:206
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, PowerLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:385
base class for tuples of grid function spaces product of identical grid function spaces base class th...
Definition: powergridfunctionspace.hh:40
Traits::DOFIndexContainer _dof_index_storage
Definition: localfunctionspace.hh:278
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:391
LocalIndex localIndex(typename Traits::IndexContainer::size_type index) const
Definition: localfunctionspace.hh:724
Traits::IndexContainer::size_type offset
Definition: localfunctionspace.hh:281
GFS::Traits::GridViewType GridViewType
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:289
GFS::Traits::FiniteElementType FiniteElement
Definition: localfunctionspace.hh:524
LocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:195
GFS::Traits::SizeType SizeType
Type to store indices from Backend.
Definition: localfunctionspace.hh:164
Definition: localfunctionspace.hh:301
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:774
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:197
traits mapping global function space information to local function space
Definition: localfunctionspace.hh:155
GFS GridFunctionSpaceType
Type of the underlying grid function space.
Definition: localfunctionspace.hh:158
PowerLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC, TypeTree::StaticDegree< SourceNode >::value > type
Definition: localfunctionspace.hh:423
typename GFS::Traits::EntitySet EntitySet
Definition: localfunctionspace.hh:294
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:708
void debug() const
print debug information about this local function space
Definition: localfunctionspace.hh:255
Definition: gridfunctionspace/tags.hh:26
Definition: localfunctionspace.hh:443
LeafLocalFunctionSpaceTraits< GFS, DOFIndex, LeafLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:554
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
Definition: localfunctionspace.hh:365
BaseT::Traits Traits
Definition: localfunctionspace.hh:706
std::shared_ptr< GFS const > pgfs
Definition: localfunctionspace.hh:277
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
GridViewLocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:311
GridViewLocalFunctionSpaceBaseTraits< GFS, DOFIndex > Traits
Definition: localfunctionspace.hh:308
Create a local function space from a global function space.
Definition: localfunctionspace.hh:670
Definition: gridfunctionspace/tags.hh:30
Definition: localfunctionspace.hh:497
CompositeLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:465
GFS::Traits::ConstraintsType ConstraintsType
Type of constraints engine.
Definition: localfunctionspace.hh:527
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)
std::vector< SizeType > IndexContainer
Type of container to store indices.
Definition: localfunctionspace.hh:167
FESwitch::Store pfe
Definition: localfunctionspace.hh:653
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:646
traits for local function space on a gridview
Definition: localfunctionspace.hh:286
void dofIndices(const Entity &e, DOFIndexIterator it, DOFIndexIterator endit)
Calculates the multiindices associated with the given entity.
Definition: localfunctionspace.hh:592
CompositeLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:476
LocalFunctionSpaceBaseNode(std::shared_ptr< const GFS > gfs)
construct from global function space
Definition: localfunctionspace.hh:198
Definition: localfunctionspacetags.hh:40
const Entity & e
Definition: localfunctionspace.hh:111
LocalFunctionSpace(std::shared_ptr< const GFS > pgfs)
Definition: localfunctionspace.hh:767
GFS::Traits::ConstraintsType Constraints
Definition: localfunctionspace.hh:529
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:194
CompositeLocalFunctionSpaceNode< SourceNode, typename Transformation::DOFIndex, TC... > type
Definition: localfunctionspace.hh:499
const Traits::DOFIndex & dofIndex(typename Traits::IndexContainer::size_type index) const
Maps given index in this local function space to its corresponding global MultiIndex.
Definition: localfunctionspace.hh:249
GFS GridFunctionSpace
Type of the underlying grid function space.
Definition: localfunctionspace.hh:161
GFS::Traits::FiniteElementType FiniteElementType
Type of local finite element.
Definition: localfunctionspace.hh:522
CompositeLocalFunctionSpaceNode(std::shared_ptr< const GFS > gfs, const Transformation &t, std::shared_ptr< Children >... children)
Definition: localfunctionspace.hh:468
A grid function space.
Definition: gridfunctionspace.hh:169
Definition: localfunctionspace.hh:421
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:407
traits for multi component local function space
Definition: localfunctionspace.hh:357
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:200
Definition: localfunctionspace.hh:178
LeafLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t)
Definition: localfunctionspace.hh:573
single component local function space
Definition: localfunctionspace.hh:535
Traits::IndexContainer::size_type localVectorSize() const
get size of an appropriate local vector object
Definition: localfunctionspace.hh:230
Definition: localfunctionspace.hh:494
Traits::IndexContainer::size_type maxSize() const
get maximum possible size (which is maxLocalSize from grid function space)
Definition: localfunctionspace.hh:217
Definition: localfunctionspace.hh:418
typename EntitySet::Element Element
Type of codim 0 entity in the grid.
Definition: localfunctionspace.hh:297
std::vector< DI > DOFIndexContainer
Type of container to store multiindices.
Definition: localfunctionspace.hh:173
const Traits::FiniteElementType & finiteElement() const
get finite element
Definition: localfunctionspace.hh:579
PowerCompositeLocalFunctionSpaceTraits< GFS, DOFIndex, CompositeLocalFunctionSpaceNode > Traits
Definition: localfunctionspace.hh:463
void bind(const typename Traits::Element &e)
bind local function space to entity
Definition: localfunctionspace.hh:484
Definition: lfsindexcache.hh:240
DI DOFIndex
Type of MultiIndex associated with this LocalFunctionSpace.
Definition: localfunctionspace.hh:170
LeafLocalFunctionSpaceTag ImplementationTag
Definition: localfunctionspace.hh:556
Definition: gridfunctionspace/tags.hh:32
traits for single component local function space
Definition: localfunctionspace.hh:519
const GFS & gridFunctionSpace() const
Returns the GridFunctionSpace underlying this LocalFunctionSpace.
Definition: localfunctionspace.hh:264
Traits::DOFIndexContainer * _dof_indices
Definition: localfunctionspace.hh:279
LocalFunctionSpace(const LocalFunctionSpace &lfs)
Definition: localfunctionspace.hh:714
const Traits::ConstraintsType & constraints() const
get constraints engine
Definition: localfunctionspace.hh:585
void setup(NodeType &node)
Definition: localfunctionspace.hh:271
LocalFunctionSpace(const GFS &gfs)
Definition: localfunctionspace.hh:760
void bind(NodeType &node, const typename Traits::Element &e)
bind local function space to entity
const std::size_t offset
Definition: localfunctionspace.hh:74
void insert_constraints(const LC &lc, GC &gc) const
Definition: localfunctionspace.hh:625
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:146
GFS::Traits::GridViewType GridView
Type of the grid view that the underlying grid function space is defined on.
Definition: localfunctionspace.hh:292
N NodeType
type of local function space node
Definition: localfunctionspace.hh:360
PowerLocalFunctionSpaceNode(const GFS &gfs, const Transformation &t, const std::array< std::shared_ptr< ChildLFS >, k > &children)
Definition: localfunctionspace.hh:399
std::size_t subSpaceDepth() const
Definition: localfunctionspace.hh:211