52 const std::string
test_name =
"HMC.Wilson.Nf2_TopologyFixing";
56 const std::string filename_input =
"test_HMC_Wilson_Nf2_TopologyFixing.yaml";
62 #ifdef USE_TESTMANAGER_AUTOREGISTER
64 #if defined(USE_GROUP_SU2)
83 const int NinG = 2 * Nc * Nc;
90 const Parameters params_fopr_prec = params_all.
lookup(
"Fopr_TopologyFixing");
96 const Parameters params_integrator = params_all.
lookup(
"Builder_Integrator");
99 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
100 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
101 const string readfile = params_test.
get_string(
"config_filename_input");
102 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
103 const string writefile = params_test.
get_string(
"config_filename_output");
104 const string str_rand_type = params_test.
get_string(
"random_number_type");
105 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
106 int i_conf = params_test.
get_int(
"trajectory_number");
107 const int Ntraj = params_test.
get_int(
"trajectory_number_step");
108 const int i_save_conf = params_test.
get_int(
"save_config_interval");
109 const string str_vlevel = params_test.
get_string(
"verbose_level");
111 const bool do_check = params_test.
is_set(
"expected_result");
112 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
114 const string str_action_G_type = params_action_G.
get_string(
"action_type");
115 const string str_fopr_type = params_fopr.
get_string(
"fermion_type");
116 const string str_fopr_prec_type = params_fopr_prec.
get_string(
"fermion_type");
118 const string str_gmset_type = params_fopr.
get_string(
"gamma_matrix_type");
119 const string str_proj_type = params_proj.
get_string(
"projection_type");
120 const string str_smear_type = params_smear.
get_string(
"smear_type");
122 const string str_solver_MD_type = params_solver_MD.
get_string(
"solver_type");
123 const string str_solver_H_type = params_solver_H.
get_string(
"solver_type");
124 const int Nlevels = params_integrator.
get_int(
"number_of_levels");
125 const std::vector<int> level_action = params_integrator.
get_int_vector(
"level_of_actions");
130 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
131 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
133 vout.
general(
vl,
" gconf_write = %s\n", str_gconf_write.c_str());
135 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
141 vout.
general(
vl,
" gmset_type = %s\n", str_gmset_type.c_str());
142 vout.
general(
vl,
" proj_type = %s\n", str_proj_type.c_str());
143 vout.
general(
vl,
" smear_type = %s\n", str_smear_type.c_str());
144 vout.
general(
vl,
" solver_MD_type = %s\n", str_solver_MD_type.c_str());
145 vout.
general(
vl,
" solver_H_type = %s\n", str_solver_H_type.c_str());
161 if (str_proj_type ==
"Stout_SU3") {
175 if (str_gconf_status ==
"Continue") {
177 }
else if (str_gconf_status ==
"Cold_start") {
179 }
else if (str_gconf_status ==
"Hot_start") {
182 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
189 unique_ptr<Action> action_G(Action::New(str_action_G_type, params_action_G));
191 unique_ptr<Projection> proj(Projection::New(str_proj_type, params_proj));
192 unique_ptr<Smear> smear(Smear::New(str_smear_type, proj.get(), params_smear));
194 unique_ptr<ForceSmear> force_smear(ForceSmear::New(str_smear_type, proj.get(), params_smear));
196 unique_ptr<Director_Smear> dr_smear(
new Director_Smear(smear.get(), params_dr_smear));
199 unique_ptr<Fopr> fopr(Fopr::New(str_fopr_type, params_fopr));
203 unique_ptr<Fopr> fopr_smear(Fopr::New(
"Smeared", fopr.get(), dr_smear.get()));
204 unique_ptr<Force> force_fopr_smear(
new Force_F_Smeared(force_fopr.get(), force_smear.get(), dr_smear.get()));
207 unique_ptr<Solver> solver_MD(Solver::New(str_solver_MD_type, fopr_smear.get(), params_solver_MD));
210 unique_ptr<Solver> solver_H(Solver::New(str_solver_H_type, fopr_smear.get(), params_solver_H));
215 unique_ptr<Fopr> fopr_prec(Fopr::New(str_fopr_prec_type, params_fopr_prec));
219 unique_ptr<Fopr> fopr_smear_prec(Fopr::New(
"Smeared", fopr_prec.get(), dr_smear.get()));
220 unique_ptr<Force> force_fopr_smear_prec(
new Force_F_Smeared(force_fopr_prec.get(), force_smear.get(), dr_smear.get()));
223 unique_ptr<Solver> solver_H_prec(Solver::New(str_solver_H_type, fopr_smear_prec.get(), params_solver_H));
227 unique_ptr<Action> action_F(
new Action_F_Ratio_lex(fopr_smear_prec.get(), force_fopr_smear_prec.get(), fopr_smear.get(), force_fopr_smear.get(), fprop_H_prec.get(), fprop_MD.get(), fprop_H.get()));
230 actions.
append(level_action[0], action_F.get());
231 actions.
append(level_action[1], action_G.get());
233 std::vector<Director *> directors(1);
234 directors[0] =
static_cast<Director *
>(dr_smear.get());
236 unique_ptr<Builder_Integrator> builder(
new Builder_Integrator(actions, directors, params_integrator));
241 HMC_General hmc(actions, directors, integrator, rand.get(), params_hmc);
252 for (
int traj = 0; traj < Ntraj; ++traj) {
258 if ((i_conf + traj + 1) % i_save_conf == 0) {