Bridge++  Ver. 2.0.2
solver_BiCGStab_DS_L_Cmplx.cpp
Go to the documentation of this file.
1 
15 
16 #ifdef USE_FACTORY_AUTOREGISTER
17 namespace {
18  bool init = Solver_BiCGStab_DS_L_Cmplx::register_factory();
19 }
20 #endif
21 
22 const std::string Solver_BiCGStab_DS_L_Cmplx::class_name = "Solver_BiCGStab_DS_L_Cmplx";
23 
24 //====================================================================
26 {
27  std::string vlevel;
28  if (!params.fetch_string("verbose_level", vlevel)) {
29  m_vl = vout.set_verbose_level(vlevel);
30  }
31 
32  //- fetch and check input parameters
33  int Niter, Nrestart;
34  double Stop_cond;
35  bool use_init_guess;
36  int N_L;
37  double Omega_tolerance;
38  double Tol_L;
39 
40  int err = 0;
41  err += params.fetch_int("maximum_number_of_iteration", Niter);
42  err += params.fetch_int("maximum_number_of_restart", Nrestart);
43  err += params.fetch_double("convergence_criterion_squared", Stop_cond);
44  err += params.fetch_bool("use_initial_guess", use_init_guess);
45  err += params.fetch_double("Omega_tolerance", Omega_tolerance);
46  err += params.fetch_int("number_of_orthonormal_vectors", N_L);
47  err += params.fetch_double("tolerance_for_DynamicSelection_of_L", Tol_L);
48 
49  if (err) {
50  vout.crucial(m_vl, "Error at %s: input parameter not found.\n", class_name.c_str());
51  exit(EXIT_FAILURE);
52  }
53 
54 
55  // set_parameters(Niter, Nrestart, Stop_cond, use_init_guess);
56  // set_parameters_BiCGStab_series(Omega_tolerance);
57  // set_parameters_DS_L(N_L, Tol_L);
58  set_parameters(Niter, Nrestart, Stop_cond, use_init_guess, Omega_tolerance, N_L, Tol_L);
59 }
60 
61 
62 //====================================================================
64 {
65  params.set_int("maximum_number_of_iteration", m_Niter);
66  params.set_int("maximum_number_of_restart", m_Nrestart);
67  params.set_double("convergence_criterion_squared", m_Stop_cond);
68  params.set_bool("use_initial_guess", m_use_init_guess);
69  params.set_double("Omega_tolerance", m_Omega_tolerance);
70  params.set_int("number_of_orthonormal_vectors", m_N_L);
71  params.set_double("tolerance_for_DynamicSelection_of_L", m_Tol_L);
72 
73  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
74 }
75 
76 
77 //====================================================================
78 void Solver_BiCGStab_DS_L_Cmplx::set_parameters(const int Niter, const int Nrestart, const double Stop_cond)
79 {
81 
82  //- print input parameters
83  vout.general(m_vl, "%s: input parameters\n", class_name.c_str());
84  vout.general(m_vl, " Niter = %d\n", Niter);
85  vout.general(m_vl, " Nrestart = %d\n", Nrestart);
86  vout.general(m_vl, " Stop_cond = %8.2e\n", Stop_cond);
87 
88  //- range check
89  int err = 0;
90  err += ParameterCheck::non_negative(Niter);
91  err += ParameterCheck::non_negative(Nrestart);
92  err += ParameterCheck::square_non_zero(Stop_cond);
93 
94  if (err) {
95  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
96  exit(EXIT_FAILURE);
97  }
98 
99  //- store values
100  m_Niter = Niter;
101  m_Nrestart = Nrestart;
102  m_Stop_cond = Stop_cond;
103 }
104 
105 
106 //====================================================================
107 void Solver_BiCGStab_DS_L_Cmplx::set_parameters(const int Niter, const int Nrestart, const double Stop_cond, const bool use_init_guess)
108 {
110 
111  //- print input parameters
112  vout.general(m_vl, "%s: input parameters\n", class_name.c_str());
113  vout.general(m_vl, " Niter = %d\n", Niter);
114  vout.general(m_vl, " Nrestart = %d\n", Nrestart);
115  vout.general(m_vl, " Stop_cond = %8.2e\n", Stop_cond);
116  vout.general(m_vl, " use_init_guess = %s\n", use_init_guess ? "true" : "false");
117 
118  //- range check
119  int err = 0;
120  err += ParameterCheck::non_negative(Niter);
121  err += ParameterCheck::non_negative(Nrestart);
122  err += ParameterCheck::square_non_zero(Stop_cond);
123 
124  if (err) {
125  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
126  exit(EXIT_FAILURE);
127  }
128 
129  //- store values
130  m_Niter = Niter;
131  m_Nrestart = Nrestart;
132  m_Stop_cond = Stop_cond;
133  m_use_init_guess = use_init_guess;
134 }
135 
136 
137 //====================================================================
139 {
141 
142  //- print input parameters
143  vout.general(m_vl, " Omega_tolerance = %8.2e\n", Omega_tolerance);
144 
145  //- range check
146  // NB. Omega_tolerance == 0.0 is allowed.
147 
148  //- store values
149  m_Omega_tolerance = Omega_tolerance;
150 }
151 
152 
153 //====================================================================
154 void Solver_BiCGStab_DS_L_Cmplx::set_parameters_DS_L(const int N_L, const double Tol_L)
155 {
156  //- print input parameters
157  vout.general(m_vl, " N_L = %d\n", N_L);
158  vout.general(m_vl, " Tol_L = %16.8e\n", Tol_L);
159 
160  //- range check
161  int err = 0;
162  err += ParameterCheck::non_negative(N_L);
163  err += ParameterCheck::square_non_zero(Tol_L);
164 
165  if (err) {
166  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
167  exit(EXIT_FAILURE);
168  }
169 
170  //- store values
171  m_N_L = N_L;
172  m_Tol_L = Tol_L;
173 }
174 
175 
176 //====================================================================
178  const int Nrestart,
179  const double Stop_cond,
180  const bool use_init_guess,
181  const double Omega_tolerance,
182  const int N_L,
183  const double Tol_L)
184 {
186 
187  //- print input parameters
188  vout.general(m_vl, "%s: input parameters\n", class_name.c_str());
189  vout.general(m_vl, " Niter = %d\n", Niter);
190  vout.general(m_vl, " Nrestart = %d\n", Nrestart);
191  vout.general(m_vl, " Stop_cond = %8.2e\n", Stop_cond);
192  vout.general(m_vl, " use_init_guess = %s\n", use_init_guess ? "true" : "false");
193  vout.general(m_vl, " Omega_tolerance = %8.2e\n", Omega_tolerance);
194  vout.general(m_vl, " N_L = %d\n", N_L);
195  vout.general(m_vl, " Tol_L = %16.8e\n", Tol_L);
196 
197 
198  //- range check
199  int err = 0;
200  err += ParameterCheck::non_negative(Niter);
201  err += ParameterCheck::non_negative(Nrestart);
202  err += ParameterCheck::square_non_zero(Stop_cond);
203 
204  // NB. Omega_tolerance == 0.0 is allowed.
205 
206  err += ParameterCheck::non_negative(N_L);
207  err += ParameterCheck::square_non_zero(Tol_L);
208 
209  if (err) {
210  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n", class_name.c_str());
211  exit(EXIT_FAILURE);
212  }
213 
214  //- store values
215  m_Niter = Niter;
216  m_Nrestart = Nrestart;
217  m_Stop_cond = Stop_cond;
218  m_use_init_guess = use_init_guess;
219 
220  m_Omega_tolerance = Omega_tolerance;
221 
222  m_N_L = N_L;
223  m_Tol_L = Tol_L;
224 }
225 
226 
227 //====================================================================
229  int& Nconv, double& diff)
230 {
231  const double bnorm2 = b.norm2();
232  const int bsize = b.size();
233 
234  vout.paranoiac(m_vl, "%s: starts\n", class_name.c_str());
235  vout.paranoiac(m_vl, " norm of b = %16.8e\n", bnorm2);
236  vout.paranoiac(m_vl, " size of b = %d\n", bsize);
237 
238  bool is_converged = false;
239  int Nconv2 = 0;
240  double diff2 = 1.0; // superficial initialization
241  double rr;
242 
243  int Nconv_unit = 1;
244  // if (m_fopr->get_mode() == "DdagD" || m_fopr->get_mode() == "DDdag") {
245  // Nconv_unit = 2;
246  // }
247 
248  reset_field(b);
249 
250  if (m_use_init_guess) {
251  copy(m_s, xq); // s = xq;
252  } else {
253  copy(m_s, b); // s = b;
254  }
255  solve_init(b, rr);
256  Nconv2 += Nconv_unit;
257 
258  vout.detailed(m_vl, " iter: %8d %22.15e\n", Nconv2, rr / bnorm2);
259 
260 
261  for (int i_restart = 0; i_restart < m_Nrestart; i_restart++) {
262  for (int iter = 0; iter < m_Niter; iter++) {
263  if (rr / bnorm2 < m_Stop_cond) break;
264 
265  solve_step(rr);
266  Nconv2 += 2 * Nconv_unit * m_N_L_prev;
267 
268  vout.paranoiac(m_vl, " iter,N_L: %8d %8d\n", Nconv2, m_N_L_prev);
269  vout.detailed(m_vl, " iter: %8d %22.15e\n", Nconv2, rr / bnorm2);
270  }
271 
272  //- calculate true residual
273  m_fopr->mult(m_s, m_x); // s = m_fopr->mult(x);
274  axpy(m_s, -1.0, b); // s -= b;
275  diff2 = m_s.norm2();
276 
277  if (diff2 / bnorm2 < m_Stop_cond) {
278  vout.detailed(m_vl, "%s: converged.\n", class_name.c_str());
279  vout.detailed(m_vl, " iter(final): %8d %22.15e\n", Nconv2, diff2 / bnorm2);
280 
281  is_converged = true;
282 
283  m_Nrestart_count = i_restart;
284  m_Nconv_count = Nconv2;
285 
286  break;
287  } else {
288  //- restart with new approximate solution
289  copy(m_s, m_x); // s = x;
290  solve_init(b, rr);
291 
292  vout.detailed(m_vl, "%s: restarted.\n", class_name.c_str());
293  }
294  }
295 
296 
297  if (!is_converged) {
298  vout.crucial(m_vl, "Error at %s: not converged.\n", class_name.c_str());
299  vout.crucial(m_vl, " iter(final): %8d %22.15e\n", Nconv2, diff2 / bnorm2);
300  exit(EXIT_FAILURE);
301  }
302 
303 
304  copy(xq, m_x); // xq = x;
305 
306 #pragma omp barrier
307 #pragma omp master
308  {
309  diff = sqrt(diff2 / bnorm2);
310  Nconv = Nconv2;
311  }
312 #pragma omp barrier
313 }
314 
315 
316 //====================================================================
318 {
319 #pragma omp barrier
320 #pragma omp master
321  {
322  const int Nin = b.nin();
323  const int Nvol = b.nvol();
324  const int Nex = b.nex();
325 
326  if ((m_s.nin() != Nin) || (m_s.nvol() != Nvol) || (m_s.nex() != Nex)) {
327  m_s.reset(Nin, Nvol, Nex);
328  m_x.reset(Nin, Nvol, Nex);
329  m_r_init.reset(Nin, Nvol, Nex);
330  m_v.reset(Nin, Nvol, Nex);
331  }
332 
333  m_u.resize(m_N_L + 1);
334  m_r.resize(m_N_L + 1);
335 
336  for (int i = 0; i < m_N_L + 1; ++i) {
337  m_u[i].reset(Nin, Nvol, Nex);
338  m_r[i].reset(Nin, Nvol, Nex);
339  }
340  }
341 #pragma omp barrier
342 
343  vout.paranoiac(m_vl, "%s: field size reset.\n", class_name.c_str());
344 }
345 
346 
347 //====================================================================
349 {
350  copy(m_x, m_s); // x = s;
351 
352  for (int i = 0; i < m_N_L + 1; ++i) {
353  m_r[i].set(0.0); // r[i] = 0.0;
354  m_u[i].set(0.0); // u[i] = 0.0;
355  }
356 
357  // r[0] = b - A x_0
358  m_fopr->mult(m_v, m_s); // v = m_fopr->mult(s);
359  copy(m_r[0], b); // r[0] = b;
360  axpy(m_r[0], -1.0, m_v); // r[0] -= v;
361 
362  copy(m_r_init, m_r[0]); // r_init = r[0];
363  rr = m_r[0].norm2(); // rr = r[0] * r[0];
364 
365 #pragma omp barrier
366 #pragma omp master
367  {
368  m_rho_prev = cmplx(-1.0, 0.0);
369 
370  // NB. m_alpha_prev = 0.0 \neq 1.0
371  m_alpha_prev = cmplx(0.0, 0.0);
372 
373  m_N_L_prev = m_N_L;
374  }
375 #pragma omp barrier
376 }
377 
378 
379 //====================================================================
381 {
382  dcomplex rho_prev2 = m_rho_prev;
383  dcomplex alpha_prev2 = m_alpha_prev;
384 
385  int N_L_tmp = 0; // superficial initialization
386  dcomplex c_Rayleigh_prev = cmplx(0.0, 0.0);
387 
388  bool is_converged_L = false;
389 
390 
391  for (int j = 0; j < m_N_L_prev; ++j) {
392  if (!is_converged_L) {
393  dcomplex rho = dotc(m_r[j], m_r_init); // rho = r[j] * r_init;
394  rho = conj(rho);
395 
396  dcomplex beta = alpha_prev2 * (rho / rho_prev2);
397 
398  rho_prev2 = rho;
399 
400  for (int i = 0; i < j + 1; ++i) {
401  aypx(-beta, m_u[i], m_r[i]); // u[i] = - beta * u[i] + r[i];
402  }
403 
404  m_fopr->mult(m_u[j + 1], m_u[j]); // u[j+1] = m_fopr->mult(u[j]);
405 
406  dcomplex gamma = dotc(m_u[j + 1], m_r_init);
407  alpha_prev2 = rho_prev2 / conj(gamma);
408 
409  for (int i = 0; i < j + 1; ++i) {
410  axpy(m_r[i], -alpha_prev2, m_u[i + 1]); // r[i] -= alpha_prev2 * u[i+1];
411  }
412 
413  m_fopr->mult(m_r[j + 1], m_r[j]); // r[j+1] = m_fopr->mult(r[j]);
414 
415  axpy(m_x, alpha_prev2, m_u[0]); // x += alpha_prev2 * u[0];
416 
417 
418  //- calculate the Rayleigh quotient for N_L_tmp
419 
420  // dcomplex c_Rayleigh = (r[j] * r[j+1]) / (r[j] * r[j]);
421  double r_tmp = m_r[j].norm2(); // r_tmp = r[j] * r[j];
422  dcomplex c_Rayleigh = dotc(m_r[j], m_r[j + 1]) / r_tmp; // c_Rayleigh = r[j] * r[j+1] / r_tmp;
423 
424  dcomplex c_E = (c_Rayleigh - c_Rayleigh_prev) / c_Rayleigh;
425 
426  c_Rayleigh_prev = c_Rayleigh;
427 
428  N_L_tmp = j + 1;
429 
430  // vout.paranoiac(m_vl, "N_L_tmp,abs(c_E),m_Tol_L = %d %f %f\n",N_L_tmp,abs(c_E),m_Tol_L);
431 
432  if (abs(c_E) < m_Tol_L) {
433  // vout.paranoiac(m_vl, "N_L_tmp = %d\n",N_L_tmp);
434 
435  // break;
436  is_converged_L = true;
437  }
438  }
439  }
440 
441 
442  std::vector<double> sigma(m_N_L + 1);
443  std::vector<dcomplex> gamma_prime(m_N_L + 1);
444 
445  // NB. tau(m_N_L,m_N_L+1), not (m_N_L+1,m_N_L+1)
446  std::vector<dcomplex> tau(m_N_L * (m_N_L + 1));
447 
448  const double sigma_0 = m_r[0].norm2();
449 
450  for (int j = 1; j < N_L_tmp + 1; ++j) {
451  for (int i = 1; i < j; ++i) {
452  int ij = index_ij(i, j);
453 
454  dcomplex r_ji = dotc(m_r[j], m_r[i]);
455  tau[ij] = conj(r_ji) / sigma[i]; // tau[ij] = (r[j] * r[i]) / sigma[i];
456  axpy(m_r[j], -tau[ij], m_r[i]); // r[j] -= tau[ij] * r[i];
457  }
458 
459  sigma[j] = m_r[j].norm2(); // sigma[j] = r[j] * r[j];
460 
461  dcomplex r_0j = dotc(m_r[0], m_r[j]);
462  gamma_prime[j] = conj(r_0j) / sigma[j]; // gamma_prime[j] = (r[0] * r[j]) / sigma[j];
463 
464  //- a prescription to improve stability of BiCGStab(L)
465  double abs_rho = abs(r_0j) / sqrt(sigma[j] * sigma_0);
466  if (abs_rho < m_Omega_tolerance) {
467  gamma_prime[j] *= m_Omega_tolerance / abs_rho;
468  }
469  }
470 
471 
472  std::vector<dcomplex> gamma(m_N_L + 1);
473  gamma[N_L_tmp] = gamma_prime[N_L_tmp];
474 
475  for (int j = N_L_tmp - 1; j > 0; --j) {
476  dcomplex c_tmp = cmplx(0.0, 0.0);
477 
478  for (int i = j + 1; i < N_L_tmp + 1; ++i) {
479  int ji = index_ij(j, i);
480  c_tmp += tau[ji] * gamma[i];
481  }
482 
483  gamma[j] = gamma_prime[j] - c_tmp;
484  }
485 
486 
487  // NB. gamma_double_prime(m_N_L), not (m_N_L+1)
488  std::vector<dcomplex> gamma_double_prime(m_N_L);
489 
490  for (int j = 1; j < N_L_tmp; ++j) {
491  dcomplex c_tmp = cmplx(0.0, 0.0);
492 
493  for (int i = j + 1; i < N_L_tmp; ++i) {
494  int ji = index_ij(j, i);
495  c_tmp += tau[ji] * gamma[i + 1];
496  }
497 
498  gamma_double_prime[j] = gamma[j + 1] + c_tmp;
499  }
500 
501 
502  axpy(m_x, gamma[1], m_r[0]); // x += gamma[ 1] * r[ 0];
503  axpy(m_r[0], -gamma_prime[N_L_tmp], m_r[N_L_tmp]); // r[0] -= gamma_prime[N_L_tmp] * r[N_L_tmp];
504  axpy(m_u[0], -gamma[N_L_tmp], m_u[N_L_tmp]); // u[0] -= gamma[ N_L_tmp] * u[N_L_tmp];
505 
506  for (int j = 1; j < N_L_tmp; ++j) {
507  axpy(m_x, gamma_double_prime[j], m_r[j]); // x += gamma_double_prime[j] * r[j];
508  axpy(m_r[0], -gamma_prime[j], m_r[j]); // r[0] -= gamma_prime[ j] * r[j];
509  axpy(m_u[0], -gamma[j], m_u[j]); // u[0] -= gamma[ j] * u[j];
510  }
511 
512  rr = m_r[0].norm2(); // rr = r[0] * r[0];
513 
514 
515 #pragma omp barrier
516 #pragma omp master
517  {
518  m_rho_prev = rho_prev2;
519  m_alpha_prev = alpha_prev2;
520  m_N_L_prev = N_L_tmp;
521 
522  m_rho_prev *= -gamma_prime[N_L_tmp];
523  }
524 #pragma omp barrier
525 }
526 
527 
528 //====================================================================
530 {
531  const int NPE = CommonParameters::NPE();
532 
533  //- NB1 Nin = 2 * Nc * Nd, Nex = 1 for field_F
534  //- NB2 Nvol = CommonParameters::Nvol()/2 for eo
535  const int Nin = m_x.nin();
536  const int Nvol = m_x.nvol();
537  const int Nex = m_x.nex();
538 
539  const double gflop_fopr = m_fopr->flop_count();
540 
541  if (gflop_fopr < CommonParameters::epsilon_criterion()) {
542  vout.crucial(m_vl, "Warning at %s: no fopr->flop_count() is available, setting flop = 0\n", class_name.c_str());
543  return 0.0;
544  }
545 
546  const double gflop_axpy = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
547  const double gflop_dotc = (Nin * Nex * 4) * ((Nvol * NPE) / 1.0e+9);
548  const double gflop_norm = (Nin * Nex * 2) * ((Nvol * NPE) / 1.0e+9);
549 
550  const int N_L_prev_total = (m_Nconv_count - 1) / 2;
551 
552  const double gflop_init = gflop_fopr + gflop_axpy + gflop_norm;
553  const double gflop_step_BiCG_part = 2 * N_L_prev_total * gflop_fopr
554  + 3 * N_L_prev_total * gflop_dotc
555  + (N_L_prev_total + 2 * m_N_L_part_count) * gflop_axpy
556  + N_L_prev_total * gflop_norm;
557  const double gflop_step_L_part = (m_N_L_part_count + N_L_prev_total) * gflop_dotc
558  + (m_N_L_part_count + 3 * N_L_prev_total) * gflop_axpy
559  + (N_L_prev_total + m_Niter_count) * gflop_norm;
560  const double gflop_step = gflop_step_BiCG_part + gflop_step_L_part;
561  const double gflop_true_residual = gflop_fopr + gflop_axpy + gflop_norm;
562 
563  const double gflop = gflop_norm + gflop_init + gflop_step + gflop_true_residual * (m_Nrestart_count + 1)
564  + gflop_init * m_Nrestart_count;
565 
566 
567  return gflop;
568 }
569 
570 
571 //====================================================================
572 //============================================================END=====
Parameters::set_bool
void set_bool(const string &key, const bool value)
Definition: parameters.cpp:30
Solver_BiCGStab_DS_L_Cmplx::m_Omega_tolerance
double m_Omega_tolerance
Definition: solver_BiCGStab_DS_L_Cmplx.h:57
Solver_BiCGStab_DS_L_Cmplx::m_r
std::vector< Field > m_r
Definition: solver_BiCGStab_DS_L_Cmplx.h:66
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
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
AFopr::mult
virtual void mult(AFIELD &, const AFIELD &)
multiplies fermion operator to a given field.
Definition: afopr.h:95
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
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
solver_BiCGStab_DS_L_Cmplx.h
Bridge::BridgeIO::detailed
void detailed(const char *format,...)
Definition: bridgeIO.cpp:219
Field::nex
int nex() const
Definition: field.h:128
Solver_BiCGStab_DS_L_Cmplx::m_alpha_prev
dcomplex m_alpha_prev
Definition: solver_BiCGStab_DS_L_Cmplx.h:63
aypx
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Definition: field.cpp:509
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
axpy
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:380
ParameterCheck::non_negative
int non_negative(const int v)
Definition: parameterCheck.cpp:21
Field::nin
int nin() const
Definition: field.h:126
Parameters::fetch_bool
int fetch_bool(const string &key, bool &value) const
Definition: parameters.cpp:391
copy
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:212
Bridge::BridgeIO::paranoiac
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:238
Solver_BiCGStab_DS_L_Cmplx::m_Nconv_count
int m_Nconv_count
Definition: solver_BiCGStab_DS_L_Cmplx.h:71
Field::norm2
double norm2() const
Definition: field.cpp:113
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
Field::size
int size() const
Definition: field.h:132
AFopr::flop_count
virtual double flop_count()
returns the number of floating point operations.
Definition: afopr.h:160
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
ParameterCheck::square_non_zero
int square_non_zero(const double v)
Definition: parameterCheck.cpp:43
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::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
Field::nvol
int nvol() const
Definition: field.h:127
dotc
dcomplex dotc(const Field &y, const Field &x)
Definition: field.cpp:712
CommonParameters::NPE
static int NPE()
Definition: commonParameters.h:101
Field::reset
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
Definition: field.h:95
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
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
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
Parameters::set_int
void set_int(const string &key, const int value)
Definition: parameters.cpp:36
Solver_BiCGStab_DS_L_Cmplx::solve_init
void solve_init(const Field &, double &)
Definition: solver_BiCGStab_DS_L_Cmplx.cpp:348
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
Solver_BiCGStab_DS_L_Cmplx::solve_step
void solve_step(double &)
Definition: solver_BiCGStab_DS_L_Cmplx.cpp:380
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
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
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
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Solver_BiCGStab_DS_L_Cmplx::set_parameters
void set_parameters(const Parameters &params)
Definition: solver_BiCGStab_DS_L_Cmplx.cpp:25
ThreadManager::assert_single_thread
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
Definition: threadManager.cpp:372
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:154
Solver_BiCGStab_DS_L_Cmplx::reset_field
void reset_field(const Field &)
Definition: solver_BiCGStab_DS_L_Cmplx.cpp:317
CommonParameters::epsilon_criterion
static double epsilon_criterion()
Definition: commonParameters.h:119