Dune Core Modules (2.6.0)

pk2d.hh
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_PK2DLOCALFINITEELEMENT_HH
4#define DUNE_PK2DLOCALFINITEELEMENT_HH
5
6#include <cstddef>
7
9
10#include <dune/localfunctions/common/localfiniteelementtraits.hh>
11#include <dune/localfunctions/common/localtoglobaladaptors.hh>
12#include "pk2d/pk2dlocalbasis.hh"
13#include "pk2d/pk2dlocalcoefficients.hh"
14#include "pk2d/pk2dlocalinterpolation.hh"
15
16namespace Dune
17{
18
21 template<class D, class R, unsigned int k>
23 {
24 public:
29 Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,k> > > Traits;
30
34 {}
35
38 Pk2DLocalFiniteElement (int variant) :
39 coefficients(variant)
40 {}
41
48 Pk2DLocalFiniteElement (const unsigned int vertexmap[3]) :
49 coefficients(vertexmap)
50 {}
51
54 const typename Traits::LocalBasisType& localBasis () const
55 {
56 return basis;
57 }
58
62 {
63 return coefficients;
64 }
65
69 {
70 return interpolation;
71 }
72
74 unsigned int size () const
75 {
76 return basis.size();
77 }
78
81 static constexpr GeometryType type ()
82 {
84 }
85
86 private:
88 Pk2DLocalCoefficients<k> coefficients;
89 Pk2DLocalInterpolation<Pk2DLocalBasis<D,R,k> > interpolation;
90 };
91
93
100 template<class Geometry, class RF, std::size_t k>
102 typedef typename Geometry::ctype DF;
104 typedef Pk2DLocalInterpolation<LocalBasis> LocalInterpolation;
105
106 public:
110 struct Traits {
113 LocalInterpolation,
114 typename Basis::Traits
115 > Interpolation;
116 typedef Pk2DLocalCoefficients<k> Coefficients;
117 };
118
119 private:
120 static const GeometryType gt;
121 static const LocalBasis localBasis;
122 static const LocalInterpolation localInterpolation;
123
124 typename Traits::Basis basis_;
125 typename Traits::Interpolation interpolation_;
126 typename Traits::Coefficients coefficients_;
127
128 public:
130
143 template<class VertexOrder>
145 const VertexOrder& vertexOrder) :
146 basis_(localBasis, geometry), interpolation_(localInterpolation),
147 coefficients_(vertexOrder.begin(0, 0))
148 { }
149
150 const typename Traits::Basis& basis() const { return basis_; }
151 const typename Traits::Interpolation& interpolation() const
152 { return interpolation_; }
153 const typename Traits::Coefficients& coefficients() const
154 { return coefficients_; }
155 const GeometryType &type() const { return gt; }
156 };
157
158 template<class Geometry, class RF, std::size_t k>
159 const GeometryType
160 Pk2DFiniteElement<Geometry, RF, k>::gt(GeometryTypes::simplex(2));
161
162 template<class Geometry, class RF, std::size_t k>
163 const typename Pk2DFiniteElement<Geometry, RF, k>::LocalBasis
164 Pk2DFiniteElement<Geometry, RF, k>::localBasis = LocalBasis();
165
166 template<class Geometry, class RF, std::size_t k>
167 const typename Pk2DFiniteElement<Geometry, RF, k>::LocalInterpolation
168 Pk2DFiniteElement<Geometry, RF, k>::localInterpolation =
169 LocalInterpolation();
170
172
182 template<class Geometry, class RF, std::size_t k>
185
187
201 template<class VertexOrder>
202 const FiniteElement make(const Geometry& geometry,
203 const VertexOrder& vertexOrder)
204 { return FiniteElement(geometry, vertexOrder); }
205 };
206}
207
208#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:277
Wrapper class for geometries.
Definition: geometry.hh:67
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: geometry.hh:95
Convert a local interpolation into a global interpolation.
Definition: localtoglobaladaptors.hh:147
Langrange finite element of arbitrary order on triangles.
Definition: pk2d.hh:101
Pk2DFiniteElement(const Geometry &geometry, const VertexOrder &vertexOrder)
construct a Pk2DFiniteElement
Definition: pk2d.hh:144
Lagrange shape functions of arbitrary order on the reference triangle.
Definition: pk2dlocalbasis.hh:28
Layout map for P0 elements.
Definition: pk2dlocalcoefficients.hh:23
Definition: pk2d.hh:23
unsigned int size() const
Number of shape functions in this finite element.
Definition: pk2d.hh:74
Pk2DLocalFiniteElement(int variant)
Definition: pk2d.hh:38
const Traits::LocalInterpolationType & localInterpolation() const
Definition: pk2d.hh:68
const Traits::LocalBasisType & localBasis() const
Definition: pk2d.hh:54
LocalFiniteElementTraits< Pk2DLocalBasis< D, R, k >, Pk2DLocalCoefficients< k >, Pk2DLocalInterpolation< Pk2DLocalBasis< D, R, k > > > Traits
Definition: pk2d.hh:29
static constexpr GeometryType type()
Definition: pk2d.hh:81
const Traits::LocalCoefficientsType & localCoefficients() const
Definition: pk2d.hh:61
Pk2DLocalFiniteElement(const unsigned int vertexmap[3])
Definition: pk2d.hh:48
Pk2DLocalFiniteElement()
Definition: pk2d.hh:33
Convert a simple scalar local basis into a global basis.
Definition: localtoglobaladaptors.hh:63
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:147
constexpr GeometryType triangle
GeometryType representing a triangle.
Definition: type.hh:739
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:696
Dune namespace.
Definition: alignedallocator.hh:10
Dummy struct used for documentation purposes.
Definition: documentation.hh:40
traits helper struct
Definition: localfiniteelementtraits.hh:11
LB LocalBasisType
Definition: localfiniteelementtraits.hh:14
LC LocalCoefficientsType
Definition: localfiniteelementtraits.hh:18
LI LocalInterpolationType
Definition: localfiniteelementtraits.hh:22
Factory for Pk2DFiniteElement objects.
Definition: pk2d.hh:183
const FiniteElement make(const Geometry &geometry, const VertexOrder &vertexOrder)
construct Pk2DFiniteElementFactory
Definition: pk2d.hh:202
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 26, 23:30, 2024)