dune-localfunctions  2.3.1
rannachertureklocalcoefficients.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH
4 #define DUNE_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH
5 
6 #include <algorithm>
7 #include <cassert>
8 #include <cstddef>
9 
10 #include <dune/common/array.hh>
11 
13 
14 namespace Dune
15 {
23  template< unsigned int d >
25  {
27  {
28  for( std::size_t i = 0; i < 2*d; ++i )
29  localKeys_[ i ] = LocalKey( i, 1, 0 );
30  }
31 
33  {
34  (*this) = other;
35  }
36 
38  {
39  std::copy( other.localKeys_.begin(), other.localKeys_.end(), localKeys_.begin() );
40  return *this;
41  }
42 
44  std::size_t size () const
45  {
46  return 2*d;
47  }
48 
50  const LocalKey &localKey ( std::size_t i ) const
51  {
52  assert( 0 <= i && i < 2*d );
53  return localKeys_[ i ];
54  }
55 
56  private:
57  array< LocalKey, 2*d > localKeys_;
58  };
59 
60 } // namespace Dune
61 
62 #endif // #ifndef DUNE_RANNACHER_TUREK_LOCALCOEFFICIENTS_HH