cgUzawaFabric.hh

Go to the documentation of this file.
1 
6 #ifndef CGUzawafabric_hh
7 #define CGUzawafabric_hh
8 
9 #if __GNUC__ == 2
10 # include <float.h>
11 # define EPS DBL_EPSILON
12 #else
13 # include <limits>
14 # define EPS std::numeric_limits<double>::epsilon()
15 #endif
16 #include "cgUzawa.hh"
17 #include "operator/solverFabric.hh"
18 
19 using concepts::Real;
20 
21 namespace vectorial {
22 
23  // ********************************************************* CGUzawaFabric **
24 
32  class CGUzawaFabric : public concepts::SolverFabric<Real> {
33  public:
43  Real maxeps = EPS,
44  int maxit = 0, uint relres = 0)
45  : A_(A), B_(B), Bt_(Bt), C_(C), Ai_(Ai),
46  maxeps_(maxeps), maxit_(maxit), relres_(relres) { }
47  virtual concepts::Operator<Real>* operator()
48  (concepts::Operator<Real>& matrix) {
49  return new CGUzawa(A_, B_, Bt_, C_, Ai_, maxeps_, maxit_, relres_);
50  }
51  protected:
52  virtual std::ostream& info(std::ostream& os) const {
53  return os << concepts::typeOf(*this)<<"(maxeps = " << maxeps_ << ", maxit = "
54  << maxit_ << ", relres = " << relres_ << ")";
55  }
56  private:
70  int maxit_;
72  uint relres_;
73  };
74 
75 } // namespace vectorial
76 
77 #endif // CGUzawafabric_hh
concepts::Operator< Real > & B_
Upper right submatrix.
virtual std::ostream & info(std::ostream &os) const
concepts::Operator< Real > & Bt_
Lower left submatrix.
Vector valued problems.
Definition: spaceTraits.hh:24
Uzawa algorithm with conjugate directions for generalized saddle point problems.
Definition: cgUzawa.hh:55
concepts::Operator< Real > & A_
Upper left submatrix.
concepts::Operator< Real > & C_
Lower right submatrix.
#define EPS
Abstract fabric class for linear solvers.
Definition: jdbsym.hh:16
Fabric class for CGUzawa.
CGUzawaFabric(concepts::Operator< Real > &A, concepts::Operator< Real > &B, concepts::Operator< Real > &Bt, concepts::Operator< Real > &C, concepts::Operator< Real > &Ai, Real maxeps=EPS, int maxit=0, uint relres=0)
Constructor.
Real maxeps_
Convergence criteria for the solver.
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
uint relres_
relres = 0: absolute residual, relres = 1: relative residual
int maxit_
Convergence criteria for the solver.
concepts::Operator< Real > & Ai_
Solver for A.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich