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