operator.hh

Go to the documentation of this file.
1 
6 #ifndef aglowav2Operator_hh
7 #define aglowav2Operator_hh
8 
9 #ifdef __GUNG__
10 #pragma interface
11 #endif
12 
13 #include "operator/compositions.hh"
14 #include "aglowav2/space.hh"
15 #include "aglowav2/bform.hh"
16 
17 namespace aglowav2 {
18 
19  // ***************************************************************** Delta **
20 
24  template<class F = concepts::Real>
25  class Delta {
26  public:
28  virtual bool operator()(const Haar3dXXX<F>& elmX,
29  const Haar3dXXX<F>& elmY) const = 0;
30  virtual bool operator()(const Haar3d000<F>& elmX,
31  const Haar3d000<F>& elmY) const;
32  };
33 
34  template<class F>
36  const Haar3d000<F>& elmY) const {
37  const Haar3dXXX<F>& elmXA(elmX);
38  const Haar3dXXX<F>& elmYA(elmY);
39  return (*this)(elmXA, elmYA);
40  }
41 
42  // ************************************************************* DeltaFull **
43 
49  template<class F = concepts::Real>
50  class DeltaFull : public Delta<F> {
51  public:
52  bool operator()(const Haar3dXXX<F>& elmX,
53  const Haar3dXXX<F>& elmY) const;
54  bool operator()(const Haar3d000<F>& elmX,
55  const Haar3d000<F>& elmY) const;
56  };
57 
58  // *************************************************************** Delta00 **
59 
65  template<class F = concepts::Real>
66  class Delta00 : public Delta<F> {
67  public:
69 
70  bool operator()(const Haar3dXXX<F>& elmX,
71  const Haar3dXXX<F>& elmY) const;
72  bool operator()(const Haar3d000<F>& elmX,
73  const Haar3d000<F>& elmY) const;
74 
75  private:
79 
83  };
84 
85  // ************************************************************ Operator00 **
86 
90  template<class F = concepts::Real>
91  class Operator00 : public concepts::Operator<F> {
92  public:
99  const Delta<F>& delta);
102 
107  concepts::Function<F>& fncX);
108  void operator()(const concepts::Vector<F>& fncY,
109  concepts::Vector<F>& fncX);
110 
112  const concepts::Space<F>& spaceX() const {return spc_;}
114  const concepts::Space<F>& spaceY() const {return spc_;}
115 
117  const F* diag() const {return diag_;}
119  uint memory() const {return mem_;}
120  /* Returns the maximal memory used for the construction of the matrix
121  (incl. bilinear form)
122  */
123  uint maxMemory() const {return maxmem_;}
124 
126  void pattern(std::ostream& os, uint nr) const;
130  void patternL(std::ostream& os, uint nr) const;
132  void uncompress(std::ostream& os, uint nr) const;
136  void uncompressL(std::ostream& os, uint nr) const;
137 
138  protected:
140  std::ostream& info(std::ostream& os) const;
141 
142  private:
144  struct Pattern {
146  uint index;
148  uint length;
149 
150  Pattern() : index(0), length(0) {}
151  };
152 
154  struct Matrix {
159 
160  Matrix() : valuation(0) {}
161  };
162 
164  void lstore_(concepts::ElementMatrix<F>& A, uint idx, F* val,
165  Pattern** pat);
167  void ustore_(concepts::ElementMatrix<F>& A, uint idx, F** val,
168  Pattern* pat);
170  void dstore_(concepts::ElementMatrix<F>& A, uint idx, F** val,
171  Pattern** pat);
173  void compress_(uint dim, uint idx, F valbuf[], uint nval,
174  Pattern patbuf[], uint npat);
175 
177  const Haar3d0<F>& spc_;
179  uint n_;
182 
184  uint mem_;
188  uint maxmem_;
190  uint nentry_;
191 
193  F* diag_;
194  };
195 
196 } // namespace aglowav2
197 
198 #endif // aglowav2Operator_hh
concepts::Real alpha_
Definition: operator.hh:78
uint maxmem_
Maximal memory used for the construction of the matrix (incl.
Definition: operator.hh:188
const concepts::Space< F > & spaceX() const
Returns the image space of the operator.
Definition: operator.hh:112
concepts::Real h_
Definition: operator.hh:82
uint nentry_
Number of entries in the compressed matrix.
Definition: operator.hh:190
Delta00(concepts::Real a, concepts::Real alpha, const Haar3d0< F > &spc)
void patternL(std::ostream &os, uint nr) const
Sorts unknowns by level and writes than sparsity pattern to str (Matlab format)
bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const
uint memory() const
Returns the memory used by the operator.
Definition: operator.hh:119
F * diag_
Diagonal of the matrix.
Definition: operator.hh:193
Bilinear form for the stiffness matrix compression with aglomerated wavelets.
Definition: bform.hh:29
F * valuation
Matrix values.
Definition: operator.hh:156
Abstract class for a space.
Abstract wavelet space element.
Definition: element.hh:26
Abstract class for a function.
Definition: basis.hh:21
void uncompressL(std::ostream &os, uint nr) const
Sorts unknowns by level and writes than the matrix to os in the Matlab sparse matrix format.
bool operator()(const Haar3d000< F > &elmX, const Haar3d000< F > &elmY) const
Agglomerated wavelet space.
Definition: space.hh:153
void ustore_(concepts::ElementMatrix< F > &A, uint idx, F **val, Pattern *pat)
Stores upper part in val.
std::ostream & info(std::ostream &os) const
Some information about the operator.
void uncompress(std::ostream &os, uint nr) const
Writes matrix to os in the Matlab sparse matrix format.
concepts::Real a_
Compression parameters.
Definition: operator.hh:77
Structure to hold one matrix row/column.
Definition: operator.hh:154
Matrix * mtx_
Matrix entries in sparse format.
Definition: operator.hh:181
concepts::Real Sz_
Size of the geometry.
Definition: operator.hh:81
const Haar3d0< F > & spc_
Source and image space of the operator.
Definition: operator.hh:177
virtual bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const =0
Application operator. Returns true if matrix entry essential.
bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const
Class for the truncation matrix used for wavelet compression.
Definition: operator.hh:50
const F * diag() const
Returns the diagonal of the stiffness matrix (for preconditioning)
Definition: operator.hh:117
void lstore_(concepts::ElementMatrix< F > &A, uint idx, F *val, Pattern **pat)
Stores lower part in val.
Used for the aglowav2 classes for the boundary element method.
Definition: bform.hh:16
Space element for the agglomerated wavelets.
Definition: element.hh:346
Abstract class for an operator.
Definition: ARPACK.hh:16
uint length
length of the run
Definition: operator.hh:148
Pattern * pattern
Sparsity pattern.
Definition: operator.hh:158
Class for the truncation matrix used for wavelet compression.
Definition: operator.hh:66
virtual bool operator()(const Haar3d000< F > &elmX, const Haar3d000< F > &elmY) const
Definition: operator.hh:35
const concepts::Space< F > & spaceY() const
Returns the source space of the operator.
Definition: operator.hh:114
void compress_(uint dim, uint idx, F valbuf[], uint nval, Pattern patbuf[], uint npat)
Compresses matrix lines.
uint index
End of the run.
Definition: operator.hh:146
void dstore_(concepts::ElementMatrix< F > &A, uint idx, F **val, Pattern **pat)
Stores diagonal part in val and diag_.
void pattern(std::ostream &os, uint nr) const
Writes sparsity pattern to str (Matlab format)
Element matrix.
Definition: linearForm.hh:18
Structure to hold one run of the sparsity pattern.
Definition: operator.hh:144
uint mem_
Memory used by the operator.
Definition: operator.hh:184
bool operator()(const Haar3d000< F > &elmX, const Haar3d000< F > &elmY) const
~Operator00()
Destructor.
uint maxMemory() const
Definition: operator.hh:123
Operator00(AglowavBF00< F > &bf, const Haar3d0< F > &spc, const Delta< F > &delta)
Constructor.
void operator()(const concepts::Function< F > &fncY, concepts::Function< F > &fncX)
Application operator.
Abstract class for the truncation matrix used for wavelet compression.
Definition: operator.hh:25
Stiffness matrix compressed with the agglomerated wavelets.
Definition: operator.hh:91
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
uint n_
Dimension of the space.
Definition: operator.hh:179
void operator()(const concepts::Vector< F > &fncY, concepts::Vector< F > &fncX)
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich