DUNE-FEM (unstable)

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// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5#ifndef DUNE_LAGRANGE_EMPTYPOINTS_HH
6#define DUNE_LAGRANGE_EMPTYPOINTS_HH
7
8#include <vector>
9
11#include <dune/localfunctions/common/localkey.hh>
12
13namespace Dune
14{
15
16 template< class F, unsigned int dim >
17 class LagrangePoint
18 {
19 typedef LagrangePoint< F, dim > This;
20
21 template< class, class >
22 friend class LagrangePointSetImpl;
23
24 public:
25 static const int dimension = dim;
26
27 typedef F Field;
28
30
31 const Vector &point () const
32 {
33 return point_;
34 }
35
36 const LocalKey &localKey () const
37 {
38 return localKey_;
39 }
40
41 const Field weight () const
42 {
43 return weight_;
44 }
45
46 Vector point_ = {};
47 LocalKey localKey_ = {};
48 Field weight_ = {};
49 };
50
51 // EmptyPointSet
52 // --------------
53
54 template< class F, unsigned int dim >
55 class EmptyPointSet
56 {
57 typedef EmptyPointSet< F, dim > This;
58
59 public:
60 typedef F Field;
61
62 static const unsigned int dimension = dim;
63
64 typedef Dune::LagrangePoint< Field, dimension > LagrangePoint;
65
66 typedef typename std::vector< LagrangePoint >::const_iterator iterator;
67
68 protected:
69 EmptyPointSet ( const std::size_t order )
70 : order_( order )
71 {}
72
73 public:
74 const LagrangePoint &operator[] ( const unsigned int i ) const
75 {
76 assert( i < size() );
77 return points_[ i ];
78 }
79
80 iterator begin () const
81 {
82 return points_.begin();
83 }
84
85 iterator end () const
86 {
87 return points_.end();
88 }
89
90 const LocalKey &localKey ( const unsigned int i ) const
91 {
92 return (*this)[ i ].localKey();
93 }
94
95 std::size_t order () const
96 {
97 return order_;
98 }
99
100 std::size_t size () const
101 {
102 return points_.size();
103 }
104
105 protected:
106 std::size_t order_;
107 std::vector< LagrangePoint > points_;
108 };
109
110}
111
112#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:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)