Class documentation of Concepts

Loading...
Searching...
No Matches
element.hh
Go to the documentation of this file.
1
6#ifndef bemElement_hh
7#define bemElement_hh
8
10#include "geometry/cell2D.hh"
11#include "space/tmatrix.hh"
12#include "space/element.hh"
13
14namespace concepts {
15 // forward declatation
16 template<typename F> class ElementGraphics;
17}
18
19namespace bem {
20
21 // ************************************************************ Dirac3d000 **
22
23#if 1
28 template <class F = concepts::Real>
30 public:
39 uint vtx[], uint n);
40
42 inline const concepts::TMatrixBase<F>& T() const {return T_;}
46 inline const concepts::Vertex& support(uint i) const;
50 inline const concepts::Real3d& vertex(uint i) const {return v_[i];}
51 virtual const concepts::Triangle3d& cell() const { return cell_; }
52 protected:
53 virtual std::ostream& info(std::ostream& os) const;
54
55 private:
57 const concepts::Triangle3d& cell_;
59 concepts::uchar ctrl_;
63 concepts::Real3d v_[3];
64 };
65
66
67 template <class F>
68 inline const concepts::Vertex& Dirac3d000<F>::support(uint i) const {
69 uint j = ctrl_ >> (i << 1);
70 return *cell_.connector().vertex(j & 3);
71 }
72
73#else
74
79 template <class F = concepts::Real>
80 class Dirac3d000 : public conceptsElement<F> {
81 public:
89 inline Dirac3d000(const concepts::Triangle3d& cell, uint idx[],
90 uint vtx[], uint n);
91
93 inline const concepts::TMatrixBase<F>& T() const {return T_;}
97 inline const concepts::Vertex& support(uint i) const;
101 concepts::Real3d vertex(uint i) const;
102
103 protected:
104 virtual std::ostream& info(std::ostream& os) const;
105
106 private:
108 const concepts::Triangle3d& cell_;
110 concepts::uchar ctrl_;
113 };
114
115 template <class F>
117 uint idx[], uint vtx[], uint n)
118 : cell_(cell), T_(n, n, idx) {
119
120 ctrl_ = 0;
121 for(uint i = n; i--;) {ctrl_ <<= 2; ctrl_ |= vtx[i] & 3;}
122 }
123
124 template <class F>
125 inline const concepts::Vertex& Dirac3d000<F>::support(uint i) const {
126 uint j = ctrl_ >> (i << 1);
127 return *cell_.connector().vertex(j & 3);
128 }
129
130#endif
131
132 // *********************************************************** Linear3d000 **
133
134#if 1
135
140 template <class F = concepts::Real>
142 public:
148
150 inline const concepts::TMatrixBase<F>& T() const {return T_;}
152 inline const concepts::Unit3d& n() const {return n_;}
154 inline const concepts::Triangle& support() const;
158 inline const concepts::Real3d& vertex(uint i) const {return v_[i];}
159
160 virtual const concepts::Triangle3d& cell() const {return cell_;}
161
162 virtual const concepts::ElementGraphics<F>* graphics() const;
163
164 protected:
165 std::ostream& info(std::ostream& os) const;
166
167 private:
168 const concepts::Triangle3d& cell_;
172 concepts::Real3d v_[3];
175
176 static std::unique_ptr<concepts::ElementGraphics<F> > graphics_;
177 };
178
179 template <class F>
181 return cell_.connector();
182 }
183
184#else
185
190 template <class F = concepts::Real>
191 class Linear3d000 : public concepts::ElementWithCell<F> {
192 public:
197 Linear3d000(const concepts::Triangle3d& cell, uint idx[]);
198
200 inline const concepts::TMatrixBase<F>& T() const {return T_;}
202 inline const concepts::Unit3d& n() const {return n_;}
204 inline const concepts::Triangle& support() const;
208 concepts::Real3d vertex(uint i) const;
209
210 virtual const concepts::Triangle3d& cell() const {return cell_;}
211
212 protected:
213 std::ostream& info(std::ostream& os) const;
214
215 private:
216 const concepts::Triangle3d& cell_;
221 };
222
223 template <class F>
224 inline const concepts::Triangle& Linear3d000<F>::support() const {
225 return cell_.connector();
226 }
227
228#endif
229
230 // ********************************************************* Constant3d000 **
231
232#if 1
233
238 template <class F = concepts::Real>
240 public:
246
248 inline const concepts::TMatrixBase<F>& T() const {return T_;}
250 inline const concepts::Unit3d& n() const {return n_;}
252 inline const concepts::Triangle& support() const;
256 inline const concepts::Real3d& vertex(uint i) const {return v_[i];}
257
258 virtual const concepts::Triangle3d& cell() const {return cell_;}
259
260 virtual const concepts::ElementGraphics<F>* graphics() const;
261
262 protected:
263 std::ostream& info(std::ostream& os) const;
264
265 private:
266 const concepts::Triangle3d& cell_;
272 concepts::Real3d v_[3];
273
274 static std::unique_ptr<concepts::ElementGraphics<F> > graphics_;
275 };
276
277 template <class F>
279 return cell_.connector();
280 }
281
282#else
283
288 template <class F = concepts::Real>
289 class Constant3d000 : public concepts::ElementWithCell<F> {
290 public:
295 Constant3d000(const concepts::Triangle3d& cell, uint idx);
296
298 inline const concepts::TMatrixBase<F>& T() const {return T_;}
300 inline const concepts::Unit3d& n() const {return n_;}
302 inline const concepts::Triangle& support() const;
306 concepts::Real3d vertex(uint i) const;
307
308 virtual const concepts::Triangle3d& cell() const {return cell_;}
309
310 protected:
311 std::ostream& info(std::ostream& os) const;
312
313 private:
314 const concepts::Triangle3d& cell_;
319 };
320
321 template <class F>
322 inline const concepts::Triangle& Constant3d000<F>::support() const {
323 return cell_.connector();
324 }
325
326#endif
327
328 // ********************************************************* Constant3d001 **
329
334 template<class F = concepts::Real>
336 public:
338 class Key {
339 public:
340 inline Key(uint l, uint j) : l_(l), j_(j) {}
341 inline Key(const Key& key) : l_(key.l()), j_(key.j()) {}
342
343 inline int operator==(const Key& key) const {
344 return l_ == key.l() && j_ == key.j();
345 }
346 inline uint l() const {return l_;}
347 inline uint j() const {return j_;}
348
349 private:
351 uint l_;
353 uint j_;
354 };
355
362 const Constant3d001<F>::Key& key, uint idx);
363
365 inline const concepts::TMatrixBase<F>& T() const {return T_;}
367 inline const concepts::Unit3d& n() const {return n_;}
369 inline const concepts::Triangle& support() const;
373 inline const concepts::Real3d& vertex(uint i) const {return v_[i];}
374
375 virtual concepts::Triangle3d& cell() const {return *cell_;}
377 inline const Key& key() const {return key_;};
378
383 static inline uint maxlevel() {return maxlvl_;}
384 static inline uint minlevel() {return minlvl_;}
385 static inline void setmaxlevel(uint maxlvl) {maxlvl_ = maxlvl;}
386 static inline void setminlevel(uint minlvl) {minlvl_ = minlvl;}
387
388 virtual const concepts::ElementGraphics<F>* graphics() const;
389
390 protected:
391 std::ostream& info(std::ostream& os) const;
392
393 private:
401 concepts::Real3d v_[3];
403 Key key_;
404
406 static uint maxlvl_;
408 static uint minlvl_;
409
410 static std::unique_ptr<concepts::ElementGraphics<F> > graphics_;
411 };
412
413 template<class F>
415 return cell_->connector();
416 }
417
418 // ********************************************************* Constant3d002 **
419
420#if 1
421
426 template <class F = concepts::Real>
428 public:
434 virtual ~Constant3d002();
435
437 inline const concepts::TMatrixBase<F>& T() const {return T_;}
439 inline const concepts::Unit3d& n() const {return n_;}
441 inline const concepts::Triangle& support() const;
445 inline const concepts::Real3d& vertex(uint i) const {return v_[i];}
446
447 virtual const concepts::Triangle3d& cell() const {return cell_;}
448
449 virtual const concepts::ElementGraphics<F>* graphics() const;
450
451 protected:
452 std::ostream& info(std::ostream& os) const;
453
454 private:
455 const concepts::Triangle3d& cell_;
461 concepts::Real3d v_[3];
462
463 static std::unique_ptr<concepts::ElementGraphics<F> > graphics_;
464 };
465
466 template <class F>
468 return cell_.connector();
469 }
470
471#else
472
477 template <class F = concepts::Real>
478 class Constant3d002 : public concepts::ElementWithCell<F> {
479 public:
484 Constant3d002(const concepts::Triangle3d& cell, uint idx);
485
487 inline const concepts::TMatrixBase<F>& T() const {return T_;}
489 inline const concepts::Unit3d& n() const {return n_;}
491 inline const concepts::Triangle& support() const;
495 concepts::Real3d vertex(uint i) const;
496
497 virtual const concepts::Triangle3d& cell() const {return cell_;}
498
499 protected:
500 std::ostream& info(std::ostream& os) const;
501
502 private:
503 const concepts::Triangle3d& cell_;
508 };
509
510 template <class F>
511 inline const concepts::Triangle& Constant3d002<F>::support() const {
512 return cell_.connector();
513 }
514
515#endif
516
517} // namespace bem
518
519#endif // bemElement_hh
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual const concepts::Triangle3d & cell() const
Returns the cell on which the element is built.
Definition element.hh:258
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition element.hh:250
const concepts::Real3d & vertex(uint i) const
Definition element.hh:256
const concepts::Triangle & support() const
Returns the support.
Definition element.hh:278
Constant3d000(const concepts::Triangle3d &cell, uint idx)
const concepts::TMatrixBase< F > & T() const
Returns the T matix of the element.
Definition element.hh:248
Key with some level dependent information.
Definition element.hh:338
Constant3d001(concepts::Triangle3d &cell, const Constant3d001< F >::Key &key, uint idx)
const Key & key() const
Returns the key of the element.
Definition element.hh:377
static uint maxlevel()
Definition element.hh:383
const concepts::Triangle & support() const
Returns the support.
Definition element.hh:414
virtual concepts::Triangle3d & cell() const
Returns the cell on which the element is built.
Definition element.hh:375
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const concepts::TMatrixBase< F > & T() const
Returns the T matix of the element.
Definition element.hh:365
const concepts::Real3d & vertex(uint i) const
Definition element.hh:373
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition element.hh:367
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual const concepts::Triangle3d & cell() const
Returns the cell on which the element is built.
Definition element.hh:447
const concepts::TMatrixBase< F > & T() const
Returns the T matix of the element.
Definition element.hh:437
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition element.hh:439
const concepts::Real3d & vertex(uint i) const
Definition element.hh:445
Constant3d002(const concepts::Triangle3d &cell, uint idx)
const concepts::Triangle & support() const
Returns the support.
Definition element.hh:467
const concepts::Vertex & support(uint i) const
Definition element.hh:68
const concepts::Real3d & vertex(uint i) const
Definition element.hh:50
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Dirac3d000(const concepts::Triangle3d &cell, uint idx[], uint vtx[], uint n)
virtual const concepts::Triangle3d & cell() const
Returns the cell on which the element is built.
Definition element.hh:51
const concepts::TMatrixBase< F > & T() const
Returns T matrix of the element.
Definition element.hh:42
Linear3d000(const concepts::Triangle3d &cell, uint idx[])
const concepts::Triangle & support() const
Returns the support.
Definition element.hh:180
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const concepts::Unit3d & n() const
Returns the normal of the element.
Definition element.hh:152
const concepts::TMatrixBase< F > & T() const
Returns the T matix of the element.
Definition element.hh:150
virtual const concepts::Triangle3d & cell() const
Returns the cell on which the element is built.
Definition element.hh:160
const concepts::Real3d & vertex(uint i) const
Definition element.hh:158
Definition bem.hh:18
unsigned char uchar
Abbreviation for unsigned char.
Definition typedefs.hh:48