Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solver_BiCGStab_L_Cmplx.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_BICGSTAB_L_CMPLX_INCLUDED
15 #define SOLVER_BICGSTAB_L_CMPLX_INCLUDED
16 
17 #include "solver.h"
18 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
23 
45 {
46  public:
47  static const std::string class_name;
48 
49  private:
51 
53  double m_Stop_cond;
55 
57 
58  int m_N_L;
59  double m_Tol_L;
60 
61  //- working area
63 
64  std::vector<Field> m_u, m_r;
66 
69 
70  public:
72  : Solver(), m_fopr(fopr)
73  {
74  m_use_init_guess = false;
75  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_L
76  m_Omega_tolerance = 0.60;
77  m_Nrestart_count = 0;
78  m_Nconv_count = 0;
79  }
80 
82  : Solver(), m_fopr(fopr.get())
83  {
84  m_use_init_guess = false;
85  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_L
86  m_Omega_tolerance = 0.60;
87  m_Nrestart_count = 0;
88  m_Nconv_count = 0;
89  }
90 
92 
93  void set_parameters(const Parameters& params);
94  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond);
95  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess);
96  void set_parameters_BiCGStab_series(const double Omega_tolerance);
97  void set_parameters_L(const int N_L);
98 
99  void solve(Field& solution, const Field& source,
100  int& Nconv, double& diff);
101 
102  Fopr *get_fopr() { return m_fopr; }
103 
104  double flop_count();
105 
106  private:
107  void reset_field(const Field&);
108 
109  void solve_init(const Field&, double&);
110  void solve_step(double&);
111 
112  int index_ij(const int i, const int j)
113  {
114  return i + m_N_L * j;
115  }
116 
117 #ifdef USE_FACTORY
118  private:
119  static Solver *create_object(Fopr *fopr)
120  {
121  return new Solver_BiCGStab_L_Cmplx(fopr);
122  }
123 
124  public:
125  static bool register_factory()
126  {
127  return Solver::Factory::Register("BiCGStab_L_Cmplx", create_object);
128  }
129 #endif
130 };
131 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
static const std::string class_name
void set_parameters_L(const int N_L)
BiCGStab(L) algorithm.
Container of Field-type object.
Definition: field.h:45
void solve_init(const Field &, double &)
Class for parameters.
Definition: parameters.h:46
void set_parameters(const Parameters &params)
void set_parameters_BiCGStab_series(const double Omega_tolerance)
int index_ij(const int i, const int j)
Base class for linear solver class family.
Definition: solver.h:36
Solver_BiCGStab_L_Cmplx(unique_ptr< Fopr > &fopr)
Base class of fermion operator family.
Definition: fopr.h:46
void solve(Field &solution, const Field &source, int &Nconv, double &diff)