Class documentation of Concepts

Loading...
Searching...
No Matches
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
20namespace 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:
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_;
103 Haar3d000<F>** stk_;
105 Haar3d000<F>** sptr_;
106 };
107
108 // ******************************************************** Haar3d0BFSScan **
109
114 template<class F = concepts::Real>
115 class Haar3d0BFSScan : public Haar3dBFSScan<F> {
116 public:
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_;
142 Haar3d000<F>** stk_;
144 Haar3d000<F>** sptr_;
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
210 void destructor_(Haar3d000<F>* elm);
211
214 void keyset_(Haar3d000<F>* elm, uint lvl, uint gamma);
215
222 void moments_(const bem::Constant3d002<F>& elm, concepts::Real* mnts);
224 uint dim_;
226 uint nelm_;
228 uint nlvl_;
230 uint d_;
232 uint maxLocDim_;
234 uint sLocDim_;
236 concepts::Real sz_;
238 Haar3d000<F>* elm_;
240 const concepts::Space<F>& spc_;
241
243 uint *j_, *idx_;
244
248 concepts::Real *v0x_, *v0y_, *v0z_, *x_, *y_, *z_;
249
251 uint* bc_;
252
254 const bem::Constant3d002<F>** locelm_;
255
262 concepts::Real *S_, *Ut_, *At_, *work_;
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
bool eos() const
End of scan.
Definition space.hh:134
Haar3d0BFSScan< F > * clone() const
New scanner.
Definition space.hh:130
~Haar3d0BFSScan()
Destructor.
Definition space.hh:125
Haar3d000< F > & operator++(int)
Next element.
Haar3d0BFSScan(Haar3d000< F > *elm, uint ht)
void skip(uint lvl)
Skips the levels of the subtree.
Haar3d0BFSScan(const Haar3d0BFSScan< F > &sc)
Copy constructor.
Haar3d000< F > & operator++(int)
Next element.
Haar3d0DFSScan(Haar3d000< F > *elm, uint ht)
Haar3d0DFSScan< F > * clone() const
New scanner.
Definition space.hh:93
bool eos() const
End of scan.
Definition space.hh:97
Haar3d0DFSScan(const Haar3d0DFSScan< F > &sc)
Copy constructor.
~Haar3d0DFSScan()
Destructor.
Definition space.hh:88
uint d() const
Order of vanishing moments.
Definition space.hh:172
virtual ~Haar3d0()
Destructor.
Definition space.hh:163
Haar3d0(cluster::Tree< cluster::Cluster< F > > &tree, uint d=0)
concepts::Real size() const
Smallest size of a cell.
Definition space.hh:178
Haar3d0BFSScan< F > * scan() const
Scanner (same as bfsscan())
Definition space.hh:283
const concepts::Space< F > & space() const
One scale space.
Definition space.hh:180
uint nelm() const
Number of elements.
Definition space.hh:168
Haar3d0BFSScan< F > * bfsscan() const
Scanner ("breadth" first search (1. parent, 2. children))
Definition space.hh:278
Haar3d0DFSScan< F > * dfsscan() const
Scanner (depth first search (1. children, 2. parent))
Definition space.hh:273
uint dim() const
Dimension of the space.
Definition space.hh:166
uint nlvl() const
Maximal number of levels.
Definition space.hh:170
uint sumLocDim() const
Sum of the local dimensions.
Definition space.hh:176
std::ostream & info(std::ostream &os) const
Information about the space.
Definition space.hh:288
uint maxLocDim() const
Maximal local dimension.
Definition space.hh:174
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
virtual void skip(uint lvl)=0
Skips the levels of the subtree.
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
virtual ~Haar3d()
Destructor.
Definition space.hh:59
virtual Haar3dBFSScan< F > * bfsscan() const =0
Scanner ("breadth" first search (1. parent, 2. children))
virtual uint maxLocDim() const =0
Maximal number of children of an element.
virtual Haar3dDFSScan< F > * dfsscan() const =0
Scanner (depth first search (1. children, 2. parent))
virtual uint nlvl() const =0
Maximal number of levels.
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39