Bridge++
Ver. 2.0.2
solver_BiCGStab_Cmplx.h
Go to the documentation of this file.
1
14
#ifndef SOLVER_BICGSTAB_CMPLX_INCLUDED
15
#define SOLVER_BICGSTAB_CMPLX_INCLUDED
16
17
#include "
solver.h
"
18
19
#include "
IO/bridgeIO.h
"
20
using
Bridge::vout
;
21
23
42
class
Solver_BiCGStab_Cmplx
:
public
Solver
43
{
44
public
:
45
static
const
std::string
class_name
;
46
47
private
:
48
Bridge::VerboseLevel
m_vl
;
49
50
Fopr
*
m_fopr
;
51
52
int
m_Niter
,
m_Nrestart
;
53
double
m_Stop_cond
;
54
bool
m_use_init_guess
;
55
56
double
m_Omega_tolerance
;
57
58
//- working area
59
dcomplex
m_rho_prev
,
m_alpha_prev
,
m_omega_prev
;
60
Field
m_s
,
m_r
,
m_x
,
m_rh
,
m_p
,
m_v
,
m_t
;
61
62
int
m_Nrestart_count
;
63
int
m_Nconv_count
;
64
65
public
:
66
67
Solver_BiCGStab_Cmplx
(
Fopr
*fopr)
68
:
m_vl
(
CommonParameters
::Vlevel()),
69
m_fopr
(fopr)
70
{
71
m_use_init_guess
=
false
;
72
//- default value of m_Omega_tolerance = 0.7 for BiCGStab
73
m_Omega_tolerance
= 0.7;
74
m_Nrestart_count
= 0;
75
m_Nconv_count
= 0;
76
}
77
78
Solver_BiCGStab_Cmplx
(
Fopr
*fopr,
const
Parameters
& params)
79
:
m_vl
(
CommonParameters
::Vlevel()),
80
m_fopr
(fopr)
81
{
82
m_use_init_guess
=
false
;
83
//- default value of m_Omega_tolerance = 0.7 for BiCGStab
84
m_Omega_tolerance
= 0.7;
85
m_Nrestart_count
= 0;
86
m_Nconv_count
= 0;
87
88
set_parameters
(params);
89
}
90
91
~Solver_BiCGStab_Cmplx
() {}
92
93
void
set_parameters
(
const
Parameters
& params);
94
95
void
set_parameters
(
const
int
Niter,
const
int
Nrestart,
const
double
Stop_cond);
96
DEPRECATED
97
void
set_parameters
(
const
int
Niter,
const
int
Nrestart,
const
double
Stop_cond,
const
bool
use_init_guess);
98
DEPRECATED
99
void
set_parameters_BiCGStab_series
(
const
double
Omega_tolerance);
100
101
void
set_parameters
(
const
int
Niter,
const
int
Nrestart,
const
double
Stop_cond,
const
bool
use_init_guess,
const
double
Omega_tolerance);
102
103
void
get_parameters
(
Parameters
& params)
const
;
104
105
void
solve
(
Field
& solution,
const
Field
& source,
int
& Nconv,
double
& diff);
106
107
Fopr
*
get_fopr
() {
return
m_fopr
; }
108
109
double
flop_count
();
110
111
private
:
112
void
reset_field
(
const
Field
&);
113
114
void
solve_init
(
const
Field
&,
double
&);
115
void
solve_step
(
double
&);
116
117
#ifdef USE_FACTORY
118
private
:
119
static
Solver
*create_object(
Fopr
*fopr)
120
{
121
return
new
Solver_BiCGStab_Cmplx
(fopr);
122
}
123
124
static
Solver
*create_object_with_params(
Fopr
*fopr,
const
Parameters
& params)
125
{
126
return
new
Solver_BiCGStab_Cmplx
(fopr, params);
127
}
128
129
public
:
130
static
bool
register_factory()
131
{
132
bool
init =
true
;
133
init &= Solver::Factory::Register(
"BiCGStab_Cmplx"
, create_object);
134
init &= Solver::Factory_params::Register(
"BiCGStab_Cmplx"
, create_object_with_params);
135
return
init;
136
}
137
#endif
138
};
139
#endif
solver.h
Solver_BiCGStab_Cmplx::m_rho_prev
dcomplex m_rho_prev
Definition:
solver_BiCGStab_Cmplx.h:59
Solver_BiCGStab_Cmplx::class_name
static const std::string class_name
Definition:
solver_BiCGStab_Cmplx.h:45
bridgeIO.h
Solver_BiCGStab_Cmplx::reset_field
void reset_field(const Field &)
Definition:
solver_BiCGStab_Cmplx.cpp:277
CommonParameters
Common parameter class: provides parameters as singleton.
Definition:
commonParameters.h:42
AFopr< Field >
Solver_BiCGStab_Cmplx::m_Stop_cond
double m_Stop_cond
Definition:
solver_BiCGStab_Cmplx.h:53
Solver_BiCGStab_Cmplx::m_s
Field m_s
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx::m_r
Field m_r
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx::m_t
Field m_t
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx
BiCGStab algorithm with complex variables.
Definition:
solver_BiCGStab_Cmplx.h:42
Parameters
Class for parameters.
Definition:
parameters.h:46
Solver_BiCGStab_Cmplx::m_use_init_guess
bool m_use_init_guess
Definition:
solver_BiCGStab_Cmplx.h:54
Solver_BiCGStab_Cmplx::m_alpha_prev
dcomplex m_alpha_prev
Definition:
solver_BiCGStab_Cmplx.h:59
Solver_BiCGStab_Cmplx::m_rh
Field m_rh
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx::get_parameters
void get_parameters(Parameters ¶ms) const
Definition:
solver_BiCGStab_Cmplx.cpp:58
Solver_BiCGStab_Cmplx::set_parameters
void set_parameters(const Parameters ¶ms)
Definition:
solver_BiCGStab_Cmplx.cpp:25
Solver_BiCGStab_Cmplx::solve
void solve(Field &solution, const Field &source, int &Nconv, double &diff)
Definition:
solver_BiCGStab_Cmplx.cpp:189
Solver_BiCGStab_Cmplx::m_Nconv_count
int m_Nconv_count
Definition:
solver_BiCGStab_Cmplx.h:63
Solver_BiCGStab_Cmplx::Solver_BiCGStab_Cmplx
Solver_BiCGStab_Cmplx(Fopr *fopr, const Parameters ¶ms)
Definition:
solver_BiCGStab_Cmplx.h:78
Solver_BiCGStab_Cmplx::m_Nrestart
int m_Nrestart
Definition:
solver_BiCGStab_Cmplx.h:52
Solver_BiCGStab_Cmplx::solve_step
void solve_step(double &)
Definition:
solver_BiCGStab_Cmplx.cpp:330
Solver_BiCGStab_Cmplx::m_x
Field m_x
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx::solve_init
void solve_init(const Field &, double &)
Definition:
solver_BiCGStab_Cmplx.cpp:303
Solver_BiCGStab_Cmplx::m_p
Field m_p
Definition:
solver_BiCGStab_Cmplx.h:60
Solver
Base class for linear solver class family.
Definition:
solver.h:36
Solver_BiCGStab_Cmplx::set_parameters_BiCGStab_series
DEPRECATED void set_parameters_BiCGStab_series(const double Omega_tolerance)
Definition:
solver_BiCGStab_Cmplx.cpp:133
Solver_BiCGStab_Cmplx::m_omega_prev
dcomplex m_omega_prev
Definition:
solver_BiCGStab_Cmplx.h:59
Solver_BiCGStab_Cmplx::get_fopr
Fopr * get_fopr()
Definition:
solver_BiCGStab_Cmplx.h:107
Solver_BiCGStab_Cmplx::flop_count
double flop_count()
Definition:
solver_BiCGStab_Cmplx.cpp:382
Solver_BiCGStab_Cmplx::m_Niter
int m_Niter
Definition:
solver_BiCGStab_Cmplx.h:52
Solver_BiCGStab_Cmplx::m_Omega_tolerance
double m_Omega_tolerance
Definition:
solver_BiCGStab_Cmplx.h:56
Solver_BiCGStab_Cmplx::m_Nrestart_count
int m_Nrestart_count
Definition:
solver_BiCGStab_Cmplx.h:62
Field
Container of Field-type object.
Definition:
field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition:
bridgeIO.h:42
Solver_BiCGStab_Cmplx::m_vl
Bridge::VerboseLevel m_vl
Definition:
solver_BiCGStab_Cmplx.h:48
Solver_BiCGStab_Cmplx::m_fopr
Fopr * m_fopr
Definition:
solver_BiCGStab_Cmplx.h:50
DEPRECATED
#define DEPRECATED
Definition:
configure.h:28
Solver_BiCGStab_Cmplx::m_v
Field m_v
Definition:
solver_BiCGStab_Cmplx.h:60
Solver_BiCGStab_Cmplx::~Solver_BiCGStab_Cmplx
~Solver_BiCGStab_Cmplx()
Definition:
solver_BiCGStab_Cmplx.h:91
Bridge::vout
BridgeIO vout
Definition:
bridgeIO.cpp:512
Solver_BiCGStab_Cmplx::Solver_BiCGStab_Cmplx
Solver_BiCGStab_Cmplx(Fopr *fopr)
Definition:
solver_BiCGStab_Cmplx.h:67
src
lib
Solver
solver_BiCGStab_Cmplx.h
Generated on Sat Feb 10 2024 14:20:00 for Bridge++ by
1.8.17