Class documentation of Concepts

Loading...
Searching...
No Matches
function.hh
Go to the documentation of this file.
1
6#ifndef hpFunction2d_hh
7#define hpFunction2d_hh
8
9#include "toolbox/sequence.hh"
11#include "functionBase.hh"
12#include "edge.hh"
13#include "traces.hh"
14
16#include "neumannTrace.hh"
17
18namespace hp2D {
19
20 // forward declaration
21 class InfiniteQuad;
22
23 using concepts::Real;
24 using concepts::Real2d;
25
26 // ***************************************************************** Value **
27
32 template<typename F = Real, typename G= typename concepts::Realtype<F>::type>
33 class Value : public concepts::ElementFunction<F, G> {
34 public:
35 virtual Value<F,G>* clone() const { return new Value(); }
36
38 virtual uint n() const { return 1; }
39
40 virtual void operator() (const concepts::Element<G>& elm,
41 const concepts::Array<F>& coeff,
42 concepts::Array<F>& val, const uint *i) const;
43 virtual void operator() (const concepts::Element<G>& elm,
44 const uint* j,
45 concepts::Array<F>& val, const uint* i) const;
46 virtual void operator() (const concepts::Element<G>& elm,
47 const concepts::Array<F>& coeff,
48 concepts::Array<F>& val, const Real p,
49 const Real t = 0.0) const;
50 virtual void operator() (const concepts::Element<G>& elm,
51 const concepts::Array<F>& coeff,
52 concepts::Array<F>& val, const Real2d& p,
53 const Real t = 0.0) const;
54 virtual void operator() (const concepts::Element<G>& elm,
55 const concepts::Array<F>& coeff,
57 const concepts::Real3d& p,
58 const Real t = 0.0) const;
59
60 void operator() (const concepts::Element<G>& elm,
61 const concepts::Array<F>& coeff,
62 F& val, const uint *i) const;
63 void operator() (const concepts::Element<G>& elm,
64 const uint* j, F& val, const uint* i) const;
65 void operator() (const concepts::Element<G>& elm,
66 const concepts::Array<F>& coeff, F& val, const Real2d& p,
67 const Real t = 0.0) const;
68 protected:
69 virtual std::ostream& info(std::ostream& os) const;
70 private:
71
72 bool compute_(const Quad<Real>* elm, const concepts::Array<F>& coeff,
73 F& val, const uint i[2]) const;
74 bool compute_(const InfiniteQuad* elm, const concepts::Array<F>& coeff,
75 F& val, const uint i[2]) const;
76
77 //template<class H>
78 bool compute_(const Quad<Real>* elm, const uint j[2], F& val, const uint i[2]) const;
79 bool compute_(const InfiniteQuad* elm, const uint j[2], F& val, const uint i[2]) const;
80
81
82 bool compute_(const Quad<Real>* elm, const concepts::Array<F>& coeff,
83 F& val, const Real2d& p, const Real t) const;
84
85 bool compute_(const InfiniteQuad* elm, const concepts::Array<F>& coeff,
86 F& val, const Real2d& p, const Real t) const;
87
88
89 bool compute_(const NTElement_BA<Real>* nTelm,const concepts::Array<F>& coeff,
90 F& val, const Real p, const Real t) const;
91
92 bool compute_(const NeumannTraceElement<Real>* elm, const concepts::Array<F>& coeff,
93 F& val, const Real& p, const Real t) const;
94
95
96 void compute_(const concepts::Array<F>& coeff, F& val,
97 const Real* xValues, uint nsx,
98 const Real* yValues, uint nsy) const;
99 };
100
101 // ****************************************************************** Grad **
102
107 template<typename F = Real>
108 class Grad : public ElementFunction<2,F> {
109 public:
110 virtual Grad<F>* clone() const { return new Grad(); }
111 protected:
112 virtual std::ostream& info(std::ostream& os) const;
113 private:
114 virtual void compute_(const Quad<Real>& elm,
115 const concepts::Array<F>& coeff,
117 const uint i[2]) const;
118 virtual void compute_(const Quad<Real>& elm, const uint j[2],
120 const uint i[2]) const;
121 virtual void compute_(const Quad<Real>& elm,
122 const concepts::Array<F>& coeff,
124 const Real2d& p, const Real t = 0.0) const;
125 };
126
127
128
129 // ****************************************************************** Laplacian **
130
136 template<typename F = Real, typename G= typename concepts::Realtype<F>::type>
138 public:
139 virtual Laplacian<F>* clone() const { return new Laplacian(); }
140
142 virtual uint n() const { return 1; }
143
144 virtual void operator() (const concepts::Element<G>& elm,
145 const concepts::Array<F>& coeff,
146 concepts::Array<F>& val, const uint *i) const;
147 virtual void operator() (const concepts::Element<G>& elm,
148 const uint* j,
149 concepts::Array<F>& val, const uint* i) const;
150 virtual void operator() (const concepts::Element<G>& elm,
151 const concepts::Array<F>& coeff,
152 concepts::Array<F>& val, const Real p,
153 const Real t = 0.0) const;
154 virtual void operator() (const concepts::Element<G>& elm,
155 const concepts::Array<F>& coeff,
156 concepts::Array<F>& val, const Real2d& p,
157 const Real t = 0.0) const;
158 virtual void operator() (const concepts::Element<G>& elm,
159 const concepts::Array<F>& coeff,
161 const concepts::Real3d& p,
162 const Real t = 0.0) const;
163
164 void operator() (const concepts::Element<G>& elm,
165 const concepts::Array<F>& coeff,
166 F& val, const uint *i) const;
167 void operator() (const concepts::Element<G>& elm,
168 const uint* j, F& val, const uint* i) const;
169 void operator() (const concepts::Element<G>& elm,
170 const concepts::Array<F>& coeff, F& val, const Real2d& p,
171 const Real t = 0.0) const;
172 protected:
173 virtual std::ostream& info(std::ostream& os) const;
174 private:
175
176
177 template<class H>
178 bool compute_(H elm, const concepts::Array<F>& coeff,
179 F& val, const uint i[2]) const;
180
181 template<class H>
182 bool compute_(H elm, const uint j[2], F& val, const uint i[2]) const;
183
184 bool compute_(const Quad<Real>* elm, const concepts::Array<F>& coeff,
185 F& val, const Real2d& p, const Real t) const;
186
187 };
188
189 // *********************************************************** Partial_xx **
190
196 template<typename F, typename Q = Quad<Real> >
197 class Partial_xx : public ElementFunction<1,F,Q> {
198 public:
199 virtual Partial_xx<F,Q>* clone() const;
200 protected:
201 virtual std::ostream& info(std::ostream& os) const;
202 private:
203 virtual void compute_(const Q& elm,
204 const concepts::Array<F>& coeff,
205 F& val, const uint i[2]) const;
206 virtual void compute_(const Q& elm, const uint j[3],
207 F& val, const uint i[2]) const;
208 virtual void compute_(const Q& elm, const concepts::Array<F>& coeff,
209 F& val, const Real2d& p, const Real t = 0.0) const;
210
211 };
212
213 // *********************************************************** Partial_yy **
214
220 template<typename F, typename Q = Quad<Real>>
221 class Partial_yy : public ElementFunction<1,F,Q> {
222 public:
223 virtual Partial_yy<F,Q>* clone() const;
224 protected:
225 virtual std::ostream& info(std::ostream& os) const;
226 private:
227 virtual void compute_(const Q& elm, const concepts::Array<F>& coeff,
228 F& val, const uint i[2]) const;
229 virtual void compute_(const Q& elm, const uint j[3],
230 F& val, const uint i[2]) const;
231 virtual void compute_(const Q& elm, const concepts::Array<F>& coeff,
232 F& val, const Real2d& p, const Real t = 0.0) const;
233 };
234
235 // **************************************************************** Plcurl **
236
241 template<typename F = Real>
242 class PlCurl : public ElementFunction<2,F> {
243 public:
244 virtual PlCurl<F>* clone() const { return new PlCurl(); }
245 protected:
246 virtual std::ostream& info(std::ostream& os) const;
247 private:
248 virtual void compute_(const Quad<Real>& elm,
249 const concepts::Array<F>& coeff,
251 const uint i[2]) const;
252 virtual void compute_(const Quad<Real>& elm, const uint j[2],
254 const uint i[2]) const;
255 virtual void compute_(const Quad<Real>& elm,
256 const concepts::Array<F>& coeff,
258 const Real2d& p, const Real t = 0.0) const;
259 };
260
261 // ***************************************************************** Trace **
262
269 template<typename F = Real,
270 typename G = typename concepts::Realtype<F>::type>
271 class Trace : public ElementFunction<1,F,hp1D::Element<G> > {
272 public:
274 Trace() : attrib_(concepts::Attribute(0)) {}
277
280
281 virtual Trace<F,G>* clone() const {
282 Trace<F,G>* tmp = new Trace();
283 tmp->attrib() = attrib_;
284 return tmp;
285 }
286 protected:
287 virtual std::ostream& info(std::ostream& os) const;
288 private:
290
291 virtual void compute_(const hp1D::Element<G>& elm,
292 const concepts::Array<F>& coeff,
293 F& val, const uint i[2]) const;
294 virtual void compute_(const hp1D::Element<G>& elm, const uint j[2],
295 F& val, const uint i[2]) const;
296 virtual void compute_(const hp1D::Element<G>& elm,
297 const concepts::Array<F>& coeff,
298 F& val, const Real2d& p, const Real t = 0.0) const;
299 };
300
301 // ************************************************************ TraceDeriv **
302
310 template<typename F = Real,
311 typename G = typename concepts::Realtype<F>::type>
312 class TraceDeriv : public ElementFunction<1,F,hp1D::Element<G> > {
313 public:
315 TraceDeriv() : attrib_(concepts::Attribute(0)) {}
318
321
322 virtual TraceDeriv<F,G>* clone() const {
323 TraceDeriv<F,G>* tmp = new TraceDeriv();
324 tmp->attrib() = attrib_;
325 return tmp;
326 }
327 protected:
328 virtual std::ostream& info(std::ostream& os) const;
329 private:
331
332 virtual void compute_(const hp1D::Element<G>& elm,
333 const concepts::Array<F>& coeff,
334 F& val, const uint i[2]) const;
335 virtual void compute_(const hp1D::Element<G>& elm, const uint j[2],
336 F& val, const uint i[2]) const;
337 virtual void compute_(const hp1D::Element<G>& elm,
338 const concepts::Array<F>& coeff,
339 F& val, const Real2d& p, const Real t = 0.0) const;
340 };
341
342
343 // ********************************************************** NeumannTrace **
344
353 template<typename F = Real,
354 typename G = typename concepts::Realtype<F>::type>
355 class NeumannTrace : public ElementFunction<1,F,Quad<G> > {
356 public:
360
361 virtual NeumannTrace<F,G>* clone() const {
362 return new NeumannTrace();
363 }
364 protected:
365 virtual std::ostream& info(std::ostream& os) const;
366 private:
367
368 virtual void compute_(const Quad<G>& elm,
369 const concepts::Array<F>& coeff,
370 F& val, const uint i[2]) const;
371 virtual void compute_(const Quad<G>& elm, const uint j[2],
372 F& val, const uint i[2]) const;
373 virtual void compute_(const Quad<G>& elm,
374 const concepts::Array<F>& coeff,
375 F& val, const Real2d& p, const Real t = 0.0) const;
376 };
377
378 namespace l2 {
379
380 // *************************************************************** Value **
381
386 template<typename F = Real, typename G = typename concepts::Realtype<F>::type>
387 class Value : public concepts::ElementFunction<F, G> {
388 public:
389 virtual Value<F,G>* clone() const { return new Value(); }
390
392 virtual uint n() const { return 1; }
393
394 virtual void operator() (const concepts::Element<G>& elm,
395 const concepts::Array<F>& coeff,
396 concepts::Array<F>& val, const uint *i) const;
397 virtual void operator() (const concepts::Element<G>& elm,
398 const uint* j,
399 concepts::Array<F>& val, const uint* i) const;
400 virtual void operator() (const concepts::Element<G>& elm,
401 const concepts::Array<F>& coeff,
402 concepts::Array<F>& val, const Real p,
403 const Real t = 0.0) const;
404 virtual void operator() (const concepts::Element<G>& elm,
405 const concepts::Array<F>& coeff,
406 concepts::Array<F>& val, const Real2d& p,
407 const Real t = 0.0) const;
408 virtual void operator() (const concepts::Element<G>& elm,
409 const concepts::Array<F>& coeff,
411 const concepts::Real3d& p,
412 const Real t = 0.0) const;
413
414 void operator() (const concepts::Element<G>& elm,
415 const concepts::Array<F>& coeff,
416 F& val, const uint *i) const;
417 void operator() (const concepts::Element<G>& elm,
418 const uint* j, F& val, const uint* i) const;
419 void operator() (const concepts::Element<G>& elm,
420 const concepts::Array<F>& coeff, F& val, const Real2d& p,
421 const Real t = 0.0) const;
422 protected:
423 virtual std::ostream& info(std::ostream& os) const;
424 private:
425 bool compute_(const Quad<Real>* elm, const concepts::Array<F>& coeff,
426 F& val, const uint i[2]) const;
427
428 bool compute_(const Quad<Real>* elm, const uint j[2], F& val, const uint i[2]) const;
429
430 bool compute_(const Quad<Real>* elm, const concepts::Array<F>& coeff,
431 F& val, const Real2d& p, const Real t) const;
432
433 void compute_(const concepts::Array<F>& coeff, F& val,
434 const Real* xValues, uint nsx,
435 const Real* yValues, uint nsy) const;
436 };
437
438
439 } // namespace l2
440
441} // namespace hp2D
442
443#endif // hpFunction2d_hh
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual uint n() const
Number of components.
Definition function.hh:142
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
TraceDeriv(const concepts::Attribute attrib)
Constructor with given attribute.
Definition function.hh:317
TraceDeriv()
Constructor.
Definition function.hh:315
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Set< concepts::Attribute > & attrib()
Returns the attributes.
Definition function.hh:320
Trace()
Constructor.
Definition function.hh:274
concepts::Set< concepts::Attribute > & attrib()
Returns the attributes.
Definition function.hh:279
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Trace(const concepts::Attribute attrib)
Constructor with given attribute.
Definition function.hh:276
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:38
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
double Real
Definition typedefs.hh:39