39 namespace Test_GradientFlow {
50 const std::string filename_input_RK1 =
"test_GradientFlow_Nf0_RK1.yaml";
51 const std::string filename_input_RK2 =
"test_GradientFlow_Nf0_RK2.yaml";
52 const std::string filename_input_RK3 =
"test_GradientFlow_Nf0_RK3.yaml";
53 const std::string filename_input_RK4 =
"test_GradientFlow_Nf0_RK4.yaml";
54 const std::string filename_input_RK_adaptive =
"test_GradientFlow_Nf0_RK_adaptive.yaml";
58 int update(
const std::string& filename_input);
61 {
return update(filename_input_RK1); }
64 {
return update(filename_input_RK2); }
67 {
return update(filename_input_RK3); }
70 {
return update(filename_input_RK4); }
73 {
return update(filename_input_RK_adaptive); }
75 #ifdef USE_TESTMANAGER_AUTOREGISTER
77 #if defined(USE_GROUP_SU2)
105 int update(
const std::string& filename_input)
118 const Parameters params_energy_density = params_all.
lookup(
"EnergyDensity");
120 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
121 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
122 const string readfile = params_test.
get_string(
"config_filename_input");
123 const string str_gconf_write = params_test.
get_string(
"gauge_config_type_output");
124 const string writefile = params_test.
get_string(
"config_filename_output");
125 const string str_rand_type = params_test.
get_string(
"random_number_type");
126 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
127 const int Nstep = params_test.
get_int(
"number_of_steps");
128 const double t_flow_max = params_test.
get_double(
"max_flow_time");
129 const string str_vlevel = params_test.
get_string(
"verbose_level");
131 const bool do_check = params_test.
is_set(
"expected_result");
132 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
134 const string str_action_G_type = params_action_G.
get_string(
"action_type");
139 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
140 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
141 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
142 vout.
general(vl,
" gconf_write = %s\n", str_gconf_write.c_str());
143 vout.
general(vl,
" writefile = %s\n", writefile.c_str());
144 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
147 vout.
general(vl,
" t_flow_max = %10.6f\n", t_flow_max);
148 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
167 if (str_gconf_status ==
"Continue") {
169 }
else if (str_gconf_status ==
"Cold_start") {
171 }
else if (str_gconf_status ==
"Hot_start") {
174 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
180 params_action_G.
set_double(
"beta", static_cast<double>(Nc));
198 for (
int i = 0; i < Nstep; ++i) {
199 result = g_flow->
evolve(t_flow, *U);
201 double t2 = t_flow * t_flow;
202 double E_plaq = energy_density->
E_plaq(*U);
203 double E_clover = energy_density->
E_clover(*U);
205 vout.
general(vl,
" (t, t^2 E_plaq, t^2 E_clover) = %.8f %.16f %.16f\n",
206 t_flow, t2 * E_plaq, t2 * E_clover);
209 if (t_flow > t_flow_max)
break;
220 if (filename_input ==
"test_GradientFlow_Nf0_RK_adaptive.yaml") {
226 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
void detailed(const char *format,...)
double E_plaq(const Field_G &U)
void general(const char *format,...)
const std::string test_name
double evolve(double &t, Field_G &U)
double E_clover(const Field_G &U)
int get_int(const string &key) const
const std::string test_name_RK1
const std::string test_name_RK_adaptive
virtual void set_parameters(const Parameters ¶m)=0
virtual void set_parameters(const Parameters ¶ms)
int update(const std::string &filename_input)
const std::string test_name_RK2
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
static bool initialize(const std::string &rng_type, unsigned long seed)
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
energy density measurement.
const std::string test_name_RK3
int non_NULL(const std::string v)
bool is_set(const string &key) const
void crucial(const char *format,...)
static void read(const std::string ¶ms_file, Parameters ¶ms)
GradientFlow construction.
int verify(const double result, const double expected, double eps)
void set_double(const string &key, const double value)
const std::string test_name_RK4
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
int run_test_RK_adaptive()
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
void set_parameters(const Parameters ¶ms)
static VerboseLevel set_verbose_level(const std::string &str)