Dune Core Modules (unstable)

rannachertureklocalcoefficients.hh
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_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH
6 #define DUNE_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH
7 
8 #include <algorithm>
9 #include <array>
10 #include <cassert>
11 #include <cstddef>
12 
13 #include <dune/localfunctions/common/localkey.hh>
14 
15 namespace Dune
16 {
25  template< unsigned int d >
27  {
29  {
30  for( std::size_t i = 0; i < 2*d; ++i )
31  localKeys_[ i ] = LocalKey( i, 1, 0 );
32  }
33 
35  {
36  (*this) = other;
37  }
38 
40  {
41  std::copy( other.localKeys_.begin(), other.localKeys_.end(), localKeys_.begin() );
42  return *this;
43  }
44 
46  std::size_t size () const
47  {
48  return 2*d;
49  }
50 
52  const LocalKey &localKey ( std::size_t i ) const
53  {
54  assert( i < 2*d );
55  return localKeys_[ i ];
56  }
57 
58  private:
59  std::array< LocalKey, 2*d > localKeys_;
60  };
61 
62 } // namespace Dune
63 
64 #endif // #ifndef DUNE_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH
Describe position of one degree of freedom.
Definition: localkey.hh:24
Dune namespace.
Definition: alignedallocator.hh:13
layout for Rannacher-Turek elements
Definition: rannachertureklocalcoefficients.hh:27
const LocalKey & localKey(std::size_t i) const
map index i to local key
Definition: rannachertureklocalcoefficients.hh:52
std::size_t size() const
number of coefficients
Definition: rannachertureklocalcoefficients.hh:46
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 27, 22:29, 2024)