DUNE-FEM (unstable)

pk1d.hh
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_PK1DLOCALFINITEELEMENT_HH
6#define DUNE_PK1DLOCALFINITEELEMENT_HH
7
8#include <cstddef>
9
10#include <dune/geometry/type.hh>
11
12#include <dune/localfunctions/common/localfiniteelementtraits.hh>
13#include <dune/localfunctions/common/localtoglobaladaptors.hh>
14#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
15
16namespace Dune
17{
18
19
21
28 template<class Geometry, class RF, std::size_t k>
30 typedef typename Geometry::ctype DF;
31 typedef Impl::LagrangeSimplexLocalBasis<DF,RF,1,k> LocalBasis;
32 typedef Impl::LagrangeSimplexLocalInterpolation<LocalBasis> LocalInterpolation;
33
34 public:
38 struct Traits {
41 LocalInterpolation,
42 typename Basis::Traits
43 > Interpolation;
44 typedef Impl::LagrangeSimplexLocalCoefficients<1,k> Coefficients;
45 };
46
47 private:
48 static const GeometryType gt;
49 static const LocalBasis localBasis;
50 static const LocalInterpolation localInterpolation;
51
52 typename Traits::Basis basis_;
53 typename Traits::Interpolation interpolation_;
54 typename Traits::Coefficients coefficients_;
55
56 public:
58
71 template<class VertexOrder>
72 Pk1DFiniteElement(const Geometry &geometry,
73 const VertexOrder& vertexOrder) :
74 basis_(localBasis, geometry), interpolation_(localInterpolation),
75 coefficients_(vertexOrder.begin(0, 0))
76 { }
77
78 const typename Traits::Basis& basis() const { return basis_; }
79 const typename Traits::Interpolation& interpolation() const
80 { return interpolation_; }
81 const typename Traits::Coefficients& coefficients() const
82 { return coefficients_; }
83 const GeometryType &type() const { return gt; }
84 };
85
86 template<class Geometry, class RF, std::size_t k>
87 const GeometryType
88 Pk1DFiniteElement<Geometry, RF, k>::gt(GeometryTypes::simplex(2));
89
90 template<class Geometry, class RF, std::size_t k>
91 const typename Pk1DFiniteElement<Geometry, RF, k>::LocalBasis
92 Pk1DFiniteElement<Geometry, RF, k>::localBasis = LocalBasis();
93
94 template<class Geometry, class RF, std::size_t k>
95 const typename Pk1DFiniteElement<Geometry, RF, k>::LocalInterpolation
96 Pk1DFiniteElement<Geometry, RF, k>::localInterpolation =
97 LocalInterpolation();
98
100
110 template<class Geometry, class RF, std::size_t k>
113
115
129 template<class VertexOrder>
130 const FiniteElement make(const Geometry& geometry,
131 const VertexOrder& vertexOrder)
132 { return FiniteElement(geometry, vertexOrder); }
133 };
134}
135
136#endif
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Wrapper class for geometries.
Definition: geometry.hh:71
GridImp::ctype ctype
define type used for coordinates in grid module
Definition: geometry.hh:100
Convert a local interpolation into a global interpolation.
Definition: localtoglobaladaptors.hh:149
Langrange finite element of arbitrary order on triangles.
Definition: pk1d.hh:29
Pk1DFiniteElement(const Geometry &geometry, const VertexOrder &vertexOrder)
construct a Pk1DFiniteElement
Definition: pk1d.hh:72
Convert a simple scalar local basis into a global basis.
Definition: localtoglobaladaptors.hh:65
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:158
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:453
Dune namespace.
Definition: alignedallocator.hh:13
Dummy struct used for documentation purposes.
Definition: documentation.hh:42
Factory for Pk1DFiniteElement objects.
Definition: pk1d.hh:111
const FiniteElement make(const Geometry &geometry, const VertexOrder &vertexOrder)
construct Pk1DFiniteElementFactory
Definition: pk1d.hh:130
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 (Nov 12, 23:30, 2024)