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