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