28 namespace Test_Gauge {
29 const std::string
test_name =
"Gauge.EnergyDensity";
33 const std::string filename_input =
"test_Gauge_EnergyDensity.yaml";
39 #ifdef USE_TESTMANAGER_AUTOREGISTER
41 #if defined(USE_GROUP_SU2)
62 const Parameters params_test = params_all.
lookup(
"Test_Gauge_EnergyDensity");
65 const string str_gconf_status = params_test.
get_string(
"gauge_config_status");
66 const string str_gconf_read = params_test.
get_string(
"gauge_config_type_input");
67 const string readfile = params_test.
get_string(
"config_filename_input");
68 const string str_rand_type = params_test.
get_string(
"random_number_type");
69 const unsigned long seed = params_test.
get_unsigned_long(
"seed_for_random_number");
70 const string str_vlevel = params_test.
get_string(
"verbose_level");
72 const bool do_check = params_test.
is_set(
"expected_result");
73 const double expected_result = do_check ? params_test.
get_double(
"expected_result") : 0.0;
78 vout.
general(vl,
" gconf_status = %s\n", str_gconf_status.c_str());
79 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
80 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
81 vout.
general(vl,
" rand_type = %s\n", str_rand_type.c_str());
83 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
102 if (str_gconf_status ==
"Continue") {
104 }
else if (str_gconf_status ==
"Cold_start") {
106 }
else if (str_gconf_status ==
"Hot_start") {
109 vout.
crucial(vl,
"Error at %s: unsupported gconf status \"%s\"\n",
test_name.c_str(), str_gconf_status.c_str());
122 const double result = energy_density->
E_clover(*U);
132 vout.
detailed(vl,
"check skipped: expected_result not set.\n\n");
void detailed(const char *format,...)
void general(const char *format,...)
double E_clover(const Field_G &U)
virtual void set_parameters(const Parameters ¶ms)
Parameters lookup(const string &key) const
static bool RegisterTest(const std::string &key, const Test_function func)
const std::string test_name
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.
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)
int verify(const double result, const double expected, double eps)
GaugeConfig class for file I/O of gauge configuration.
string get_string(const string &key) const
void report(const Bridge::VerboseLevel vl=Bridge::GENERAL)
static VerboseLevel set_verbose_level(const std::string &str)