Class documentation of Concepts

Loading...
Searching...
No Matches
space.hh
Go to the documentation of this file.
1
6#ifndef bemSpace_hh
7#define bemSpace_hh
8
9#include <stack>
10
11#include "basics/output.hh"
12#include "toolbox/dynArray.hh"
14#include "geometry/mesh.hh"
15#include "space/space.hh"
16#include "bem/element.hh"
17
18namespace bem {
19
20 // *************************************************************** Dirac3d **
21
32 template <class F = concepts::Real>
33 class Dirac3d : public concepts::Space<F> {
35 uint dim_;
37 uint nelm_;
40
46 void constructor_(concepts::Triangle3d* cell, uint lvl,
48
49 protected:
50 std::ostream& info(std::ostream& os) const;
51
52 public:
58 Dirac3d(concepts::Mesh2& msh, uint lvl);
59 virtual ~Dirac3d();
60
62 inline uint dim() const {return dim_;}
64 inline uint nelm() const {return nelm_;}
67 };
68
69 template <class F>
70 inline std::ostream& Dirac3d<F>::info(std::ostream& os) const {
71 os << typeOf(*this) << "(dim = " << dim_ << ", nelm = " << nelm_ << ')';
72 return os;
73 }
74
75 template <class F>
79
80 // ************************************************************** Linear3d **
81
92 template <class F = concepts::Real>
93 class Linear3d : public concepts::Space<F> {
95 uint dim_;
97 uint nelm_;
100
106 void constructor_(concepts::Triangle3d* cell, uint lvl,
108
109 protected:
110 std::ostream& info(std::ostream& os) const {return info(os, 0);}
111
112 public:
118 Linear3d(concepts::Mesh2& msh, uint lvl);
119 virtual ~Linear3d();
120
122 inline uint dim() const {return dim_;}
124 inline uint nelm() const {return nelm_;}
135 std::ostream& info(std::ostream& os, uint mode = 0) const;
136 };
137
138 template <class F>
142
143 // ************************************************************ Constant3d **
144
155 template <class F = concepts::Real>
156 class Constant3d : public concepts::Space<F> {
158 uint dim_;
160 uint nelm_;
162 uint elmType_;
165
170 void constructor_(concepts::Triangle3d* cell, uint lvl);
171
172 protected:
173 std::ostream& info(std::ostream& os) const;
174
175 public:
184 Constant3d(concepts::Mesh2& msh, uint lvl, uint elmType = 0);
185 virtual ~Constant3d();
186
188 uint dim() const {return dim_;}
190 uint nelm() const {return nelm_;}
193 };
194
195 template <class F>
199
200 template <class F>
201 inline std::ostream& Constant3d<F>::info(std::ostream& os) const {
202 os << "Constant3d(dim = " << dim_ << ", nelm = " << nelm_ << ')';
203 return os;
204 }
205
206 // ******************************************************** AdaptiveAdjust **
207
215 short l_;
216
222 AdaptiveAdjust(short l) : l_(l) {}
223
226 if (this != &adj) l_ = adj.l_;
227 return *this;
228 }
229 };
230
231 std::ostream& operator<<(std::ostream& os, const AdaptiveAdjust& adj);
232
233 // ********************************************************* AdaptiveSpace **
234
235 template<class F = concepts::Real>
237 public concepts::SpaceOnCells<F>,
238 public concepts::AdaptiveSpace<F, AdaptiveAdjust> {
239 protected:
240 std::ostream& info(std::ostream& os) const {
241 return os << "bem::" << typeOf(*this) ;
242 }
243 };
244
245 // ******************************************************* AdaptConst3d000 **
246
252 template<class F = concepts::Real>
253 class AdaptConst3d000 : public AdaptiveSpace<F> {
255 uint dim_;
257 uint nelm_;
260
262 concepts::Mesh2& msh_;
264 uint maxlvl_;
266 uint minlvl_;
272 bool rebuild_;
273
283 void rebuild0_(concepts::Connector2& cntr, int l, int& L);
284 void rebuild1_(concepts::Triangle3d& cell, uint l);
285
286 protected:
287 std::ostream& info(std::ostream& os) const {return info(os, 0);}
288
289 public:
299
303 uint dim() const;
304 uint dim();
308 uint nelm() const;
309 uint nelm();
311 uint maxlevel();
313 uint minlevel();
320 short l(Constant3d001<F>& elm) {
321 AdaptiveAdjust& adj(adj_[elm.support().key()]);
322 return adj.l_;
323 }
330 void adjust(const concepts::Element<F>& elm,const AdaptiveAdjust& a);
331 void adjust(const Constant3d001<F>& elm, const AdaptiveAdjust& a);
341 void rebuild();
349 std::ostream& info(std::ostream& os, uint mode = 0) const;
350 };
351
352 template<class F>
353 inline uint AdaptConst3d000<F>::dim() const {
355 return dim_;
356 }
357
358 template<class F>
359 inline uint AdaptConst3d000<F>::dim() {
360 if (rebuild_) rebuild();
361 return dim_;
362 }
363
364 template<class F>
365 inline uint AdaptConst3d000<F>::nelm() const {
367 return nelm_;
368 }
369
370 template<class F>
371 inline uint AdaptConst3d000<F>::nelm() {
372 if (rebuild_) rebuild();
373 return nelm_;
374 }
375
376 template<class F>
378 if (rebuild_) rebuild();
379 return maxlvl_;
380 }
381
382 template<class F>
384 if (rebuild_) rebuild();
385 return minlvl_;
386 }
387
388 template<class F>
394
395 template<class F>
398 if (rebuild_) rebuild();
400 }
401
402 // *************************************************************** EdgeMap **
403
406 class EdgeMap {
407 friend std::ostream& operator<<(std::ostream& os, const EdgeMap& emp);
408 public:
409 inline EdgeMap() : pnl1(0), pnl2(0), lvl(0), prnt(0), tag(0) {};
410 std::ostream& info(std::ostream& os) const;
411
417 ushort lvl;
427 };
428
429 // ******************************************************* AdaptConst3d001 **
430
437 template<class F = concepts::Real>
438 class AdaptConst3d001 : public AdaptiveSpace<F> {
440 uint dim_;
442 uint nelm_;
445
447 concepts::Mesh2& msh_;
449 uint maxlvl_;
451 uint minlvl_;
457 bool rebuild_;
461 ushort deltal_;
467 std::stack<EdgeMap*> stk_;
468
480 void rebuild0_(concepts::Connector2& cntr, int l, int& L);
481 void rebuild1_(concepts::Connector2& cntr);
482 void rebuild2_();
483 void rebuild3_(concepts::Triangle3d& cell, uint l);
484
485 protected:
486 std::ostream& info(std::ostream& os) const {return info(os, 0);}
487
488 public:
497 AdaptConst3d001(concepts::Mesh2& msh, uint lvl, ushort deltal);
499
503 uint dim() const;
504 uint dim();
508 uint nelm() const;
509 uint nelm();
511 uint maxlevel();
513 uint minlevel();
520 short l(Constant3d001<F>& elm) {
521 AdaptiveAdjust& adj(adj_[elm.support().key()]);
522 return adj.l_;
523 }
530 void adjust(const concepts::Element<F>& elm, const AdaptiveAdjust& a);
531 void adjust(const Constant3d001<F>& elm, const AdaptiveAdjust& a);
541 void rebuild();
549 std::ostream& info(std::ostream& os, uint mode = 0) const;
550 };
551
552 template<class F>
553 inline uint AdaptConst3d001<F>::dim() const {
555 return dim_;
556 }
557
558 template<class F>
559 inline uint AdaptConst3d001<F>::dim() {
560 if (rebuild_) rebuild();
561 return dim_;
562 }
563
564 template<class F>
565 inline uint AdaptConst3d001<F>::nelm() const {
567 return nelm_;
568 }
569
570 template<class F>
571 inline uint AdaptConst3d001<F>::nelm() {
572 if (rebuild_) rebuild();
573 return nelm_;
574 }
575
576 template<class F>
578 if (rebuild_) rebuild();
579 return maxlvl_;
580 }
581
582 template<class F>
584 if (rebuild_) rebuild();
585 return minlvl_;
586 }
587
588 template<class F>
594
595 template<class F>
598 if (rebuild_) rebuild();
600 }
601
602 // ******************************************************* AdaptConst3d002 **
603
612 template<class F = concepts::Real>
613 class AdaptConst3d002 : public AdaptiveSpace<F> {
615 uint dim_;
617 uint nelm_;
620
622 concepts::Mesh2& msh_;
624 uint maxlvl_;
626 uint minlvl_;
632 bool rebuild_;
636 ushort deltal_;
638 ushort deltaL_;
644 std::stack<EdgeMap*> stk_;
645
657 void rebuild0_(concepts::Connector2& cntr, int l, int& L);
658 void rebuild1_(concepts::Connector2& cntr, uint l);
659 void rebuild2_();
660 void rebuild3_(concepts::Triangle3d& cell, uint l, ushort tag);
661
662 protected:
663 std::ostream& info(std::ostream& os) const {return info(os, 0);}
664
665 public:
675 AdaptConst3d002(concepts::Mesh2& msh, uint lvl, ushort deltal,
676 ushort deltaL);
678
682 uint dim() const;
683 uint dim();
687 uint nelm() const;
688 uint nelm();
690 uint maxlevel();
692 uint minlevel();
699 short l(Constant3d001<F>& elm) {
700 AdaptiveAdjust& adj(adj_[elm.support().key()]);
701 return adj.l_;
702 }
709 void adjust(const concepts::Element<F>& elm, const AdaptiveAdjust& a);
710 void adjust(const Constant3d001<F>& elm, const AdaptiveAdjust& a);
720 void rebuild();
728 std::ostream& info(std::ostream& os, uint mode = 0) const;
729 };
730
731 template<class F>
732 inline uint AdaptConst3d002<F>::dim() const {
734 return dim_;
735 }
736
737 template<class F>
738 inline uint AdaptConst3d002<F>::dim() {
739 if (rebuild_) rebuild();
740 return dim_;
741 }
742
743 template<class F>
744 inline uint AdaptConst3d002<F>::nelm() const {
746 return nelm_;
747 }
748
749 template<class F>
750 inline uint AdaptConst3d002<F>::nelm() {
751 if (rebuild_) rebuild();
752 return nelm_;
753 }
754
755 template<class F>
757 if (rebuild_) rebuild();
758 return maxlvl_;
759 }
760
761 template<class F>
763 if (rebuild_) rebuild();
764 return minlvl_;
765 }
766
767 template<class F>
773
774 template<class F>
777 if (rebuild_) rebuild();
779 }
780
781} // namespace bem
782
783#endif // bemSpace_hh
#define conceptsException(exc)
AdaptConst3d000(concepts::Mesh2 &msh, uint lvl)
uint dim() const
Definition space.hh:353
uint nelm() const
Definition space.hh:365
std::ostream & info(std::ostream &os, uint mode=0) const
short l(Constant3d001< F > &elm)
Returns the level of a element.
Definition space.hh:320
uint maxlevel()
Returns the maximal level of all elements.
Definition space.hh:377
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:287
void adjust(const concepts::Element< F > &elm, const AdaptiveAdjust &a)
concepts::Scan< concepts::ElementWithCell< F > > * scan() const
Definition space.hh:390
uint minlevel()
Returns the minimal level of all elements.
Definition space.hh:383
AdaptConst3d001(concepts::Mesh2 &msh, uint lvl, ushort deltal)
uint dim() const
Definition space.hh:553
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:486
uint minlevel()
Returns the minimal level of all elements.
Definition space.hh:583
uint nelm() const
Definition space.hh:565
void adjust(const concepts::Element< F > &elm, const AdaptiveAdjust &a)
concepts::Scan< concepts::ElementWithCell< F > > * scan() const
Definition space.hh:590
std::ostream & info(std::ostream &os, uint mode=0) const
short l(Constant3d001< F > &elm)
Returns the level of a element.
Definition space.hh:520
uint maxlevel()
Returns the maximal level of all elements.
Definition space.hh:577
concepts::Scan< concepts::ElementWithCell< F > > * scan() const
Definition space.hh:769
std::ostream & info(std::ostream &os, uint mode=0) const
void adjust(const concepts::Element< F > &elm, const AdaptiveAdjust &a)
AdaptConst3d002(concepts::Mesh2 &msh, uint lvl, ushort deltal, ushort deltaL)
uint dim() const
Definition space.hh:732
uint minlevel()
Returns the minimal level of all elements.
Definition space.hh:762
short l(Constant3d001< F > &elm)
Returns the level of a element.
Definition space.hh:699
uint nelm() const
Definition space.hh:744
uint maxlevel()
Returns the maximal level of all elements.
Definition space.hh:756
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:663
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:240
const concepts::Triangle & support() const
Returns the support.
Definition element.hh:414
concepts::Scan< concepts::Element< F > > * scan() const
Returns a scanner of the space.
Definition space.hh:196
uint dim() const
Returns the number of degrees of freedom.
Definition space.hh:188
Constant3d(concepts::Mesh2 &msh, uint lvl, uint elmType=0)
uint nelm() const
Returns the number of elements.
Definition space.hh:190
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:201
uint nelm() const
Returns number of elements in the space.
Definition space.hh:64
Dirac3d(concepts::Mesh2 &msh, uint lvl)
concepts::Scan< concepts::Element< F > > * scan() const
Returns a scanner of the space.
Definition space.hh:76
uint dim() const
Returns dimension of the space.
Definition space.hh:62
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:70
concepts::uchar tag
Definition space.hh:426
concepts::Connector2 * pnl2
neighbouring panel on the lower level
Definition space.hh:415
concepts::Connector2 * pnl1
neighbouring panel on the higher level
Definition space.hh:413
EdgeMap * prnt
pointer to the EdgeMap of the parent edge
Definition space.hh:419
ushort lvl
level difference to the highest level on this edge
Definition space.hh:417
concepts::Scan< concepts::Element< F > > * scan() const
Returns a scanner of the space.
Definition space.hh:139
Linear3d(concepts::Mesh2 &msh, uint lvl)
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition space.hh:110
std::ostream & info(std::ostream &os, uint mode=0) const
uint dim() const
Returns the number of degrees of freedom.
Definition space.hh:122
uint nelm() const
Returns the number of elements.
Definition space.hh:124
const Key & key() const
Returns the key of the connector.
Definition connector.hh:105
Definition bem.hh:18
unsigned char uchar
Abbreviation for unsigned char.
Definition typedefs.hh:48
AdaptiveAdjust(short l)
Definition space.hh:222
AdaptiveAdjust & operator=(const AdaptiveAdjust &adj)
Assignment operator.
Definition space.hh:225
short l_
Level.
Definition space.hh:215
AdaptiveAdjust()
Default constructor.
Definition space.hh:218