Class documentation of Concepts

Loading...
Searching...
No Matches
bform.hh
Go to the documentation of this file.
1
6#ifndef bform_hh
7#define bform_hh
8
10#include "bemInt.hh"
11#include "bem/element.hh"
12
13namespace bem {
14
15 // ************************************************************* LaplaceSL **
16
20 template <class F = concepts::Real>
22
24 LplCol006<F> qrA_;
25 LplGal006<F> qrB_;
26 LplGal018<F> qrC_;
27
29 uint stroud_, gauss_;
33 concepts::Real dist_;
34
35 public:
41 inline LaplaceSL(uint stroud = 0, uint gauss = 0,
42 concepts::Real dist = 0.0);
43
51 const concepts::Element<F>& elmY,
53
54 inline void operator()(const Dirac3d000<F>& elmX,
55 const Linear3d000<F>& elmY,
57 inline void operator()(const Constant3d000<F>& elmX,
58 const Constant3d000<F>& elmY,
60 inline void operator()(const Constant3d001<F>& elmX,
61 const Constant3d001<F>& elmY,
63 inline void operator()(const Constant3d002<F>& elmX,
64 const Constant3d002<F>& elmY,
66 inline void operator()(const Linear3d000<F>& elmX,
67 const Linear3d000<F>& elmY,
69
70 virtual LaplaceSL* clone() const {
71 return new LaplaceSL(stroud_, gauss_, dist_); }
72 };
73
74 template <class F>
75 inline LaplaceSL<F>::LaplaceSL(uint stroud, uint gauss, concepts::Real dist)
76 : stroud_(stroud), gauss_(gauss), dist_(dist) {
77 }
78
79 template <class F>
80 inline void LaplaceSL<F>::operator()(const Dirac3d000<F>& elmX,
81 const Linear3d000<F>& elmY,
83 F m[9];
84 qrA_(elmX, elmY, gauss_, dist_, m);
85
86 uint n = elmX.T().n();
87 F* mm = m;
88
89 em.resize(n, 3);
90 for(uint i = 0; i < n; ++i) {
91 em(i, 0) = *mm++; em(i, 1) = *mm++; em(i, 2) = *mm++;
92 }
93 }
94
95 template <class F>
96 inline void LaplaceSL<F>::operator()(const Constant3d000<F>& elmX,
97 const Constant3d000<F>& elmY,
99 F m;
100 qrC_(elmX, elmY, stroud_, gauss_, dist_, &m);
101
102 em.resize(1, 1);
103 em(0, 0) = m;
104 }
105
106 template <class F>
107 inline void LaplaceSL<F>::operator()(const Constant3d001<F>& elmX,
108 const Constant3d001<F>& elmY,
110 F m;
111 qrC_(elmX, elmY, stroud_, gauss_, dist_, &m);
112
113 em.resize(1, 1);
114 em(0, 0) = m;
115 }
116
117 template <class F>
118 inline void LaplaceSL<F>::operator()(const Constant3d002<F>& elmX,
119 const Constant3d002<F>& elmY,
121 F m;
122 qrC_(elmX, elmY, stroud_, gauss_, dist_, &m);
123
124 em.resize(1, 1);
125 em(0, 0) = m;
126 }
127
128 template <class F>
129 inline void LaplaceSL<F>::operator()(const Linear3d000<F>& elmX,
130 const Linear3d000<F>& elmY,
132 F m[9];
133 qrB_(elmX, elmY, stroud_, gauss_, dist_, m);
134
135 em.resize(3, 3);
136 em(0, 0) = m[0]; em(0, 1) = m[1]; em(0, 2) = m[2];
137 em(1, 0) = m[3]; em(1, 1) = m[4]; em(1, 2) = m[5];
138 em(2, 0) = m[6]; em(2, 1) = m[7]; em(2, 2) = m[8];
139 }
140
141 // ************************************************************* LaplaceDL **
142
146 template <class F = concepts::Real>
148
150 LplCol007<F> qrA_;
151 LplGal007<F> qrB_;
152 LplGal014<F> qrC_;
153
155 uint stroud_, gauss_;
159 concepts::Real dist_;
160
161 public:
167 inline LaplaceDL(uint stroud = 0, uint gauss = 0,
168 concepts::Real dist = 0.0);
169
177 const concepts::Element<F>& elmY,
179
180 inline void operator()(const Dirac3d000<F>& elmX,
181 const Linear3d000<F>& elmY,
183 inline void operator()(const Constant3d000<F>& elmX,
184 const Constant3d000<F>& elmY,
186 inline void operator()(const Constant3d002<F>& elmX,
187 const Constant3d002<F>& elmY,
189 inline void operator()(const Linear3d000<F>& elmX,
190 const Linear3d000<F>& elmY,
192
193 virtual LaplaceDL* clone() const {
194 return new LaplaceDL(stroud_, gauss_, dist_); }
195 };
196
197 template <class F>
198 inline LaplaceDL<F>::LaplaceDL(uint stroud, uint gauss, concepts::Real dist)
199 : stroud_(stroud), gauss_(gauss), dist_(dist) {
200 }
201
202 template <class F>
203 inline void LaplaceDL<F>::operator()(const Dirac3d000<F>& elmX,
204 const Linear3d000<F>& elmY,
206 F m[9];
207 qrA_(elmX, elmY, gauss_, dist_, m);
208
209 uint n = elmX.T().n();
210 F* mm = m;
211
212 em.resize(n, 3);
213 for(uint i = 0; i < n; ++i) {
214 em(i, 0) = *mm++; em(i, 1) = *mm++; em(i, 2) = *mm++;
215 }
216 }
217
218 template <class F>
219 inline void LaplaceDL<F>::operator()(const Constant3d000<F>& elmX,
220 const Constant3d000<F>& elmY,
222 F m;
223 qrC_(elmX, elmY, stroud_, gauss_, dist_, &m);
224
225 em.resize(1, 1);
226 em(0, 0) = m;
227 }
228
229 template <class F>
230 inline void LaplaceDL<F>::operator()(const Constant3d002<F>& elmX,
231 const Constant3d002<F>& elmY,
233 F m;
234 qrC_(elmX, elmY, stroud_, gauss_, dist_, &m);
235
236 em.resize(1, 1);
237 em(0, 0) = m;
238 }
239
240 template <class F>
241 inline void LaplaceDL<F>::operator()(const Linear3d000<F>& elmX,
242 const Linear3d000<F>& elmY,
244 F m[9];
245 qrB_(elmX, elmY, stroud_, gauss_, dist_, m);
246
247 em.resize(3, 3);
248 em(0, 0) = m[0]; em(0, 1) = m[1]; em(0, 2) = m[2];
249 em(1, 0) = m[3]; em(1, 1) = m[4]; em(1, 2) = m[5];
250 em(2, 0) = m[6]; em(2, 1) = m[7]; em(2, 2) = m[8];
251 }
252
253 // ************************************************************ LaplacePLD **
254
259 template <class F = concepts::Real>
261
263 LplGal007<F> qrA_;
264 LplGal014<F> qrB_;
265
267 uint stroud_, gauss_;
271 concepts::Real dist_;
272
273 public:
279 inline LaplacePLD(uint stroud = 0, uint gauss = 0,
280 concepts::Real dist = 0.0);
281
289 const concepts::Element<F>& elmY,
291
292 inline void operator()(const Constant3d000<F>& elmX,
293 const Constant3d000<F>& elmY,
295 inline void operator()(const Linear3d000<F>& elmX,
296 const Linear3d000<F>& elmY,
298
299 virtual LaplacePLD* clone() const {
300 return new LaplacePLD(stroud_, gauss_, dist_); }
301 };
302
303
304 template <class F>
305 inline LaplacePLD<F>::LaplacePLD(uint stroud, uint gauss,
306 concepts::Real dist)
307 : stroud_(stroud), gauss_(gauss), dist_(dist) {
308 }
309
310 template <class F>
311 inline void LaplacePLD<F>::operator()(const Constant3d000<F>& elmX,
312 const Constant3d000<F>& elmY,
314 F m;
315 qrB_(elmY, elmX, stroud_, gauss_, dist_, &m);
316
317 em.resize(1, 1);
318 em(0, 0) = m;
319 }
320
321 template <class F>
322 inline void LaplacePLD<F>::operator()(const Linear3d000<F>& elmX,
323 const Linear3d000<F>& elmY,
325 F m[9];
326 qrA_(elmY, elmX, stroud_, gauss_, dist_, m);
327
328 em.resize(3, 3);
329 em(0, 0) = m[0]; em(0, 1) = m[1]; em(0, 2) = m[2];
330 em(1, 0) = m[3]; em(1, 1) = m[4]; em(1, 2) = m[5];
331 em(2, 0) = m[6]; em(2, 1) = m[7]; em(2, 2) = m[8];
332 }
333
334 // ************************************************************ LaplaceHyp **
335
339 template <class F = concepts::Real>
341
343 LplGal008<F> qrA_;
344
346 uint stroud_, gauss_;
350 concepts::Real dist_;
351
352 public:
358 inline LaplaceHyp(uint stroud = 0, uint gauss = 0,
359 concepts::Real dist = 0.0);
360
368 const concepts::Element<F>& elmY,
370
371 inline void operator()(const Linear3d000<F>& elmX,
372 const Linear3d000<F>& elmY,
374
375 virtual LaplaceHyp* clone() const {
376 return new LaplaceHyp(stroud_, gauss_, dist_); }
377 };
378
379 template <class F>
380 inline LaplaceHyp<F>::LaplaceHyp(uint stroud, uint gauss,
381 concepts::Real dist)
382 : stroud_(stroud), gauss_(gauss), dist_(dist) {
383 }
384
385 template <class F>
386 inline void LaplaceHyp<F>::operator()(const Linear3d000<F>& elmX,
387 const Linear3d000<F>& elmY,
389 F m[9];
390 qrA_(elmX, elmY, stroud_, gauss_, dist_, m);
391
392 em.resize(3, 3);
393 em(0, 0) = m[0]; em(0, 1) = m[1]; em(0, 2) = m[2];
394 em(1, 0) = m[3]; em(1, 1) = m[4]; em(1, 2) = m[5];
395 em(2, 0) = m[6]; em(2, 1) = m[7]; em(2, 2) = m[8];
396 }
397
398 // ************************************************************** Identity **
399
403 template <class F = concepts::Real>
405
406 public:
414 const concepts::Element<F>& elmY,
416
417 inline void operator()(const Constant3d000<F>& elmX,
418 const Constant3d000<F>& elmY,
420 inline void operator()(const Constant3d001<F>& elmX,
421 const Constant3d001<F>& elmY,
423 inline void operator()(const Constant3d002<F>& elmX,
424 const Constant3d002<F>& elmY,
426 void operator()(const Linear3d000<F>& elmX, const Linear3d000<F>& elmY,
428
429 virtual Identity* clone() const { return new Identity(); }
430 };
431
432 template <class F>
433 inline void Identity<F>::operator()(const Constant3d000<F>& elmX,
434 const Constant3d000<F>& elmY,
436 em.resize(1, 1);
437 em(0, 0) = (elmX.support().key() != elmY.support().key())
438 ? 0.0 : elmX.n().length() * 0.5;
439 }
440
441 template <class F>
442 inline void Identity<F>::operator()(const Constant3d001<F>& elmX,
443 const Constant3d001<F>& elmY,
445 em.resize(1, 1);
446 em(0, 0) = (elmX.support().key() != elmY.support().key())
447 ? 0.0 : elmX.n().length() * 0.5;
448 }
449
450 template <class F>
451 inline void Identity<F>::operator()(const Constant3d002<F>& elmX,
452 const Constant3d002<F>& elmY,
454 em.resize(1, 1);
455 em(0, 0) = (elmX.support().key() != elmY.support().key())
456 ? 0.0 : 1.0;
457 }
458
459 // ************************************************************ ArbKrnl000 **
460
467 template <class F, class K>
469
473 K& k_;
474 public:
478 inline ArbKrnl000(K& k) : qrA_(k), qrB_(k), k_(k) {}
479
487 const concepts::Element<F>& elmY,
489
490 inline void operator()(const Constant3d000<F>& elmX,
491 const Constant3d000<F>& elmY,
493 inline void operator()(const Constant3d001<F>& elmX,
494 const Constant3d001<F>& elmY,
496 inline void operator()(const Constant3d002<F>& elmX,
497 const Constant3d002<F>& elmY,
499 inline void operator()(const Linear3d000<F>& elmX,
500 const Linear3d000<F>& elmY,
502
503 virtual ArbKrnl000* clone() const { return new ArbKrnl000(k_); }
504 };
505
506 template <class F, class K>
507 inline void ArbKrnl000<F, K>::operator()(const Constant3d000<F>& elmX,
508 const Constant3d000<F>& elmY,
510 F m;
511 qrA_(elmX, elmY, &m);
512
513 em.resize(1, 1);
514 em(0, 0) = m;
515 }
516
517 template <class F, class K>
518 inline void ArbKrnl000<F, K>::operator()(const Constant3d001<F>& elmX,
519 const Constant3d001<F>& elmY,
521 F m;
522 qrA_(elmX, elmY, &m);
523
524 em.resize(1, 1);
525 em(0, 0) = m;
526 }
527
528 template <class F, class K>
529 inline void ArbKrnl000<F, K>::operator()(const Constant3d002<F>& elmX,
530 const Constant3d002<F>& elmY,
532 F m;
533 qrA_(elmX, elmY, &m);
534
535 em.resize(1, 1);
536 em(0, 0) = m;
537 }
538
539 template <class F, class K>
540 inline void ArbKrnl000<F, K>::operator()(const Linear3d000<F>& elmX,
541 const Linear3d000<F>& elmY,
543 F m[9];
544 qrB_(elmX, elmY, m);
545
546 em.resize(3, 3);
547 em(0, 0) = m[0]; em(0, 1) = m[1]; em(0, 2) = m[2];
548 em(1, 0) = m[3]; em(1, 1) = m[4]; em(1, 2) = m[5];
549 em(2, 0) = m[6]; em(2, 1) = m[7]; em(2, 2) = m[8];
550 }
551
552} // namespace bem
553
554#endif // bform_hh
ArbKrnl000(K &k)
Definition bform.hh:478
virtual ArbKrnl000 * clone() const
Definition bform.hh:503
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
const concepts::TMatrixBase< F > & T() const
Returns T matrix of the element.
Definition element.hh:42
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
virtual Identity * clone() const
Definition bform.hh:429
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
LaplaceDL(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Definition bform.hh:198
virtual LaplaceDL * clone() const
Definition bform.hh:193
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
virtual LaplaceHyp * clone() const
Definition bform.hh:375
LaplaceHyp(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Definition bform.hh:380
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
LaplacePLD(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Definition bform.hh:305
virtual LaplacePLD * clone() const
Definition bform.hh:299
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
LaplaceSL(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Definition bform.hh:75
virtual LaplaceSL * clone() const
Definition bform.hh:70
virtual void resize(uint m, uint n)
Definition bem.hh:18
double Real
Definition typedefs.hh:39