dune-pdelab  2.7-git
powerfem.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=8 sw=2 sts=2:
3 
4 #ifndef DUNE_PDELAB_FINITEELEMENTMAP_POWERFEM_HH
5 #define DUNE_PDELAB_FINITEELEMENTMAP_POWERFEM_HH
6 
7 #include <cstddef>
8 
9 #include <dune/localfunctions/meta/power.hh>
10 
12 
13 namespace Dune {
14  namespace PDELab {
15 
17 
22  template<class BackendFEM, std::size_t dimR>
24  {
25  typedef typename BackendFEM::Traits::FiniteElementType BackendFE;
26  typedef PowerFiniteElementFactory<BackendFE, dimR> Factory;
27 
28  const BackendFEM &backend;
29  static const Factory factory;
30 
31  public:
34 
35  // This is not backwards compatible, but I don't know of anyone who is using
36  // this thing, so it's probably not much of a problem.
38  static constexpr int dimension = BackendFEM::dimension;
39 
41 
52  PowerFiniteElementMap(const BackendFEM& backend_) : backend(backend_) { }
53 
55 
61  template<class Element>
62  typename Traits::FiniteElementType find(const Element& e) const
63  { return factory.make(backend.find(e)); }
64 
65  bool fixedSize() const
66  {
67  return backend.fixedSize();
68  }
69 
70  bool hasDOFs(int codim) const
71  {
72  return backend.hasDOFs(codim);
73  }
74 
75  std::size_t size(GeometryType gt) const
76  {
77  return dimR * backend.size(gt);
78  }
79 
80  std::size_t maxLocalSize() const
81  {
82  return dimR * backend.maxLocalSize();
83  }
84 
85  };
86 
87  template<class BackendFEM, std::size_t dimR>
88  const typename PowerFiniteElementMap<BackendFEM, dimR>::Factory
89  PowerFiniteElementMap<BackendFEM, dimR>::factory = Factory();
90 
91  } // namespace PDELab
92 } // namespace Dune
93 
94 #endif // DUNE_PDELAB_FINITEELEMENTMAP_POWERFEM_HH
Dune::PDELab::PowerFiniteElementMap::Traits
FiniteElementMapTraits< typename Factory::FiniteElement > Traits
export Traits
Definition: powerfem.hh:33
Dune::PDELab::FiniteElementMapTraits
collect types exported by a finite element map
Definition: finiteelementmap.hh:27
Dune::PDELab::PowerFiniteElementMap::find
Traits::FiniteElementType find(const Element &e) const
Return finite element for the given entity.
Definition: powerfem.hh:62
Dune
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Dune::PDELab::PowerFiniteElementMap
FiniteElementMap for PowerFiniteElements.
Definition: powerfem.hh:23
Dune::PDELab::PowerFiniteElementMap::dimension
static constexpr int dimension
The dimension of the finite elements returned by this map.
Definition: powerfem.hh:38
Dune::PDELab::PowerFiniteElementMap::fixedSize
bool fixedSize() const
Definition: powerfem.hh:65
Dune::PDELab::PowerFiniteElementMap::size
std::size_t size(GeometryType gt) const
Definition: powerfem.hh:75
e
const Entity & e
Definition: localfunctionspace.hh:121
Dune::PDELab::PowerFiniteElementMap::hasDOFs
bool hasDOFs(int codim) const
Definition: powerfem.hh:70
finiteelementmap.hh
Dune::PDELab::PowerFiniteElementMap::PowerFiniteElementMap
PowerFiniteElementMap(const BackendFEM &backend_)
construct PowerFiniteElementMap
Definition: powerfem.hh:52
Dune::PDELab::FiniteElementMapTraits::FiniteElementType
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
Dune::PDELab::PowerFiniteElementMap::maxLocalSize
std::size_t maxLocalSize() const
Definition: powerfem.hh:80