37 namespace Test_Solver_Wilson {
46 int solver(
const std::string&);
51 return solver(
"test_Solver_Wilson_BiCGStab_Cmplx.yaml");
57 return solver(
"test_Solver_Wilson_BiCGStab_DS_L_Cmplx.yaml");
63 return solver(
"test_Solver_Wilson_BiCGStab_IDS_L_Cmplx.yaml");
69 return solver(
"test_Solver_Wilson_BiCGStab_L_Cmplx.yaml");
75 return solver(
"test_Solver_Wilson_CGNE.yaml");
81 return solver(
"test_Solver_Wilson_CGNR.yaml");
87 return solver(
"test_Solver_Wilson_GMRES_m_Cmplx.yaml");
91 #ifdef USE_TESTMANAGER_AUTOREGISTER
93 #if defined(USE_GROUP_SU2)
97 "Solver.Wilson.BiCGStab_Cmplx",
102 "Solver.Wilson.BiCGStab_DS_L_Cmplx",
107 "Solver.Wilson.BiCGStab_IDS_L_Cmplx",
112 "Solver.Wilson.BiCGStab_L_Cmplx",
117 "Solver.Wilson.CGNE",
122 "Solver.Wilson.CGNR",
127 "Solver.Wilson.GMRES_m_Cmplx",
135 int solver(
const std::string& filename_input)
151 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
152 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
153 const string readfile = params_test.
get_string(
"config_filename_input");
154 const string str_rand_type = params_test.
get_string(
"random_number_type");
155 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
156 const string str_vlevel = params_test.
get_string(
"verbose_level");
158 const bool do_check = params_test.
is_set(
"expected_result");
159 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
161 const string str_gfix_type = params_gfix.
get_string(
"gauge_fixing_type");
162 const string str_fopr_type = params_fopr.
get_string(
"fermion_type");
163 const string str_gmset_type = params_fopr.
get_string(
"gamma_matrix_type");
164 const string str_solver_type = params_solver.
get_string(
"solver_type");
165 const string str_source_type = params_source.
get_string(
"source_type");
170 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
171 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
172 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
173 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
175 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
176 vout.
general(vl,
" gfix_type = %s\n", str_gfix_type.c_str());
177 vout.
general(vl,
" gmset_type = %s\n", str_gmset_type.c_str());
178 vout.
general(vl,
" solver_type = %s\n", str_solver_type.c_str());
179 vout.
general(vl,
" source_type = %s\n", str_source_type.c_str());
190 if (str_solver_type ==
"CG") {
191 vout.
crucial(vl,
"Error at %s: CG can not be adopted. Use CGNE,CGNR, instead.\n",
test_name.c_str());
201 if (str_gconf_status ==
"Continue") {
203 }
else if (str_gconf_status ==
"Cold_start") {
205 }
else if (str_gconf_status ==
"Hot_start") {
208 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
219 gfix->
fix(*Ufix, *U);
246 std::vector<Field_F> sq(Nc * Nd);
247 for (
int i_cd = 0; i_cd < Nc * Nd; ++i_cd) {
253 vout.
general(vl,
" color spin Nconv diff diff2\n");
260 int i_cd = icolor + Nc * ispin;
263 source->
set(b, i_cd);
267 fprop_lex->
invert_D(sq[i_cd], b, Nconv, diff);
271 fopr->
mult(y, sq[i_cd]);
276 icolor, ispin, Nconv, diff, diff2);
280 const double result = round(Nconv / 10.0);
290 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
int solver_BiCGStab_IDS_L_Cmplx()
const std::string test_name
void detailed(const char *format,...)
void general(const char *format,...)
virtual void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
int solver(const std::string &)
virtual void set_config(Field *)=0
setting pointer to the gauge configuration.
int solver_BiCGStab_L_Cmplx()
int solver_BiCGStab_DS_L_Cmplx()
void copy(Field &y, const Field &x)
copy(y, x): y = x
Wilson-type fermion field.
virtual void set_parameters(const Parameters ¶ms)=0
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
virtual void invert_D(Field &, const Field &, int &, double &)=0
static bool initialize(const std::string &rng_type, unsigned long seed)
int solver_GMRES_m_Cmplx()
void read(Field_G *U, const string &filename=string())
unsigned long get_unsigned_long(const string &key) const
double get_double(const string &key) const
int solver_BiCGStab_Cmplx()
virtual void set_parameters(const Parameters &)=0
int non_NULL(const std::string v)
bool is_set(const string &key) const
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Get quark propagator for Fopr with lexical site index.
void crucial(const char *format,...)
static void read(const std::string ¶ms_file, Parameters ¶ms)
int verify(const double result, const double expected, double eps)
virtual void mult(Field &, const Field &)=0
multiplies fermion operator to a given field (2nd argument)
GaugeConfig class for file I/O of gauge configuration.
virtual void fix(Field_G &Ufix, const Field_G &Uorg)=0
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
virtual void set_parameters(const Parameters &)=0
static VerboseLevel set_verbose_level(const std::string &str)
virtual void set(Field &, const int)=0
virtual void set_parameters(const Parameters ¶ms)=0