dune-functions  2.6-dev
defaultlocalview.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_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
4 #define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
5 
6 
7 #include <tuple>
8 
9 #include <dune/common/concept.hh>
10 
12 
13 
14 
15 namespace Dune {
16 namespace Functions {
17 
18 
19 
21 template<class GB>
23 {
24  using PrefixPath = TypeTree::HybridTreePath<>;
25 
26 public:
27 
29  using GlobalBasis = GB;
30 
32  using GridView = typename GlobalBasis::GridView;
33 
35  using Element = typename GridView::template Codim<0>::Entity;
36 
38  using size_type = std::size_t;
39 
41  using Tree = typename GlobalBasis::PreBasis::template Node<PrefixPath>;
42 
46  tree_(globalBasis_->preBasis().node(PrefixPath()))
47  {
48  static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
50  }
51 
57  void bind(const Element& e)
58  {
59  element_ = e;
61  }
62 
67  const Element& element() const
68  {
69  return element_;
70  }
71 
76  void unbind()
77  {}
78 
83  const Tree& tree() const
84  {
85  return tree_;
86  }
87 
90  size_type size() const
91  {
92  return tree_.size();
93  }
94 
102  {
103  return globalBasis_->preBasis().maxNodeSize();
104  }
105 
108  const GlobalBasis& globalBasis() const
109  {
110  return *globalBasis_;
111  }
112 
114  {
115  return *this;
116  }
117 
118 protected:
122 };
123 
124 
125 
126 } // end namespace Functions
127 } // end namespace Dune
128 
129 
130 
131 #endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
Dune::Functions::Concept::BasisTree
Definition: concepts.hh:85
Dune::Functions::DefaultLocalView::size
size_type size() const
Total number of degrees of freedom on this element.
Definition: defaultlocalview.hh:90
Dune::Functions::DefaultLocalView::globalBasis_
const GlobalBasis * globalBasis_
Definition: defaultlocalview.hh:119
Dune
Definition: polynomial.hh:7
Dune::Functions::DefaultLocalView::Element
typename GridView::template Codim< 0 >::Entity Element
Type of the grid element we are bound to.
Definition: defaultlocalview.hh:35
Dune::Functions::DefaultLocalView
The restriction of a finite element basis to a single element.
Definition: defaultlocalview.hh:22
Dune::Functions::DefaultLocalView::globalBasis
const GlobalBasis & globalBasis() const
Return the global basis that we are a view on.
Definition: defaultlocalview.hh:108
Dune::Functions::DefaultLocalView::GridView
typename GlobalBasis::GridView GridView
The grid view the global FE basis lives on.
Definition: defaultlocalview.hh:32
concepts.hh
Dune::Functions::DefaultLocalView::maxSize
size_type maxSize() const
Maximum local size for any element on the GridView.
Definition: defaultlocalview.hh:101
Dune::Functions::DefaultLocalView::DefaultLocalView
DefaultLocalView(const GlobalBasis &globalBasis)
Construct local view for a given global finite element basis.
Definition: defaultlocalview.hh:44
Dune::Functions::DefaultLocalView::tree_
Tree tree_
Definition: defaultlocalview.hh:121
Dune::Functions::DefaultLocalView::bind
void bind(const Element &e)
Bind the view to a grid element.
Definition: defaultlocalview.hh:57
Dune::Functions::DefaultLocalView::size_type
std::size_t size_type
The type used for sizes.
Definition: defaultlocalview.hh:38
Dune::Functions::initializeTree
void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
Definition: nodes.hh:274
Dune::Functions::DefaultLocalView::unbind
void unbind()
Unbind from the current element.
Definition: defaultlocalview.hh:76
Dune::Functions::bindTree
void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
Definition: nodes.hh:267
Dune::Functions::DefaultLocalView::GlobalBasis
GB GlobalBasis
The global FE basis that this is a view on.
Definition: defaultlocalview.hh:29
Dune::Functions::DefaultLocalView::element_
Element element_
Definition: defaultlocalview.hh:120
Dune::Functions::DefaultLocalView::Tree
typename GlobalBasis::PreBasis::template Node< PrefixPath > Tree
Tree of local finite elements / local shape function sets.
Definition: defaultlocalview.hh:41
Dune::Functions::DefaultLocalView::element
const Element & element() const
Return the grid element that the view is bound to.
Definition: defaultlocalview.hh:67
Dune::Functions::DefaultLocalView::tree
const Tree & tree() const
Return the local ansatz tree associated to the bound entity.
Definition: defaultlocalview.hh:83
Dune::Functions::DefaultLocalView::rootLocalView
const DefaultLocalView & rootLocalView() const
Definition: defaultlocalview.hh:113