36 const std::string
test_name =
"GradientFlow.EnergyMomentumTensor.Gauge";
37 const std::string
test_name_RK1 =
"GradientFlow.EnergyMomentumTensor.Gauge.RK1";
38 const std::string
test_name_RK2 =
"GradientFlow.EnergyMomentumTensor.Gauge.RK2";
39 const std::string
test_name_RK3 =
"GradientFlow.EnergyMomentumTensor.Gauge.RK3";
40 const std::string
test_name_RK4 =
"GradientFlow.EnergyMomentumTensor.Gauge.RK4";
44 const std::string
test_name =
"Test_EnergyMomentumTensor_Gauge";
45 const std::string
test_name_RK1 =
"Test_EnergyMomentumTensor_Gauge.RK1";
46 const std::string
test_name_RK2 =
"Test_EnergyMomentumTensor_Gauge.RK2";
47 const std::string
test_name_RK3 =
"Test_EnergyMomentumTensor_Gauge.RK3";
48 const std::string
test_name_RK4 =
"Test_EnergyMomentumTensor_Gauge.RK4";
54 const std::string filename_input_RK1 =
"test_GradientFlow_EnergyMomentumTensor_Gauge_RK1.yaml";
55 const std::string filename_input_RK2 =
"test_GradientFlow_EnergyMomentumTensor_Gauge_RK2.yaml";
56 const std::string filename_input_RK3 =
"test_GradientFlow_EnergyMomentumTensor_Gauge_RK3.yaml";
57 const std::string filename_input_RK4 =
"test_GradientFlow_EnergyMomentumTensor_Gauge_RK4.yaml";
58 const std::string filename_input_RK_adaptive =
"test_GradientFlow_EnergyMomentumTensor_Gauge_RK_adaptive.yaml";
63 int update(
const std::string& filename_input);
66 {
return update(filename_input_RK1); }
69 {
return update(filename_input_RK2); }
72 {
return update(filename_input_RK3); }
75 {
return update(filename_input_RK4); }
78 {
return update(filename_input_RK_adaptive); }
80 #ifdef USE_TESTMANAGER_AUTOREGISTER
82 #if defined(USE_GROUP_SU2)
111 int update(
const std::string& filename_input)
120 const Parameters params_test = params_all.
lookup(
"Test_EnergyMomentumTensor_Gauge");
124 const Parameters params_energy_momentum_tensor = params_all.
lookup(
"EnergyMomentumTensor");
125 const Parameters params_topological_charge = params_all.
lookup(
"TopologicalCharge");
127 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
128 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
129 const string readfile = params_test.
get_string(
"config_filename_input");
130 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
131 const string writefile = params_test.
get_string(
"config_filename_output");
132 const string str_rand_type = params_test.
get_string(
"random_number_type");
133 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
134 int i_conf = params_test.
get_int(
"trajectory_number");
135 const int Nstep = params_test.
get_int(
"number_of_steps");
136 const double t_flow_max = params_test.
get_double(
"max_flow_time");
137 const string str_vlevel = params_test.
get_string(
"verbose_level");
139 const bool do_check = params_test.
is_set(
"expected_result");
140 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
142 const string str_action_G_type = params_action_G.
get_string(
"action_type");
147 vout.
general(
vl,
" gconf_status = %s\n", str_gconf_status.c_str());
148 vout.
general(
vl,
" gconf_read = %s\n", str_gconf_read.c_str());
150 vout.
general(
vl,
" gconf_write = %s\n", str_gconf_write.c_str());
152 vout.
general(
vl,
" rand_type = %s\n", str_rand_type.c_str());
176 if (str_gconf_status ==
"Continue") {
178 }
else if (str_gconf_status ==
"Cold_start") {
180 }
else if (str_gconf_status ==
"Hot_start") {
182 }
else if (str_gconf_status ==
"Branch") {
184 }
else if (str_gconf_status ==
"Read") {
185 std::ostringstream num;
187 string readfile_i_conf = readfile + num.str();
189 vout.
general(
vl,
" conf_readfile = %s\n", readfile_i_conf.c_str());
190 }
else if (str_gconf_status ==
"Read_gauge_heavy") {
191 std::ostringstream num;
192 num <<
"conf" << std::setw(4) << std::setfill(
'0') << i_conf <<
".bin";
193 string readfile_i_conf = readfile + num.str();
195 vout.
general(
vl,
" conf_readfile = %s\n", readfile_i_conf.c_str());
196 }
else if (str_gconf_status ==
"Read_gauge_phys") {
197 std::ostringstream num;
198 num << std::setw(6) << std::setfill(
'0') << i_conf;
199 string readfile_i_conf = readfile + num.str();
201 vout.
general(
vl,
" conf_readfile = %s\n", readfile_i_conf.c_str());
203 vout.
crucial(
vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
208 params_action_G.
set_double(
"beta",
static_cast<double>(Nc));
210 unique_ptr<Action> action_G(Action::New(str_action_G_type, params_action_G));
212 unique_ptr<GradientFlow> g_flow(
new GradientFlow(action_G.get(), params_g_flow));
227 for (
int i = 0; i < Nstep; ++i) {
228 double result_g_flow = g_flow->evolve(t_flow, U);
232 result += energy_momentum_tensor.
measure_EMT(t_flow);
255 if (t_flow > t_flow_max)
break;