Debian Codegraph @

dune/localfunctions/raviartthomas/raviartthomas0cube3d.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_RAVIARTTHOMAS0_CUBE3D_LOCALFINITEELEMENT_HH
6 #define DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE3D_LOCALFINITEELEMENT_HH
7
8 #include <dune/geometry/type.hh>
9
10 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
11 #include "raviartthomas0cube3d/raviartthomas0cube3dall.hh"
12
13 namespace Dune
14 {
15 /**
16 * \brief Zero order Raviart-Thomas shape functions on cubes.
17 *
18 * \ingroup RaviartThomas
19 *
20 * \tparam D Type to represent the field in the domain.
21 * \tparam R Type to represent the field in the range.
22 */
23 template<class D, class R>
24 class RT0Cube3DLocalFiniteElement
25 {
26 public:
27 typedef LocalFiniteElementTraits<
28 RT0Cube3DLocalBasis<D,R>,
29 RT0Cube3DLocalCoefficients,
30 RT0Cube3DLocalInterpolation<RT0Cube3DLocalBasis<D,R> > > Traits;
31
32 RT0Cube3DLocalFiniteElement ()
33 {}
34
35 RT0Cube3DLocalFiniteElement (int s) :
36 basis(s),
37 interpolation(s)
38 {}
39
40 const typename Traits::LocalBasisType& localBasis () const
41 {
42 return basis;
43 }
44
45 const typename Traits::LocalCoefficientsType& localCoefficients () const
46 {
47 return coefficients;
48 }
49
50 const typename Traits::LocalInterpolationType& localInterpolation () const
51 {
52 return interpolation;
53 }
54
55 /** \brief Number of shape functions in this finite element */
56 unsigned int size () const
57 {
58 return basis.size();
59 }
60
61 static constexpr GeometryType type ()
62 {
63 return GeometryTypes::hexahedron;
64 }
65
66 private:
67 RT0Cube3DLocalBasis<D,R> basis;
68 RT0Cube3DLocalCoefficients coefficients;
69 RT0Cube3DLocalInterpolation<RT0Cube3DLocalBasis<D,R> > interpolation;
70 };
71 }
72 #endif // DUNE_LOCALFUNCTIONS_RAVIARTTHOMAS0_CUBE3D_LOCALFINITEELEMENT_HH