DUNE PDELab (2.8)

powerfem.hh
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
11#include <dune/pdelab/finiteelementmap/finiteelementmap.hh>
12
13namespace Dune {
14 namespace PDELab {
15
17
22 template<class BackendFEM, std::size_t dimR>
24 {
25 typedef typename BackendFEM::Traits::FiniteElementType BackendFE;
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
FiniteElementMap for PowerFiniteElements.
Definition: powerfem.hh:24
PowerFiniteElementMap(const BackendFEM &backend_)
construct PowerFiniteElementMap
Definition: powerfem.hh:52
static constexpr int dimension
The dimension of the finite elements returned by this map.
Definition: powerfem.hh:38
Traits::FiniteElementType find(const Element &e) const
Return finite element for the given entity.
Definition: powerfem.hh:62
FiniteElementMapTraits< typename Factory::FiniteElement > Traits
export Traits
Definition: powerfem.hh:33
Factory for meta-finite elements turning scalar finite elements into vector-valued ones.
Definition: power.hh:105
const FiniteElement make(const BackendFiniteElement &backend) const
create a finite element
Definition: power.hh:115
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:156
Dune namespace.
Definition: alignedallocator.hh:11
collect types exported by a finite element map
Definition: finiteelementmap.hh:28
T FiniteElementType
Type of finite element from local functions.
Definition: finiteelementmap.hh:30
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)