Bridge++  Ver. 2.0.2
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 
55  double m_Stop_cond;
57 
59 
60  int m_N_L;
61  double m_Tol_L;
62 
63  //- working area
65 
66  std::vector<Field> m_u, m_r;
68 
71 
72  public:
74  : m_vl(CommonParameters::Vlevel()), m_fopr(fopr)
75  {
76  m_use_init_guess = false;
77  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_L
78  m_Omega_tolerance = 0.60;
79  m_Nrestart_count = 0;
80  m_Nconv_count = 0;
81  }
82 
83  Solver_BiCGStab_L_Cmplx(Fopr *fopr, const Parameters& params)
84  : m_vl(CommonParameters::Vlevel()), m_fopr(fopr)
85  {
86  //- default parameter values
87  m_use_init_guess = false;
88  //- default value of m_Omega_tolerance = 0.60 for BiCGStab_L
89  m_Omega_tolerance = 0.60;
90  m_Nrestart_count = 0;
91  m_Nconv_count = 0;
92 
93  set_parameters(params);
94  }
95 
97 
98  void set_parameters(const Parameters& params);
99 
100  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond);
101  DEPRECATED
102  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess);
103  DEPRECATED
104  void set_parameters_BiCGStab_series(const double Omega_tolerance);
105  DEPRECATED
106  void set_parameters_L(const int N_L);
107 
108  void set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess, const double Omega_tolerance, const int N_L);
109 
110  void get_parameters(Parameters& params) const;
111 
112  void solve(Field& solution, const Field& source, int& Nconv, double& diff);
113 
114  Fopr *get_fopr() { return m_fopr; }
115 
116  double flop_count();
117 
118  private:
119  void reset_field(const Field&);
120 
121  void solve_init(const Field&, double&);
122  void solve_step(double&);
123 
124  int index_ij(const int i, const int j)
125  {
126  return i + m_N_L * j;
127  }
128 
129 #ifdef USE_FACTORY
130  private:
131  static Solver *create_object(Fopr *fopr)
132  {
133  return new Solver_BiCGStab_L_Cmplx(fopr);
134  }
135 
136  static Solver *create_object_with_params(Fopr *fopr, const Parameters& params)
137  {
138  return new Solver_BiCGStab_L_Cmplx(fopr, params);
139  }
140 
141  public:
142  static bool register_factory()
143  {
144  bool init = true;
145  init &= Solver::Factory::Register("BiCGStab_L_Cmplx", create_object);
146  init &= Solver::Factory_params::Register("BiCGStab_L_Cmplx", create_object_with_params);
147  return init;
148  }
149 #endif
150 };
151 #endif
solver.h
Solver_BiCGStab_L_Cmplx::index_ij
int index_ij(const int i, const int j)
Definition: solver_BiCGStab_L_Cmplx.h:124
Solver_BiCGStab_L_Cmplx::m_u
std::vector< Field > m_u
Definition: solver_BiCGStab_L_Cmplx.h:66
bridgeIO.h
Solver_BiCGStab_L_Cmplx::class_name
static const std::string class_name
Definition: solver_BiCGStab_L_Cmplx.h:47
Solver_BiCGStab_L_Cmplx::solve
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Definition: solver_BiCGStab_L_Cmplx.cpp:218
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
AFopr< Field >
Solver_BiCGStab_L_Cmplx::m_r_init
Field m_r_init
Definition: solver_BiCGStab_L_Cmplx.h:67
Parameters
Class for parameters.
Definition: parameters.h:46
Solver_BiCGStab_L_Cmplx::m_v
Field m_v
Definition: solver_BiCGStab_L_Cmplx.h:67
Solver_BiCGStab_L_Cmplx::get_parameters
void get_parameters(Parameters &params) const
Definition: solver_BiCGStab_L_Cmplx.cpp:60
Solver_BiCGStab_L_Cmplx::m_s
Field m_s
Definition: solver_BiCGStab_L_Cmplx.h:67
Solver_BiCGStab_L_Cmplx::reset_field
void reset_field(const Field &)
Definition: solver_BiCGStab_L_Cmplx.cpp:306
Solver_BiCGStab_L_Cmplx::m_Niter
int m_Niter
Definition: solver_BiCGStab_L_Cmplx.h:54
Solver_BiCGStab_L_Cmplx::set_parameters
void set_parameters(const Parameters &params)
Definition: solver_BiCGStab_L_Cmplx.cpp:25
Solver_BiCGStab_L_Cmplx::m_fopr
Fopr * m_fopr
Definition: solver_BiCGStab_L_Cmplx.h:52
Solver_BiCGStab_L_Cmplx::m_alpha_prev
dcomplex m_alpha_prev
Definition: solver_BiCGStab_L_Cmplx.h:64
Solver_BiCGStab_L_Cmplx::set_parameters_BiCGStab_series
DEPRECATED void set_parameters_BiCGStab_series(const double Omega_tolerance)
Definition: solver_BiCGStab_L_Cmplx.cpp:134
Solver_BiCGStab_L_Cmplx::m_Nrestart_count
int m_Nrestart_count
Definition: solver_BiCGStab_L_Cmplx.h:69
Solver
Base class for linear solver class family.
Definition: solver.h:36
Solver_BiCGStab_L_Cmplx::m_use_init_guess
bool m_use_init_guess
Definition: solver_BiCGStab_L_Cmplx.h:56
Solver_BiCGStab_L_Cmplx
BiCGStab(L) algorithm.
Definition: solver_BiCGStab_L_Cmplx.h:44
Solver_BiCGStab_L_Cmplx::m_x
Field m_x
Definition: solver_BiCGStab_L_Cmplx.h:67
Solver_BiCGStab_L_Cmplx::m_N_L
int m_N_L
Definition: solver_BiCGStab_L_Cmplx.h:60
Solver_BiCGStab_L_Cmplx::solve_step
void solve_step(double &)
Definition: solver_BiCGStab_L_Cmplx.cpp:369
Solver_BiCGStab_L_Cmplx::m_Omega_tolerance
double m_Omega_tolerance
Definition: solver_BiCGStab_L_Cmplx.h:58
Solver_BiCGStab_L_Cmplx::Solver_BiCGStab_L_Cmplx
Solver_BiCGStab_L_Cmplx(Fopr *fopr)
Definition: solver_BiCGStab_L_Cmplx.h:73
Solver_BiCGStab_L_Cmplx::~Solver_BiCGStab_L_Cmplx
~Solver_BiCGStab_L_Cmplx()
Definition: solver_BiCGStab_L_Cmplx.h:96
Solver_BiCGStab_L_Cmplx::m_vl
Bridge::VerboseLevel m_vl
Definition: solver_BiCGStab_L_Cmplx.h:50
Solver_BiCGStab_L_Cmplx::solve_init
void solve_init(const Field &, double &)
Definition: solver_BiCGStab_L_Cmplx.cpp:339
Solver_BiCGStab_L_Cmplx::set_parameters_L
DEPRECATED void set_parameters_L(const int N_L)
Definition: solver_BiCGStab_L_Cmplx.cpp:150
Solver_BiCGStab_L_Cmplx::get_fopr
Fopr * get_fopr()
Definition: solver_BiCGStab_L_Cmplx.h:114
Solver_BiCGStab_L_Cmplx::m_Nrestart
int m_Nrestart
Definition: solver_BiCGStab_L_Cmplx.h:54
Solver_BiCGStab_L_Cmplx::m_Nconv_count
int m_Nconv_count
Definition: solver_BiCGStab_L_Cmplx.h:70
Solver_BiCGStab_L_Cmplx::m_Tol_L
double m_Tol_L
Definition: solver_BiCGStab_L_Cmplx.h:61
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Solver_BiCGStab_L_Cmplx::Solver_BiCGStab_L_Cmplx
Solver_BiCGStab_L_Cmplx(Fopr *fopr, const Parameters &params)
Definition: solver_BiCGStab_L_Cmplx.h:83
DEPRECATED
#define DEPRECATED
Definition: configure.h:28
Solver_BiCGStab_L_Cmplx::flop_count
double flop_count()
Definition: solver_BiCGStab_L_Cmplx.cpp:486
Solver_BiCGStab_L_Cmplx::m_r
std::vector< Field > m_r
Definition: solver_BiCGStab_L_Cmplx.h:66
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Solver_BiCGStab_L_Cmplx::m_rho_prev
dcomplex m_rho_prev
Definition: solver_BiCGStab_L_Cmplx.h:64
Solver_BiCGStab_L_Cmplx::m_Stop_cond
double m_Stop_cond
Definition: solver_BiCGStab_L_Cmplx.h:55