Bridge++  Ver. 1.1.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solver_GMRES_m_Cmplx.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_GMRES_m_CMPLX_INCLUDED
15 #define SOLVER_GMRES_m_CMPLX_INCLUDED
16 
17 #include "solver.h"
18 #include "bridge_complex.h"
19 
20 #include "bridgeIO.h"
21 using Bridge::vout;
22 
23 //- parameters class
25 {
26  public:
28 };
29 //- end
30 
32 
45 {
46  private:
47 
49  int m_Niter;
50  double m_Stop_cond;
51 
52  int m_N_M;
53 
54  std::valarray<Field> v;
55 
56  Field s, r, x, v_tmp;
57  double beta_p;
58 
59  public:
60 
62  : Solver(), m_fopr(fopr) {}
63 
65 
66  void set_parameters(const Parameters& params);
67 
68  void set_parameters(const int Niter, const double Stop_cond);
69  void set_parameters_GMRES_m(const int N_M);
70 
71  void solve(Field& solution, const Field& source,
72  int& Nconv, double& diff);
73 
74  Fopr *get_fopr() { return m_fopr; }
75 
76  private:
77 
78  void reset_field(const Field&);
79 
80  void solve_init(const Field&, double&);
81  void solve_step(const Field&, double&);
82 
83  void innerprod_c(double& prod_r, double& prod_i,
84  const Field& v, const Field& w);
85 
86  void min_J(std::valarray<dcomplex>& y,
87  std::valarray<dcomplex>& h);
88 
89  void mult_c(Field& v,
90  const Field& w,
91  const double& prod_r, const double& prod_i);
92 
93  int index_ij(int i, int j)
94  {
95  return i + (m_N_M + 1) * j;
96  }
97 };
98 #endif