Class documentation of Concepts

Loading...
Searching...
No Matches
function.hh
Go to the documentation of this file.
1
6#ifndef hpFunction3d_hh
7#define hpFunction3d_hh
8
9#include "../space.hh"
11
12#include "toolbox/sequence.hh"
14
15
16namespace hp3D {
17 //forward declaration
18 class Hexahedron;
19 template<class F>
20 class NeumannTraceElement3d;
21
22 using concepts::Real;
23 using concepts::Real2d;
24 using concepts::Real3d;
25
26
27 // ***************************************************************** Value **
28
33 template<class F, class G = concepts::Real>
34 class Value: public concepts::ElementFunction<F, G> {
35 public:
36
38 virtual ~Value() {}
39
40 virtual Value<F, G>* clone() const;
41
43 virtual uint n() const {
44 return 1;
45 }
46
47 virtual void operator()(const concepts::Element<G>& elm,
48 const concepts::Array<F>& coeff, F& val, const uint *i) const;
49
50 virtual void operator()(const concepts::Element<G>& elm,
51 const concepts::Array<F>& coeff, concepts::Array<F>& val,
52 const uint *i) const;
53
54 virtual void operator()(const concepts::Element<G>& elm, const uint* j,
55 concepts::Array<F>& val, const uint* i) const;
56
57 virtual void operator()(const concepts::Element<G>& elm,
58 const concepts::Array<F>& coeff, concepts::Array<F>& val,
59 const Real p, const Real t = 0.0) const;
60
61 virtual void operator()(const concepts::Element<G>& elm,
62 const concepts::Array<F>& coeff, concepts::Array<F>& val,
63 const Real2d& p, const Real t = 0.0) const;
64
65 virtual void operator()(const concepts::Element<G>& elm,
66 const concepts::Array<F>& coeff, F& val,
67 const Real3d& p, const Real t = 0.0) const;
68
69 virtual void operator()(const concepts::Element<G>& elm,
70 const concepts::Array<F>& coeff, concepts::Array<F>& val,
71 const Real3d& p, const Real t = 0.0) const;
72
73 private:
74
75 bool compute_(const Hexahedron* elm, const concepts::Array<F>& coeff,
76 F& val, const uint* i) const;
77
78 bool compute_(const Hexahedron* elm, const concepts::Array<F>& coeff,
79 F& val, const Real3d& p, const Real t) const;
80
81 bool compute_(const NeumannTraceElement3d<Real>* elm, const concepts::Array<F>& coeff,
82 F& val, const Real2d& p, const Real t) const;
83
84 };
85
86 // ****************************************************************** Grad **
87
92 template<class F, class G = Real>
93 class Grad: public concepts::ElementFunction<F, G> {
94
95 public:
96
98 virtual ~Grad() {
99 }
100
101
102 virtual Grad<F, G>* clone() const;
103
105 virtual uint n() const {
106 return 3;
107 }
108
109 virtual void operator()(const concepts::Element<G>& elm,
110 const concepts::Array<F>& coeff, concepts::Array<F>& val,
111 const uint *i) const;
112
113 virtual void operator()(const concepts::Element<G>& elm, const uint* j,
114 concepts::Array<F>& val, const uint* i) const;
115
116 virtual void operator()(const concepts::Element<G>& elm,
117 const concepts::Array<F>& coeff, concepts::Array<F>& val, const Real p,
118 const Real t = 0.0) const;
119
120 virtual void operator()(const concepts::Element<G>& elm,
121 const concepts::Array<F>& coeff, concepts::Array<F>& val,
122 const Real2d& p, const Real t = 0.0) const;
123
124 virtual void operator()(const concepts::Element<G>& elm,
125 const concepts::Array<F>& coeff, concepts::Array<F>& val,
126 const Real3d& p, const Real t = 0.0) const;
127
128 };
129
130 // ****************************************************************** Laplacian **
131
136 template<class F, class G = Real>
138
139 public:
140
142 virtual ~Laplacian() {
143 }
144
145
146 virtual Laplacian<F, G>* clone() const override;
147
149 virtual uint n() const override{
150 return 1;
151 }
152
153 void operator()(const concepts::Element<G>& elm,
154 const concepts::Array<F>& coeff,
155 F& val, const uint *i) const;
156
158 const concepts::Array<F>& coeff,
160 const uint *i) const override {
161 val.resize(1);
162 (*this)(elm, coeff, val[0], i);
163 }
164
167 const uint* j,
169 const uint* i) const override;
170
173 const concepts::Array<F>& coeff,
175 const concepts::Real p,
176 const concepts::Real t = 0.0) const override;
177
180 const concepts::Array<F>& coeff, concepts::Array<F>& val,
181 const concepts::Real2d& p,
182 const concepts::Real t = 0.0) const override;
183
184
189 const concepts::Array<F>& coeff, F& val,
190 const concepts::Real3d& p,
191 const concepts::Real t = 0.0) const;
192
193 void operator()(const concepts::Element<G>& elm,
194 const concepts::Array<F>& coeff, concepts::Array<F>& val,
195 const concepts::Real3d& p,
196 const concepts::Real t = 0.0) const override {
197 val.resize(1);
198 (*this)(elm, coeff, val[0], p, t);
199 }
200
201
202 };
203
204
205
206}/*namespace hp3d */
207
208#endif /* hpFunction3d_hh */
void resize(const uint sz)
Definition array.hh:281
virtual ~Grad()
Destructor for the class with virtual memberfunctions.
Definition function.hh:98
virtual void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual uint n() const
Number of components.
Definition function.hh:105
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const override
Definition function.hh:157
void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const override
Throws an exception.
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const concepts::Real p, const concepts::Real t=0.0) const override
Throws an exception.
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const concepts::Real2d &p, const concepts::Real t=0.0) const override
Throws an exception.
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, F &val, const concepts::Real3d &p, const concepts::Real t=0.0) const
virtual uint n() const override
Number of components.
Definition function.hh:149
virtual ~Laplacian()
Destructor for the class with virtual memberfunctions.
Definition function.hh:142
virtual void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual ~Value()
Destructor for the class with virtual memberfunctions.
Definition function.hh:38
virtual uint n() const
Number of components.
Definition function.hh:43
double Real
Definition typedefs.hh:39
Definition meshDX.hh:23