Dune Core Modules (2.6.0)

emptypoints.hh
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
9#include <dune/localfunctions/common/localkey.hh>
10
11namespace Dune
12{
13
14 template< class F, unsigned int dim >
15 class LagrangePoint
16 {
17 typedef LagrangePoint< F, dim > This;
18
19 template< class, class >
20 friend class LagrangePointSetImpl;
21
22 public:
23 static const int dimension = dim;
24
25 typedef F Field;
26
28
29 const Vector &point () const
30 {
31 return point_;
32 }
33
34 const LocalKey &localKey () const
35 {
36 return localKey_;
37 }
38
39 Vector point_;
40 LocalKey localKey_;
41 };
42
43 // EmptyPointSet
44 // --------------
45
46 template< class F, unsigned int dim >
47 class EmptyPointSet
48 {
49 typedef EmptyPointSet< F, dim > This;
50
51 public:
52 typedef F Field;
53
54 static const unsigned int dimension = dim;
55
56 typedef Dune::LagrangePoint< Field, dimension > LagrangePoint;
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
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)