Class documentation of Concepts

Loading...
Searching...
No Matches
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
14#include "aglowav2/space.hh"
15#include "aglowav2/bform.hh"
16
17namespace 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>
35 bool Delta<F>::operator()(const Haar3d000<F>& elmX,
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:
68 Delta00(concepts::Real a, concepts::Real alpha, const Haar3d0<F>& spc);
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:
78 concepts::Real alpha_;
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
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 {
156 F* valuation;
158 Pattern* pattern;
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_;
181 Matrix* mtx_;
182
184 uint mem_;
188 uint maxmem_;
190 uint nentry_;
191
193 F* diag_;
194 };
195
196} // namespace aglowav2
197
198#endif // aglowav2Operator_hh
bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const
Application operator. Returns true if matrix entry essential.
bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const
Application operator. Returns true if matrix entry essential.
virtual bool operator()(const Haar3dXXX< F > &elmX, const Haar3dXXX< F > &elmY) const =0
Application operator. Returns true if matrix entry essential.
const F * diag() const
Returns the diagonal of the stiffness matrix (for preconditioning)
Definition operator.hh:117
std::ostream & info(std::ostream &os) const
Some information about the operator.
uint memory() const
Returns the memory used by the operator.
Definition operator.hh:119
void pattern(std::ostream &os, uint nr) const
Writes sparsity pattern to str (Matlab format)
const concepts::Space< F > & spaceY() const
Returns the source space of the operator.
Definition operator.hh:114
void operator()(const concepts::Function< F > &fncY, concepts::Function< F > &fncX)
void uncompress(std::ostream &os, uint nr) const
Writes matrix to os in the Matlab sparse matrix format.
void uncompressL(std::ostream &os, uint nr) const
const concepts::Space< F > & spaceX() const
Returns the image space of the operator.
Definition operator.hh:112
Operator00(AglowavBF00< F > &bf, const Haar3d0< F > &spc, const Delta< F > &delta)
~Operator00()
Destructor.
void patternL(std::ostream &os, uint nr) const
virtual void operator()()
double Real
Definition typedefs.hh:39