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 
13 namespace bem {
14 
15  // ************************************************************* LaplaceSL **
16 
20  template <class F = concepts::Real>
21  class LaplaceSL : public concepts::BilinearForm<F> {
22 
27 
29  uint stroud_, gauss_;
34 
35  public:
41  inline LaplaceSL(uint stroud = 0, uint gauss = 0,
42  concepts::Real dist = 0.0);
43 
50  void operator()(const concepts::Element<F>& elmX,
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>
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>
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>
147  class LaplaceDL : public concepts::BilinearForm<F> {
148 
153 
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>
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>
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>
260  class LaplacePLD : public concepts::BilinearForm<F> {
261 
265 
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>
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>
340  class LaplaceHyp : public concepts::BilinearForm<F> {
341 
344 
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>
404  class Identity : public concepts::BilinearForm<F> {
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>
468  class ArbKrnl000 : public concepts::BilinearForm<F> {
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>
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>
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>
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>
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
Bilinear form for arbitrary kernel with NO singularities.
Evaluation of the Laplace single layer potential with constant test/trial functions.
Definition: lplGal018.hh:28
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
concepts::Real dist_
Distance to distinguish between one point integration formula and integration using the given number ...
Definition: bform.hh:350
An abstract class for an element of a space.
Definition: exceptions.hh:15
virtual LaplaceDL * clone() const
Virtual constructor.
Definition: bform.hh:193
Bilinear form to compute the Laplace double layer potential.
Definition: bform.hh:147
Linear triangular element.
Definition: element.hh:141
Constant triangular element.
Definition: element.hh:239
virtual ArbKrnl000 * clone() const
Virtual constructor.
Definition: bform.hh:503
concepts::Real dist_
Distance to distinguish between one point integration formula and integration using the given number ...
Definition: bform.hh:159
Bilinear form to compute the Laplace single layer potential.
Definition: bform.hh:21
LaplaceHyp(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Constructor.
Definition: bform.hh:380
Bilinear form to compute the adjoint of the Laplace double layer potential.
Definition: bform.hh:260
virtual LaplacePLD * clone() const
Virtual constructor.
Definition: bform.hh:299
ArbKrnlGal000< F, K > qrA_
Classes used for integration.
Definition: bform.hh:471
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
uint stroud_
Number of integration points.
Definition: bform.hh:267
LaplacePLD(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Constructor.
Definition: bform.hh:305
LplGal007< F > qrA_
Classes used for integration.
Definition: bform.hh:263
uint gauss_
Definition: bform.hh:155
LplGal006< F > qrB_
Definition: bform.hh:25
ArbKrnlGal001< F, K > qrB_
Definition: bform.hh:472
Abstract function class to evaluate a bilinear form.
Definition: bilinearForm.hh:33
concepts::Real dist_
Distance to distinguish between one point integration formula and integration using the given number ...
Definition: bform.hh:33
LplCol006< F > qrA_
Classes used for integration.
Definition: bform.hh:24
Bilinear form to compute the Laplace hypersingular operator.
Definition: bform.hh:340
uint gauss_
Definition: bform.hh:29
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
Evaluation of the Laplace hypersingular operator with linear test/trial functions.
Definition: lplGal008.hh:28
virtual LaplaceHyp * clone() const
Virtual constructor.
Definition: bform.hh:375
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
Constant space element with a level dependent key.
Definition: element.hh:335
const Key & key() const
Returns the key of the connector.
Definition: connector.hh:105
const concepts::Triangle & support() const
Returns the support.
Definition: element.hh:467
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition: element.hh:250
uint stroud_
Number of integration points.
Definition: bform.hh:346
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
uint stroud_
Number of integration points.
Definition: bform.hh:29
void operator()(const Linear3d000< F > &elmX, const Linear3d000< F > &elmY, concepts::ElementMatrix< F > &em)
const concepts::TMatrixBase< F > & T() const
Returns T matrix of the element.
Definition: element.hh:42
Bilinear form for arbitrary kernel with NO singularities.
virtual LaplaceSL * clone() const
Virtual constructor.
Definition: bform.hh:70
LplGal008< F > qrA_
Class used for integration.
Definition: bform.hh:343
const concepts::Triangle & support() const
Returns the support.
Definition: element.hh:414
LplGal018< F > qrC_
Definition: bform.hh:26
Used for the basic classes of the boundary element method.
Definition: bform.hh:13
Evaluation of the Laplace double layer potential with linear test/trial functions.
Definition: lplGal007.hh:29
Constant triangular element with normed basis function.
Definition: element.hh:427
virtual void resize(uint m, uint n)
Sets a new size.
LaplaceDL(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Constructor.
Definition: bform.hh:198
Element matrix.
Definition: linearForm.hh:18
Evaluation of the Laplace double layer potential with linear trial functions (collocation).
Definition: lplCol007.hh:27
ArbKrnl000(K &k)
Constructor.
Definition: bform.hh:478
Evaluation of the Laplace single layer potential with linear test/trial functions.
Definition: lplGal006.hh:28
Bilinear form to compute arbitrary kernels with NO singularities.
Definition: bform.hh:468
uint stroud_
Number of integration points.
Definition: bform.hh:155
Bilinear form to compute the mass matrix.
Definition: bform.hh:404
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition: element.hh:367
Dirac element on triangles (used for collocation method).
Definition: element.hh:29
Real length() const
Length of the initially given vector.
LplGal014< F > qrC_
Definition: bform.hh:152
LplGal014< F > qrB_
Definition: bform.hh:264
const concepts::Triangle & support() const
Returns the support.
Definition: element.hh:278
Evaluation of the Laplace single layer potential with linear trial functions (collocation).
Definition: lplCol006.hh:29
void operator()(const concepts::Element< F > &elmX, const concepts::Element< F > &elmY, concepts::ElementMatrix< F > &em)
Application operator.
LplCol007< F > qrA_
Classes used for integration.
Definition: bform.hh:150
Evaluation of the Laplace double layer potential with constant test/trial functions.
Definition: lplGal014.hh:29
concepts::Real dist_
Distance to distinguish between one point integration formula and integration using the given number ...
Definition: bform.hh:271
virtual Identity * clone() const
Virtual constructor.
Definition: bform.hh:429
LaplaceSL(uint stroud=0, uint gauss=0, concepts::Real dist=0.0)
Constructor.
Definition: bform.hh:75
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
LplGal007< F > qrB_
Definition: bform.hh:151
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich