Debian Codegraph @

dune/localfunctions/enriched/simplexp1bubble/localcoefficients.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_SIMPLEXP1BUBBLE_LOCALCOEFFICIENTS_HH
6 #define DUNE_LOCALFUNCTIONS_ENRICHED_SIMPLEXP1BUBBLE_LOCALCOEFFICIENTS_HH
7
8 #include <array>
9
10 #include <dune/localfunctions/common/localkey.hh>
11
12 namespace Dune
13 {
14 /**
15 * \ingroup LocalFunctionsImpl
16 * \brief The Local keys associated to the dim-d local basis functions
17 *
18 * The local keys represent first the vertex DOFs and then a single
19 * DOF associated to the element interior.
20 * \nosubgrouping
21 **/
22 template <int dim>
23 class SimplexP1BubbleLocalCoefficients
24 {
25 static const int numVertices = dim+1;
26
27 public:
28 //! Default constructor, initialized the local keys
29 SimplexP1BubbleLocalCoefficients () noexcept
30 {
31 for (int i = 0; i <= dim; ++i)
32 li_[i] = LocalKey(i,dim,0); // Vertex
33 li_[numVertices] = LocalKey(0,0,0); // Element
34 }
35
36 //! Returns number of coefficients
37 static constexpr std::size_t size () noexcept
38 {
39 return numVertices + 1;
40 }
41
42 //! Returns the i'th local key
43 const LocalKey& localKey (std::size_t i) const noexcept
44 {
45 return li_[i];
46 }
47
48 private:
49 std::array<LocalKey, numVertices+1> li_;
50 };
51
52 } // end namespace Dune
53
54 #endif // DUNE_LOCALFUNCTIONS_ENRICHED_SIMPLEXP1BUBBLE_LOCALCOEFFICIENTS_HH