Debian Codegraph @

dune/localfunctions/enriched/cubeq1bubble.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_ENRICHED_CUBEQ1BUBBLE_HH
6 #define DUNE_LOCALFUNCTIONS_ENRICHED_CUBEQ1BUBBLE_HH
7
8 #include <dune/geometry/type.hh>
9
10 #include <dune/localfunctions/common/localfiniteelementtraits.hh>
11 #include <dune/localfunctions/enriched/cubeq1bubble/localbasis.hh>
12 #include <dune/localfunctions/enriched/cubeq1bubble/localcoefficients.hh>
13 #include <dune/localfunctions/enriched/cubeq1bubble/localinterpolation.hh>
14
15
16 namespace Dune
17 {
18 /**
19 * \brief Linear Lagrange functions enriched with an element bubble function.
20 *
21 * The set of basis functions contains the classical Lagrange basis functions
22 * of order 1, i.e., the barycentric coordinates, and a single element "bubble"
23 * function that vanishes on all faces of the element. The bubble function is
24 * simply defined as the product of all linear basis functions and thus has
25 * polynomial order `dim+1`.
26 *
27 * A classical example where this kind of basis is used in the discretization
28 * of the Stokes equation with the stable mixed-element called MINI element,
29 * see
30 *
31 * Arnold, D.N., Brezzi, F. and Fortin, M. A stable finite element for the
32 * Stokes equations. Calcolo 21, 337-344 (1984). doi: 10.1007/BF02576171
33 *
34 * The velocity field is discretized with continuous piecewise linear
35 * functions enriched by a bubble function.
36 *
37 * \tparam D Type to represent the field in the domain.
38 * \tparam R Type to represent the field in the range.
39 * \tparam dim Dimension of the domain.
40 **/
41 template<class D, class R, int dim>
42 class CubeQ1BubbleLocalFiniteElement
43 {
44 public:
45 //! Type of the local basis
46 using LocalBasisType = CubeQ1BubbleLocalBasis<D,R,dim>;
47
48 //! Type of the local coefficients
49 using LocalCoefficientsType = CubeQ1BubbleLocalCoefficients<dim>;
50
51 //! Type of the local interpolation
52 using LocalInterpolationType = CubeQ1BubbleLocalInterpolation<LocalBasisType>;
53
54 //! Traits type that specifies the local basis, coefficients, and interpolation type.
55 using Traits = LocalFiniteElementTraits<LocalBasisType,LocalCoefficientsType,LocalInterpolationType>;
56
57
58 //! Returns the local basis, i.e., the set of shape functions
59 const LocalBasisType& localBasis () const
60 {
61 return basis_;
62 }
63
64 //! Returns the assignment of the degrees of freedom to the element subentities
65 const LocalCoefficientsType& localCoefficients () const
66 {
67 return coefficients_;
68 }
69
70 //! Returns object that evaluates degrees of freedom
71 const LocalInterpolationType& localInterpolation () const
72 {
73 return interpolation_;
74 }
75
76 //! Returns the number of shape functions in this finite-element
77 static constexpr std::size_t size () noexcept
78 {
79 return LocalBasisType::size();
80 }
81
82 //! Returns the type of the geometry the finite-element is attached to
83 static constexpr GeometryType type () noexcept
84 {
85 return GeometryTypes::simplex(dim);
86 }
87
88 private:
89 LocalCoefficientsType coefficients_{};
90 [[no_unique_address]] LocalBasisType basis_{};
91 [[no_unique_address]] LocalInterpolationType interpolation_{};
92 };
93
94 } // end namespace Dune
95
96 #endif // DUNE_LOCALFUNCTIONS_ENRICHED_CUBEQ1BUBBLE_HH