xfy.hh

Go to the documentation of this file.
1 
6 #ifndef aglowav2xy_hh
7 #define aglowav2xy_hh
8 
9 #include "cluster/expansion.hh"
10 #include "aglowav2/space.hh"
11 
12 namespace aglowav2 {
13 
14  // ****************************************************************** XY00 **
15 
19  template<class F = concepts::Real>
20  class XY00 {
21  public:
29  XY00(const Haar3d0<F>& spc, const cluster::ExpansionXY<F>& exp,
30  const cluster::ExpansionXY<F>* shftExp = 0);
32  virtual ~XY00();
33 
34  inline const Haar3d0<F>& space() const {return spc_;}
36  cluster::XYColExpPtr* operator[](uint i) const {return elmptr_[i];}
38  inline uint memory() const;
39 
40  private:
48  const cluster::ExpansionXY<F>* shftExp);
49 
50  protected:
53 
54  private:
56  const Haar3d0<F>& spc_;
61  };
62 
63  template<class F>
65  for(uint i = 0; i < spc_.nelm(); i++) delete elmptr_[i];
66  delete[] elmptr_;
67  delete xy_;
68  }
69 
70  template<class F>
71  uint XY00<F>::memory() const {
72  return sizeof(XY00<F>) + spc_.nelm()*sizeof(elmptr_[0]) + xy_->memory();
73  }
74 
75  // ******************************************************************* Y00 **
76 
80  template<class F = concepts::Real>
81  class Y00 : private XY00<F> {
82  public:
87  inline Y00(const cluster::ExpansionXY<F>& exp, const Haar3d0<F>& spc);
88 
90  inline const Haar3d0<F>& space() const {return XY00<F>::space();}
92  inline cluster::XYColExpPtr* operator[](uint i) const;
94  inline uint memory() const {return XY00<F>::memory();}
95  };
96 
97  template<class F>
99  : XY00<F>(spc, exp, 0) {}
100 
101  template<class F>
103  return XY00<F>::operator[](i);
104  }
105 
106  // ******************************************************************* X00 **
107 
111  template<class F = concepts::Real>
112  class X00 : protected XY00<F> {
113  public:
119  inline X00(const cluster::ExpansionXY<F>& exp,
120  const cluster::ExpansionXY<F>& shftExp, const Haar3d0<F>& spc);
121 
123  inline const Haar3d0<F>& space() const {return XY00<F>::space();}
125  inline cluster::XYColExpPtr* operator[](uint i) const;
127  inline uint memory() const {return XY00<F>::memory();}
129  inline void apply(cluster::XYColExpPtr* x, const F* src, F* dst) const;
130  };
131 
132  template<class F>
134  const cluster::ExpansionXY<F>& shftExp, const Haar3d0<F>& spc)
135  : XY00<F>(spc, exp, &shftExp) {}
136 
137  template<class F>
139  return XY00<F>::operator[](i);
140  }
141 
142  template<class F>
143  void X00<F>::apply(cluster::XYColExpPtr* x, const F* src, F* dst) const {
144  this->exp_.apply(x, src, dst);
145  }
146 
147  // ******************************************************************* F00 **
148 
152  template<class F = concepts::Real>
153  class F00 {
154  public:
161  F00(const X00<F>& X, const Y00<F>& Y, const cluster::ExpansionF<F>& exp,
162  concepts::Real eta);
164  ~F00() {delete foo_; delete[] fee_;}
165 
166  inline const Haar3d0<F>& space() const {return X_.space();}
168  inline bool admissible(const Haar3dXXX<F>& elmX,
169  const Haar3dXXX<F>& elmY);
179  void operator()(uint idxX, uint idxY, F* valXY,
180  uint dx, uint dy, uint nx, uint ny);
191  void operator()(uint idxX, uint idxY, F* valXY, F* valYX, uint dx, uint dy,
192  uint nx, uint ny);
193 
194  private:
195  const X00<F>& X_;
196  const Y00<F>& Y_;
199  uint m_;
202 
204  F* fee_;
208  };
209 
210  template<class F>
211  F00<F>::F00(const X00<F>& X, const Y00<F>& Y,
212  const cluster::ExpansionF<F>& exp, concepts::Real eta)
213  : X_(X), Y_(Y), exp_(exp), m_(exp.m()), eta_(eta) {
214 
215  if (&X_.space() != &Y_.space())
217  MissingFeature("Different spaces not supported"));
218 
219  fee_ = new F[exp.blksz(m_)];
220  foo_ = exp.getCol(exp.blksz(m_));
221  }
222 
223  template<class F>
225  const Haar3dXXX<F>& elmY) {
226  z_ = elmY.center();
227  z_ -= elmX.center();
228  return (elmX.radius() + elmY.radius() < eta_*z_.l2());
229  }
230 
231 } // namespace aglowav2
232 
233 #endif // aglowav2xy_hh
const X00< F > & X_
Definition: xfy.hh:195
XY00(const Haar3d0< F > &spc, const cluster::ExpansionXY< F > &exp, const cluster::ExpansionXY< F > *shftExp=0)
Constructor.
uint memory() const
Memory used.
Definition: xfy.hh:127
const Haar3d0< F > & space() const
Definition: xfy.hh:34
Class for the far field matrix F.
Definition: xfy.hh:153
virtual uint blksz(uint m) const =0
Size of memory used for the expansion.
virtual FColExp * getCol(uint blksz) const =0
Allocates memory for the expansion coefficients.
uint memory() const
Memory used.
Definition: xfy.hh:94
Class for the far field matrix X.
Definition: xfy.hh:112
Class for the far field matrix Y.
Definition: xfy.hh:81
cluster::XYColExpPtr * operator[](uint i) const
Pointer to the far field values of element i.
Definition: xfy.hh:138
const Haar3d0< F > & space() const
Definition: xfy.hh:166
#define conceptsException(exc)
Prepares an exception for throwing.
Definition: exceptions.hh:344
Abstract wavelet space element.
Definition: element.hh:26
const cluster::ExpansionF< F > & exp_
Definition: xfy.hh:197
Agglomerated wavelet space.
Definition: space.hh:153
cluster::XYColExpPtr * operator[](uint i) const
Pointer to the far field values of element i.
Definition: xfy.hh:36
cluster::XYColExpPtr * operator[](uint i) const
Pointer to the far field values of element i.
Definition: xfy.hh:102
Class for the far field matrices X and Y.
Definition: xfy.hh:20
bool admissible(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY)
Admissibility condition (true if elmX and elmY in the far field)
Definition: xfy.hh:224
void apply(cluster::XYColExpPtr *x, const F *src, F *dst) const
Application of the expansion.
Definition: xfy.hh:143
uint memory() const
Memory used.
Definition: xfy.hh:71
const Haar3d0< F > & space() const
Agglomerated wavelet space.
Definition: xfy.hh:90
const concepts::Real3d & center() const
Center of the element.
Definition: element.hh:64
Used for the aglowav2 classes for the boundary element method.
Definition: bform.hh:16
const Y00< F > & Y_
Definition: xfy.hh:196
Abstract class to hold the expansion coefficients.
Definition: expansion.hh:47
X00(const cluster::ExpansionXY< F > &exp, const cluster::ExpansionXY< F > &shftExp, const Haar3d0< F > &spc)
Constructor.
Definition: xfy.hh:133
F * fee_
Auxiliary vector.
Definition: xfy.hh:204
Abstract class for the and the part of a kernel expansion.
Definition: expansion.hh:98
cluster::XYColExpPtr ** elmptr_
Pointers to the far field values of each element.
Definition: xfy.hh:58
F00(const X00< F > &X, const Y00< F > &Y, const cluster::ExpansionF< F > &exp, concepts::Real eta)
Constructor.
Definition: xfy.hh:211
void operator()(uint idxX, uint idxY, F *valXY, uint dx, uint dy, uint nx, uint ny)
Application operator (only idxX-idxY interaction is computed)
Abstract class for the part of a kernel expansion.
Definition: expansion.hh:185
concepts::Real radius() const
Radius of the element.
Definition: element.hh:66
concepts::Real3d z_
Element distance vector of the last admissible call.
Definition: xfy.hh:207
~F00()
destructor
Definition: xfy.hh:164
concepts::Real eta_
Far field coefficient.
Definition: xfy.hh:201
Class to hold expansion coefficients of type F.
Definition: expansion.hh:60
const cluster::ExpansionXY< F > & exp_
Expansion used for evaluation and application.
Definition: xfy.hh:52
Abstract class for a pointer to the expansion coefficients.
Definition: expansion.hh:18
const Haar3d0< F > & spc_
Agglomerated wavelet space.
Definition: xfy.hh:56
uint m_
Expansion order.
Definition: xfy.hh:199
Y00(const cluster::ExpansionXY< F > &exp, const Haar3d0< F > &spc)
Constructor.
Definition: xfy.hh:98
cluster::XYColExp * xy_
Far field values of the elements.
Definition: xfy.hh:60
const Haar3d0< F > & space() const
Agglomerated wavelet space.
Definition: xfy.hh:123
virtual ~XY00()
Destructor.
Definition: xfy.hh:64
cluster::FColExp * foo_
Definition: xfy.hh:205
void constructor_(cluster::XYColReal *xy, const cluster::ExpansionXY< F > *shftExp)
Private constructor (used after type cast)
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
void operator()(uint idxX, uint idxY, F *valXY, F *valYX, uint dx, uint dy, uint nx, uint ny)
Application operator (idxX-idxY and idxY-idxX interaction is computed)
Abstract class to hold the expansion coefficients.
Definition: expansion.hh:143
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich