Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solver_BiCGStab_IDS_L_Cmplx.h
Go to the documentation of this file.
1 
14 #ifndef SOLVER_BICGSTAB_IDS_L_CMPLX_INCLUDED
15 #define SOLVER_BICGSTAB_IDS_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
62  double m_rr_prev;
64 
65  std::vector<Field> m_u, m_r;
67 
72 
73  public:
75  : Solver(), m_fopr(fopr)
76  {
77  m_use_init_guess = false;
78  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_IDS_L
79  m_Omega_tolerance = 0.60;
80  m_Nrestart_count = 0;
81  m_Niter_count = 0;
82  m_Nconv_count = 0;
83  m_N_L_part_count = 0;
84  }
85 
87  : Solver(), m_fopr(fopr.get())
88  {
89  m_use_init_guess = false;
90  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_IDS_L
91  m_Omega_tolerance = 0.60;
92  m_Nrestart_count = 0;
93  m_Niter_count = 0;
94  m_Nconv_count = 0;
95  m_N_L_part_count = 0;
96  }
97 
99 
100  void set_parameters(const Parameters& params);
101  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond);
102  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess);
103  void set_parameters_BiCGStab_series(const double Omega_tolerance);
104  void set_parameters_DS_L(const int N_L, const double Tol_L);
105 
106  void solve(Field& solution, const Field& source,
107  int& Nconv, double& diff);
108 
109  Fopr *get_fopr() { return m_fopr; }
110 
111  double flop_count();
112 
113  private:
114  void reset_field(const Field&);
115 
116  void solve_init(const Field&, double&);
117  void solve_step(double&);
118 
119  int index_ij(const int i, const int j)
120  {
121  return i + m_N_L * j;
122  }
123 
124 #ifdef USE_FACTORY
125  private:
126  static Solver *create_object(Fopr *fopr)
127  {
128  return new Solver_BiCGStab_IDS_L_Cmplx(fopr);
129  }
130 
131  public:
132  static bool register_factory()
133  {
134  return Solver::Factory::Register("BiCGStab_IDS_L_Cmplx", create_object);
135  }
136 #endif
137 };
138 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void set_parameters_DS_L(const int N_L, const double Tol_L)
Container of Field-type object.
Definition: field.h:45
Solver_BiCGStab_IDS_L_Cmplx(unique_ptr< Fopr > &fopr)
int index_ij(const int i, const int j)
Class for parameters.
Definition: parameters.h:46
void solve_init(const Field &, double &)
Base class for linear solver class family.
Definition: solver.h:36
void set_parameters_BiCGStab_series(const double Omega_tolerance)
void set_parameters(const Parameters &params)
Base class of fermion operator family.
Definition: fopr.h:46
void solve(Field &solution, const Field &source, int &Nconv, double &diff)