Dune Core Modules (2.8.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 <dune/localfunctions/lagrange/lagrangesimplex.hh>
13
14namespace Dune
15{
16
21 template<class D, class R, unsigned int k>
23
24
26
33 template<class Geometry, class RF, std::size_t k>
35 typedef typename Geometry::ctype DF;
36 typedef Impl::LagrangeSimplexLocalBasis<DF,RF,2,k> LocalBasis;
37 typedef Impl::LagrangeSimplexLocalInterpolation<LocalBasis> LocalInterpolation;
38
39 public:
43 struct Traits {
46 LocalInterpolation,
47 typename Basis::Traits
48 > Interpolation;
49 typedef Impl::LagrangeSimplexLocalCoefficients<2,k> Coefficients;
50 };
51
52 private:
53 static const GeometryType gt;
54 static const LocalBasis localBasis;
55 static const LocalInterpolation localInterpolation;
56
57 typename Traits::Basis basis_;
58 typename Traits::Interpolation interpolation_;
59 typename Traits::Coefficients coefficients_;
60
61 public:
63
76 template<class VertexOrder>
77 Pk2DFiniteElement(const Geometry &geometry,
78 const VertexOrder& vertexOrder) :
79 basis_(localBasis, geometry), interpolation_(localInterpolation),
80 coefficients_(vertexOrder.begin(0, 0))
81 { }
82
83 const typename Traits::Basis& basis() const { return basis_; }
84 const typename Traits::Interpolation& interpolation() const
85 { return interpolation_; }
86 const typename Traits::Coefficients& coefficients() const
87 { return coefficients_; }
88 const GeometryType &type() const { return gt; }
89 };
90
91 template<class Geometry, class RF, std::size_t k>
92 const GeometryType
93 Pk2DFiniteElement<Geometry, RF, k>::gt(GeometryTypes::simplex(2));
94
95 template<class Geometry, class RF, std::size_t k>
96 const typename Pk2DFiniteElement<Geometry, RF, k>::LocalBasis
97 Pk2DFiniteElement<Geometry, RF, k>::localBasis = LocalBasis();
98
99 template<class Geometry, class RF, std::size_t k>
100 const typename Pk2DFiniteElement<Geometry, RF, k>::LocalInterpolation
101 Pk2DFiniteElement<Geometry, RF, k>::localInterpolation =
102 LocalInterpolation();
103
105
115 template<class Geometry, class RF, std::size_t k>
118
120
134 template<class VertexOrder>
135 const FiniteElement make(const Geometry& geometry,
136 const VertexOrder& vertexOrder)
137 { return FiniteElement(geometry, vertexOrder); }
138 };
139}
140
141#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:123
Wrapper class for geometries.
Definition: geometry.hh:67
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: geometry.hh:95
Lagrange finite element for simplices with arbitrary compile-time dimension and polynomial order.
Definition: lagrangesimplex.hh:836
Convert a local interpolation into a global interpolation.
Definition: localtoglobaladaptors.hh:147
Langrange finite element of arbitrary order on triangles.
Definition: pk2d.hh:34
Pk2DFiniteElement(const Geometry &geometry, const VertexOrder &vertexOrder)
construct a Pk2DFiniteElement
Definition: pk2d.hh:77
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:130
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:156
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:461
Dune namespace.
Definition: alignedallocator.hh:11
Dummy struct used for documentation purposes.
Definition: documentation.hh:40
Factory for Pk2DFiniteElement objects.
Definition: pk2d.hh:116
const FiniteElement make(const Geometry &geometry, const VertexOrder &vertexOrder)
construct Pk2DFiniteElementFactory
Definition: pk2d.hh:135
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 22, 23:30, 2024)