Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solver_BiCGStab_Cmplx.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_BICGSTAB_CMPLX_INCLUDED
15 #define SOLVER_BICGSTAB_CMPLX_INCLUDED
16 
17 #include "solver.h"
18 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
23 
43 {
44  public:
45  static const std::string class_name;
46 
47  private:
49 
51  double m_Stop_cond;
53 
55 
56  //- working area
59 
62 
63  public:
65  : Solver(), m_fopr(fopr)
66  {
67  m_use_init_guess = false;
68  //- default value of m_Omega_tolerance = 0.7 for BiCGStab
69  m_Omega_tolerance = 0.7;
70  m_Nrestart_count = 0;
71  m_Nconv_count = 0;
72  }
73 
75  : Solver(), m_fopr(fopr.get())
76  {
77  m_use_init_guess = false;
78  //- default value of m_Omega_tolerance = 0.7 for BiCGStab
79  m_Omega_tolerance = 0.7;
80  m_Nrestart_count = 0;
81  m_Nconv_count = 0;
82  }
83 
85 
86  void set_parameters(const Parameters& params);
87  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond);
88  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess);
89  void set_parameters_BiCGStab_series(const double Omega_tolerance);
90 
91  void solve(Field& solution, const Field& source,
92  int& Nconv, double& diff);
93 
94  Fopr *get_fopr() { return m_fopr; }
95 
96  double flop_count();
97 
98  private:
99  void reset_field(const Field&);
100 
101  void solve_init(const Field&, double&);
102  void solve_step(double&);
103 
104 #ifdef USE_FACTORY
105  private:
106  static Solver *create_object(Fopr *fopr)
107  {
108  return new Solver_BiCGStab_Cmplx(fopr);
109  }
110 
111  public:
112  static bool register_factory()
113  {
114  return Solver::Factory::Register("BiCGStab_Cmplx", create_object);
115  }
116 #endif
117 };
118 #endif
void reset_field(const Field &)
BridgeIO vout
Definition: bridgeIO.cpp:503
static const std::string class_name
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Container of Field-type object.
Definition: field.h:45
void set_parameters(const Parameters &params)
Class for parameters.
Definition: parameters.h:46
Solver_BiCGStab_Cmplx(unique_ptr< Fopr > &fopr)
void solve_init(const Field &, double &)
BiCGStab algorithm with complex variables.
Base class for linear solver class family.
Definition: solver.h:36
void set_parameters_BiCGStab_series(const double Omega_tolerance)
Base class of fermion operator family.
Definition: fopr.h:46