Dune Core Modules (2.7.1)

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 #ifndef DUNE_PK1DLOCALFINITEELEMENT_HH
4 #define DUNE_PK1DLOCALFINITEELEMENT_HH
5 
6 #include <cstddef>
7 
8 #include <dune/geometry/type.hh>
9 
10 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
11 #include <dune/localfunctions/common/localtoglobaladaptors.hh>
12 #include <dune/localfunctions/lagrange/lagrangesimplex.hh>
13 
14 namespace 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,1,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<1,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  Pk1DFiniteElement(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  Pk1DFiniteElement<Geometry, RF, k>::gt(GeometryTypes::simplex(2));
94 
95  template<class Geometry, class RF, std::size_t k>
96  const typename Pk1DFiniteElement<Geometry, RF, k>::LocalBasis
97  Pk1DFiniteElement<Geometry, RF, k>::localBasis = LocalBasis();
98 
99  template<class Geometry, class RF, std::size_t k>
100  const typename Pk1DFiniteElement<Geometry, RF, k>::LocalInterpolation
101  Pk1DFiniteElement<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:279
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: pk1d.hh:34
Pk1DFiniteElement(const Geometry &geometry, const VertexOrder &vertexOrder)
construct a Pk1DFiniteElement
Definition: pk1d.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:180
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:766
Dune namespace.
Definition: alignedallocator.hh:14
Dummy struct used for documentation purposes.
Definition: documentation.hh:40
Factory for Pk1DFiniteElement objects.
Definition: pk1d.hh:116
const FiniteElement make(const Geometry &geometry, const VertexOrder &vertexOrder)
construct Pk1DFiniteElementFactory
Definition: pk1d.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.80.0 (May 16, 22:29, 2024)