space.hh

Go to the documentation of this file.
1 
6 #ifndef aglowav2Space_hh
7 #define aglowav2Space_hh
8 
9 #ifdef __GUNG__
10 #pragma interface
11 #endif
12 
14 #include "space/space.hh"
15 #include "bem/element.hh"
16 #include "cluster/tree.hh"
17 #include "aglowav2/element.hh"
18 #include "basics/output.hh"
19 
20 namespace aglowav2 {
21 
22  // ********************************************************* Haar3dDFSScan **
23 
28  template<class F = concepts::Real>
29  class Haar3dDFSScan : public concepts::Scan<concepts::Element<F> > {
30  public:
32  virtual Haar3dXXX<F>& operator++(int) = 0;
33  };
34 
35  // ********************************************************* Haar3dBFSScan **
36 
41  template<class F = concepts::Real>
42  class Haar3dBFSScan : public concepts::Scan<concepts::Element<F> > {
43  public:
45  virtual Haar3dXXX<F>& operator++(int) = 0;
47  virtual void skip(uint lvl) = 0;
48  };
49 
50  // **************************************************************** Haar3d **
51 
55  template<class F = concepts::Real>
56  class Haar3d : public concepts::Space<F> {
57  public:
59  virtual ~Haar3d() {}
60 
62  virtual uint nlvl() const = 0;
64  virtual uint maxLocDim() const = 0;
66  virtual Haar3dDFSScan<F>* dfsscan() const = 0;
68  virtual Haar3dBFSScan<F>* bfsscan() const = 0;
69  };
70 
71  // ******************************************************** Haar3d0DFSScan **
72 
77  template<class F = concepts::Real>
78  class Haar3d0DFSScan : public Haar3dDFSScan<F> {
79  public:
84  Haar3d0DFSScan(Haar3d000<F>* elm, uint ht);
88  inline ~Haar3d0DFSScan() {delete[] stk_;}
89 
93  inline Haar3d0DFSScan<F>* clone() const {
94  return new Haar3d0DFSScan<F>(*this);
95  }
97  inline bool eos() const {return sptr_[0] ? 0 : 1;}
98 
99  private:
101  uint ht_;
106  };
107 
108  // ******************************************************** Haar3d0BFSScan **
109 
114  template<class F = concepts::Real>
115  class Haar3d0BFSScan : public Haar3dBFSScan<F> {
116  public:
121  Haar3d0BFSScan(Haar3d000<F>* elm, uint ht);
125  inline ~Haar3d0BFSScan() {delete[] stk_;}
126 
130  inline Haar3d0BFSScan<F>* clone() const {
131  return new Haar3d0BFSScan<F>(*this);
132  }
134  inline bool eos() const {return sptr_[0] ? 0 : 1;}
136  void skip(uint lvl);
137 
138  private:
140  uint ht_;
145  };
146 
147  // *************************************************************** Haar3d0 **
148 
152  template<class F = concepts::Real>
153  class Haar3d0 : public Haar3d<F> {
154  public:
163  virtual ~Haar3d0() {destructor_(elm_);}
164 
166  inline uint dim() const {return dim_;}
168  inline uint nelm() const {return nelm_;}
170  inline uint nlvl() const {return nlvl_;}
172  inline uint d() const {return d_;}
174  inline uint maxLocDim() const {return maxLocDim_;}
176  inline uint sumLocDim() const {return sLocDim_;}
178  inline concepts::Real size() const {return sz_;}
180  inline const concepts::Space<F>& space() const {return spc_;}
181 
183  inline Haar3d0DFSScan<F>* dfsscan() const;
185  inline Haar3d0BFSScan<F>* bfsscan() const;
187  inline Haar3d0BFSScan<F>* scan() const;
188 
189  protected:
191  std::ostream& info(std::ostream& os) const;
192 
193  private:
204  void constructor_(const cluster::Cluster<F>* clst, uint lvl,
205  Haar3d000<F>** Chld, Haar3d000<F>** Curchld,
206  uint* nChld, const bem::Constant3d002<F>** Elm,
207  uint* nElm, concepts::Real* At, uint* nAt);
208 
211 
214  void keyset_(Haar3d000<F>* elm, uint lvl, uint gamma);
215 
224  uint dim_;
226  uint nelm_;
228  uint nlvl_;
230  uint d_;
234  uint sLocDim_;
241 
243  uint *j_, *idx_;
244 
249 
251  uint* bc_;
252 
255 
263 
267  static const uint MAXLOCDIM_;
269  static const concepts::Real EPS_;
270  };
271 
272  template<class F>
274  return new Haar3d0DFSScan<F>(elm_, nlvl_);
275  }
276 
277  template<class F>
279  return new Haar3d0BFSScan<F>(elm_, nlvl_);
280  }
281 
282  template<class F>
284  return new Haar3d0BFSScan<F>(elm_, nlvl_);
285  }
286 
287  template<class F>
288  std::ostream& Haar3d0<F>::info(std::ostream& os) const {
289  os << "aglowav2::" <<concepts::typeOf(*this)<<"(dim=" << dim_ << ", maxLocDim=" << maxLocDim_;
290  os << ", nlvl=" << nlvl_ << ", nelm=" << nelm_ << ", d=" << d_ << ')';
291  return os;
292  }
293 
294 } // namespace aglowav2
295 
296 #endif // aglowav2Space_hh
Haar3d0DFSScan(Haar3d000< F > *elm, uint ht)
Constructor.
Haar3d0BFSScan(Haar3d000< F > *elm, uint ht)
Constructor.
void skip(uint lvl)
Skips the levels of the subtree.
bool eos() const
End of scan.
Definition: space.hh:97
static const uint MAXLOCDIM_
Maximal dimension of local transformation matrix.
Definition: space.hh:267
Haar3d0DFSScan(const Haar3d0DFSScan< F > &sc)
Copy constructor.
uint maxLocDim() const
Maximal local dimension.
Definition: space.hh:174
Haar3d0BFSScan< F > * bfsscan() const
Scanner ("breadth" first search (1. parent, 2. children))
Definition: space.hh:278
virtual ~Haar3d0()
Destructor.
Definition: space.hh:163
Scanner of the Haar3d space ("breadth" first search (bfs)) (1.
Definition: space.hh:42
Haar3d0BFSScan< F > * clone() const
New scanner.
Definition: space.hh:130
concepts::Real * x_
Definition: space.hh:248
uint nlvl_
Maximal number of levels.
Definition: space.hh:228
uint sLocDim_
Sum of the local dimensions.
Definition: space.hh:234
bool eos() const
End of scan.
Definition: space.hh:134
uint dim_
Space dimension.
Definition: space.hh:224
std::ostream & info(std::ostream &os) const
Information about the space.
Definition: space.hh:288
~Haar3d0DFSScan()
Destructor.
Definition: space.hh:88
concepts::Real * y_
Definition: space.hh:248
Abstract class for a space.
uint nelm_
Number of space elements.
Definition: space.hh:226
uint * j_
Auxiliary vectors for the keys of the elements and the DoF's.
Definition: space.hh:243
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
Scanner of the Haar3d space (depth first search (dfs)) (1.
Definition: space.hh:28
Agglomerated wavelet space.
Definition: space.hh:153
~Haar3d0BFSScan()
Destructor.
Definition: space.hh:125
concepts::Real sz_
Smallest size of a cell.
Definition: space.hh:236
Scanner of the Haar3d0 space (depth first search (dfs)) (1.
Definition: space.hh:78
uint ht_
Height of the stack.
Definition: space.hh:101
Haar3d0DFSScan< F > * dfsscan() const
Scanner (depth first search (1. children, 2. parent))
Definition: space.hh:273
const concepts::Space< F > & spc_
One scale space.
Definition: space.hh:240
Abstract space element for the agglomerated wavelets.
Definition: element.hh:104
Scanner of the Haar3d0 space ("breadth" first search (bfs)) (1.
Definition: space.hh:115
Haar3d000< F > * elm_
Root of the wavelet tree.
Definition: space.hh:238
uint d() const
Order of vanishing moments.
Definition: space.hh:172
concepts::Real * Ut_
Definition: space.hh:262
Used for the aglowav2 classes for the boundary element method.
Definition: bform.hh:16
Scanner of the Haar3d space (depth first search (dfs)) (1.
Definition: space.hh:29
static const concepts::Real EPS_
Threshold for singular values.
Definition: space.hh:269
virtual ~Haar3d()
Destructor.
Definition: space.hh:59
void moments_(const bem::Constant3d002< F > &elm, concepts::Real *mnts)
Computes the moments up to order d (normed basis functions are assumed)
concepts::Real * v0z_
Definition: space.hh:248
Scanner of the Haar3d space ("breadth" first search (bfs)) (1.
Definition: space.hh:42
Haar3d0(cluster::Tree< cluster::Cluster< F > > &tree, uint d=0)
Constructor.
const concepts::Space< F > & space() const
One scale space.
Definition: space.hh:180
Haar3d000< F > ** sptr_
Stack pointer.
Definition: space.hh:144
concepts::Real size() const
Smallest size of a cell.
Definition: space.hh:178
void constructor_(const cluster::Cluster< F > *clst, uint lvl, Haar3d000< F > **Chld, Haar3d000< F > **Curchld, uint *nChld, const bem::Constant3d002< F > **Elm, uint *nElm, concepts::Real *At, uint *nAt)
Constructor for recursive calls.
Space element for the agglomerated wavelets.
Definition: element.hh:346
void keyset_(Haar3d000< F > *elm, uint lvl, uint gamma)
Sets the key and gamma of each element correctly.
Haar3d000< F > ** sptr_
Stack pointer.
Definition: space.hh:105
Haar3d000< F > & operator++(int)
Next element.
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
uint nlvl() const
Maximal number of levels.
Definition: space.hh:170
Haar3d0BFSScan< F > * scan() const
Scanner (same as bfsscan())
Definition: space.hh:283
Abstract class for a cluster tree.
Definition: tree.hh:274
uint maxLocDim_
Maximal local dimension.
Definition: space.hh:232
concepts::Real * v0x_
Auxiliary vectors for the computation of the moments (used only in the constructor.
Definition: space.hh:248
Haar3d0DFSScan< F > * clone() const
New scanner.
Definition: space.hh:93
virtual uint nlvl() const =0
Maximal number of levels.
Haar3d0BFSScan(const Haar3d0BFSScan< F > &sc)
Copy constructor.
uint ht_
Height of the stack.
Definition: space.hh:140
uint dim() const
Dimension of the space.
Definition: space.hh:166
Constant triangular element with normed basis function.
Definition: element.hh:427
concepts::Real * v0y_
Definition: space.hh:248
virtual Haar3dDFSScan< F > * dfsscan() const =0
Scanner (depth first search (1. children, 2. parent))
Haar3d000< F > & operator++(int)
Next element.
uint sumLocDim() const
Sum of the local dimensions.
Definition: space.hh:176
const bem::Constant3d002< F > ** locelm_
Auxiliary vectors for local elements (used only in the constructor)
Definition: space.hh:254
Haar3d000< F > ** stk_
Begin of the stack.
Definition: space.hh:142
virtual Haar3dBFSScan< F > * bfsscan() const =0
Scanner ("breadth" first search (1. parent, 2. children))
uint * bc_
Binomial coefficients (used only in the constructor)
Definition: space.hh:251
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
Abstract wavelet space.
Definition: space.hh:56
concepts::Real * z_
Definition: space.hh:248
void destructor_(Haar3d000< F > *elm)
Destructor for recursive calls.
Node of a cluster tree.
Definition: tree.hh:120
concepts::Real * At_
Definition: space.hh:262
concepts::Real * work_
Definition: space.hh:262
concepts::Real * S_
Auxiliary vectors for the SVD (used only in the constructor) s_ Singular values ut_ Local transformat...
Definition: space.hh:262
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
virtual uint maxLocDim() const =0
Maximal number of children of an element.
uint d_
Order of vanishing moments.
Definition: space.hh:230
Haar3d000< F > ** stk_
Begin of the stack.
Definition: space.hh:103
virtual void skip(uint lvl)=0
Skips the levels of the subtree.
uint nelm() const
Number of elements.
Definition: space.hh:168
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich