Debian Codegraph @

dune/localfunctions/raviartthomas/raviartthomas2cube2d.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_LOCALFUNCTIONS_RAVIARTTHOMAS2_CUBE2D_LOCALFINITEELEMENT_HH
6 #define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS2_CUBE2D_LOCALFINITEELEMENT_HH
7
8 #include <dune/geometry/type.hh>
9
10 #include "../common/localfiniteelementtraits.hh"
11 #include "raviartthomas2cube2d/raviartthomas2cube2dlocalbasis.hh"
12 #include "raviartthomas2cube2d/raviartthomas2cube2dlocalcoefficients.hh"
13 #include "raviartthomas2cube2d/raviartthomas2cube2dlocalinterpolation.hh"
14
15 namespace Dune
16 {
17 /**
18 * \brief Second order Raviart-Thomas shape functions on cubes.
19 *
20 * \ingroup RaviartThomas
21 *
22 * \tparam D Type to represent the field in the domain.
23 * \tparam R Type to represent the field in the range.
24 */
25 template<class D, class R>
26 class RT2Cube2DLocalFiniteElement
27 {
28
29 public:
30 typedef LocalFiniteElementTraits<
31 RT2Cube2DLocalBasis<D,R>,
32 RT2Cube2DLocalCoefficients,
33 RT2Cube2DLocalInterpolation<RT2Cube2DLocalBasis<D,R> > > Traits;
34
35 //! \brief Standard constructor
36 RT2Cube2DLocalFiniteElement ()
37 {}
38
39 /**
40 * \brief Make set number s, where 0 <= s < 16
41 *
42 * \param s Edge orientation indicator
43 */
44 RT2Cube2DLocalFiniteElement (int s) :
45 basis(s),
46 interpolation(s)
47 {}
48
49 const typename Traits::LocalBasisType& localBasis () const
50 {
51 return basis;
52 }
53
54 const typename Traits::LocalCoefficientsType& localCoefficients () const
55 {
56 return coefficients;
57 }
58
59 const typename Traits::LocalInterpolationType& localInterpolation () const
60 {
61 return interpolation;
62 }
63
64 /** \brief Number of shape functions in this finite element */
65 unsigned int size () const
66 {
67 return basis.size();
68 }
69
70 static constexpr GeometryType type ()
71 {
72 return GeometryTypes::quadrilateral;
73 }
74
75 private:
76 RT2Cube2DLocalBasis<D,R> basis;
77 RT2Cube2DLocalCoefficients coefficients;
78 RT2Cube2DLocalInterpolation<RT2Cube2DLocalBasis<D,R> > interpolation;
79 };
80 }
81 #endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS2_CUBE2D_LOCALFINITEELEMENT_HH