Debian Codegraph @

dune/localfunctions/hierarchical/hierarchicalp2.hh

raw
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_HIERARCHICAL_P2_LOCALFINITEELEMENT_HH
6 #define DUNE_HIERARCHICAL_P2_LOCALFINITEELEMENT_HH
7
8 #include <dune/geometry/type.hh>
9
10 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
11 #include <dune/localfunctions/lagrange/lagrangesimplex.hh>
12
13 #include "hierarchicalp2/hierarchicalsimplexp2localbasis.hh"
14 #include "hierarchicalp2/hierarchicalsimplexp2localinterpolation.hh"
15
16 namespace Dune
17 {
18
19 /** \todo Please doc me !
20 */
21 template<class D, class R, int dim>
22 class HierarchicalP2LocalFiniteElement
23 {
24
25 static_assert(1 <= dim && dim <= 3,
26 "HierarchicalP2LocalFiniteElement only implemented for dim==1, 2, 3.");
27
28 public:
29 /** \todo Please doc me !
30 */
31 typedef LocalFiniteElementTraits<
32 HierarchicalSimplexP2LocalBasis<D,R,dim>,
33 typename LagrangeSimplexLocalFiniteElement<D,R,dim,2>::Traits::LocalCoefficientsType,
34 HierarchicalSimplexP2LocalInterpolation<HierarchicalSimplexP2LocalBasis<D,R,dim> > > Traits;
35
36 /** \todo Please doc me !
37 */
38 HierarchicalP2LocalFiniteElement ()
39 {}
40
41 /** \todo Please doc me !
42 */
43 const typename Traits::LocalBasisType& localBasis () const
44 {
45 return basis;
46 }
47
48 /** \todo Please doc me !
49 */
50 const typename Traits::LocalCoefficientsType& localCoefficients () const
51 {
52 return coefficients;
53 }
54
55 /** \todo Please doc me !
56 */
57 const typename Traits::LocalInterpolationType& localInterpolation () const
58 {
59 return interpolation;
60 }
61
62 /** \brief Number of shape functions in this finite element */
63 unsigned int size () const
64 {
65 return basis.size();
66 }
67
68 /** \todo Please doc me !
69 */
70 static constexpr GeometryType type ()
71 {
72 return GeometryTypes::simplex(dim);
73 }
74
75 private:
76 HierarchicalSimplexP2LocalBasis<D,R,dim> basis;
77
78 typename Traits::LocalCoefficientsType coefficients;
79
80 HierarchicalSimplexP2LocalInterpolation<HierarchicalSimplexP2LocalBasis<D,R,dim> > interpolation;
81 };
82
83 }
84
85 #endif