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