Dune Core Modules (2.8.0)

pq22d.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_PQ22DLOCALFINITEELEMENT_HH
4#define DUNE_PQ22DLOCALFINITEELEMENT_HH
5
7
8#include <dune/localfunctions/common/localfiniteelementvariant.hh>
9
10#include <dune/localfunctions/lagrange/lagrangesimplex.hh>
11#include <dune/localfunctions/lagrange/lagrangecube.hh>
12
13namespace Dune
14{
15 template<class D, class R>
16 class PQ22DLocalFiniteElement
17 {
18 using LFEVariant = LocalFiniteElementVariant<LagrangeSimplexLocalFiniteElement<D,R,2,2>,
19 LagrangeCubeLocalFiniteElement<D,R,2,2> >;
20 public:
21 using Traits = typename LFEVariant::Traits;
22
23 PQ22DLocalFiniteElement ( const GeometryType &gt )
24 {
25 if ( gt.isTriangle() )
26 lfeVariant_ = LagrangeSimplexLocalFiniteElement<D,R,2,2>();
27 else if ( gt.isQuadrilateral() )
28 lfeVariant_ = LagrangeCubeLocalFiniteElement<D,R,2,2>();
29 }
30
31 PQ22DLocalFiniteElement ( const GeometryType &gt, const std::vector<unsigned int> vertexmap )
32 {
33 if ( gt.isTriangle() )
34 lfeVariant_ = LagrangeSimplexLocalFiniteElement<D,R,2,2>(vertexmap);
35 else if ( gt.isQuadrilateral() )
36 lfeVariant_ = LagrangeCubeLocalFiniteElement<D,R,2,2>();
37 }
38
39 const typename Traits::LocalBasisType& localBasis () const
40 {
41 return lfeVariant_.localBasis();
42 }
43
44 const typename Traits::LocalCoefficientsType& localCoefficients () const
45 {
46 return lfeVariant_.localCoefficients();
47 }
48
49 const typename Traits::LocalInterpolationType& localInterpolation () const
50 {
51 return lfeVariant_.localInterpolation();
52 }
53
55 unsigned int size () const
56 {
57 return lfeVariant_.size();
58 }
59
60 GeometryType type () const
61 {
62 return lfeVariant_.type();
63 }
64
65 private:
66
67 LFEVariant lfeVariant_;
68 };
69
70}
71
72#endif
typename Dune::LocalFiniteElementTraits< LocalBasis, LocalCoefficients, LocalInterpolation > Traits
Export LocalFiniteElementTraits.
Definition: localfiniteelementvariant.hh:267
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:130
Implements a matrix constructed from a given type representing a field and compile-time given number ...
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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)