dune-localfunctions  2.3.0
emptypoints.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_LAGRANGE_EMPTYPOINTS_HH
4 #define DUNE_LAGRANGE_EMPTYPOINTS_HH
5 
6 #include <vector>
7 
8 #include <dune/common/fvector.hh>
10 
11 namespace Dune
12 {
13 
14  template< class F, unsigned int dim >
16  {
18 
19  template< class, class >
20  friend class LagrangePointSetImpl;
21 
22  public:
23  static const int dimension = dim;
24 
25  typedef F Field;
26 
27  typedef FieldVector< Field, dimension > Vector;
28 
29  const Vector &point () const
30  {
31  return point_;
32  }
33 
34  const LocalKey &localKey () const
35  {
36  return localKey_;
37  }
38 
41  };
42 
43  // EmptyPointSet
44  // --------------
45 
46  template< class F, unsigned int dim >
48  {
50 
51  public:
52  typedef F Field;
53 
54  static const unsigned int dimension = dim;
55 
57 
58  typedef typename std::vector< LagrangePoint >::const_iterator iterator;
59 
60  protected:
61  EmptyPointSet ( const unsigned int order )
62  : order_( order )
63  {}
64 
65  public:
66  const LagrangePoint &operator[] ( const unsigned int i ) const
67  {
68  assert( i < size() );
69  return points_[ i ];
70  }
71 
72  iterator begin () const
73  {
74  return points_.begin();
75  }
76 
77  iterator end () const
78  {
79  return points_.end();
80  }
81 
82  const LocalKey &localKey ( const unsigned int i ) const
83  {
84  return (*this)[ i ].localKey();
85  }
86 
87  unsigned int order () const
88  {
89  return order_;
90  }
91 
92  unsigned int size () const
93  {
94  return points_.size();
95  }
96 
97  protected:
98  unsigned int order_;
99  std::vector< LagrangePoint > points_;
100  };
101 
102 }
103 
104 #endif // DUNE_LAGRANGE_EMPTYPOINTS_HH
iterator begin() const
Definition: emptypoints.hh:72
static const unsigned int dimension
Definition: emptypoints.hh:54
const LocalKey & localKey(const unsigned int i) const
Definition: emptypoints.hh:82
const Vector & point() const
Definition: emptypoints.hh:29
iterator end() const
Definition: emptypoints.hh:77
F Field
Definition: emptypoints.hh:25
const LagrangePoint & operator[](const unsigned int i) const
Definition: emptypoints.hh:66
F Field
Definition: emptypoints.hh:52
Vector point_
Definition: emptypoints.hh:39
std::vector< LagrangePoint > points_
Definition: emptypoints.hh:99
Describe position of one degree of freedom.
Definition: localkey.hh:20
EmptyPointSet(const unsigned int order)
Definition: emptypoints.hh:61
std::vector< LagrangePoint >::const_iterator iterator
Definition: emptypoints.hh:58
friend class LagrangePointSetImpl
Definition: emptypoints.hh:20
unsigned int order_
Definition: emptypoints.hh:98
const LocalKey & localKey() const
Definition: emptypoints.hh:34
Dune::LagrangePoint< Field, dimension > LagrangePoint
Definition: emptypoints.hh:56
FieldVector< Field, dimension > Vector
Definition: emptypoints.hh:27
unsigned int order() const
Definition: emptypoints.hh:87
Definition: emptypoints.hh:15
static const int dimension
Definition: emptypoints.hh:23
LocalKey localKey_
Definition: emptypoints.hh:40
unsigned int size() const
Definition: emptypoints.hh:92
Definition: emptypoints.hh:47