dune-localfunctions  2.8.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 
39  const Field weight () const
40  {
41  return weight_;
42  }
43 
47  };
48 
49  // EmptyPointSet
50  // --------------
51 
52  template< class F, unsigned int dim >
54  {
56 
57  public:
58  typedef F Field;
59 
60  static const unsigned int dimension = dim;
61 
63 
64  typedef typename std::vector< LagrangePoint >::const_iterator iterator;
65 
66  protected:
67  EmptyPointSet ( const std::size_t order )
68  : order_( order )
69  {}
70 
71  public:
72  const LagrangePoint &operator[] ( const unsigned int i ) const
73  {
74  assert( i < size() );
75  return points_[ i ];
76  }
77 
78  iterator begin () const
79  {
80  return points_.begin();
81  }
82 
83  iterator end () const
84  {
85  return points_.end();
86  }
87 
88  const LocalKey &localKey ( const unsigned int i ) const
89  {
90  return (*this)[ i ].localKey();
91  }
92 
93  std::size_t order () const
94  {
95  return order_;
96  }
97 
98  std::size_t size () const
99  {
100  return points_.size();
101  }
102 
103  protected:
104  std::size_t order_;
105  std::vector< LagrangePoint > points_;
106  };
107 
108 }
109 
110 #endif // DUNE_LAGRANGE_EMPTYPOINTS_HH
Definition: bdfmcube.hh:16
Describe position of one degree of freedom.
Definition: localkey.hh:21
Definition: emptypoints.hh:16
Field weight_
Definition: emptypoints.hh:46
static const int dimension
Definition: emptypoints.hh:23
const LocalKey & localKey() const
Definition: emptypoints.hh:34
friend class LagrangePointSetImpl
Definition: emptypoints.hh:20
Vector point_
Definition: emptypoints.hh:44
const Field weight() const
Definition: emptypoints.hh:39
FieldVector< Field, dimension > Vector
Definition: emptypoints.hh:27
F Field
Definition: emptypoints.hh:25
LocalKey localKey_
Definition: emptypoints.hh:45
const Vector & point() const
Definition: emptypoints.hh:29
Definition: emptypoints.hh:54
const LagrangePoint & operator[](const unsigned int i) const
Definition: emptypoints.hh:72
std::size_t order() const
Definition: emptypoints.hh:93
std::size_t order_
Definition: emptypoints.hh:104
static const unsigned int dimension
Definition: emptypoints.hh:60
const LocalKey & localKey(const unsigned int i) const
Definition: emptypoints.hh:88
EmptyPointSet(const std::size_t order)
Definition: emptypoints.hh:67
std::size_t size() const
Definition: emptypoints.hh:98
Dune::LagrangePoint< Field, dimension > LagrangePoint
Definition: emptypoints.hh:62
iterator begin() const
Definition: emptypoints.hh:78
std::vector< LagrangePoint >::const_iterator iterator
Definition: emptypoints.hh:64
iterator end() const
Definition: emptypoints.hh:83
F Field
Definition: emptypoints.hh:58
std::vector< LagrangePoint > points_
Definition: emptypoints.hh:105