Debian Codegraph @

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