15#include "ThermalFISTConfig.h"
32 string NumberToString(
int num) {
38 string OutputString(
const string &strin) {
42 while (ret.size() < 78)
54 cout << string(79,
'#') << endl;
56 cout <<
"#" << string(77,
' ') <<
"#" << endl;
60 tmpstr +=
"This is Thermal-FIST version ";
61 tmpstr += NumberToString(ThermalFIST_VERSION_MAJOR);
63 tmpstr += NumberToString(ThermalFIST_VERSION_MINOR);
65 if (ThermalFIST_VERSION_DEVEL != 0) {
67 tmpstr += NumberToString(ThermalFIST_VERSION_DEVEL);
70 tmpstr = OutputString(tmpstr);
72 cout << tmpstr << endl;
74 cout <<
"#" << string(77,
' ') <<
"#" << endl;
80 email += char(email[0] - 7);
82 email += char(
'a' + 2);
83 email += char(email[email.size() - 1] + 5);
87 char ch1 = email[email.size() - 2], ch2 = email[email.size() - 1];
88 email[email.size() - 1] = ch1;
89 email[email.size() - 2] = ch2;
97 tmpstr =
"Copyright (c) 2026 Volodymyr Vovchenko <" + email +
">";
99 tmpstr = OutputString(tmpstr);
101 cout << tmpstr << endl;
103 cout <<
"#" << string(77,
' ') <<
"#" << endl;
105 tmpstr =
"Distributed under the GNU General Public License 3.0 (GPLv3 or later)";
107 tmpstr = OutputString(tmpstr);
109 cout << tmpstr << endl;
111 cout <<
"#" << string(77,
' ') <<
"#" << endl;
113 tmpstr =
"Please cite when using this code:";
114 tmpstr = OutputString(tmpstr);
115 cout << tmpstr << endl;
117 tmpstr =
"V. Vovchenko, H. Stoecker, Comput. Phys. Commun. 244, 295 (2019)";
118 tmpstr = OutputString(tmpstr);
119 cout << tmpstr << endl;
125 cout <<
"#" << string(77,
' ') <<
"#" << endl;
128 tmpstr =
"The latest version is available at https://github.com/vlvovch/Thermal-FIST";
130 tmpstr = OutputString(tmpstr);
132 cout << tmpstr << endl;
134 cout <<
"#" << string(77,
' ') <<
"#" << endl;
136 cout << string(79,
'#') << endl;
148 if (str.size() > 0 && str[0] ==
'-') {
152 for (
size_t i = ist; i < str.size(); ++i) {
153 if (str[i] >=
'0' && str[i] <=
'9') {
155 ret +=
static_cast<long long>(str[i] -
'0');
162 std::map<std::string, std::string> ret =
params;
163 std::ifstream fin(filename);
165 if (!fin.is_open()) {
166 std::cout <<
"Cannot open parameters file!" <<
"\n";
171 std::cout <<
"Reading input parameters from file " << filename <<
"\n";
173 if (var.size() == 0 || var[0] ==
'#') {
174 fin.ignore((std::numeric_limits<std::streamsize>::max)(),
'\n');
178 std::cout <<
"Reading input parameter " << var <<
" = ";
181 std::cout << val << std::endl;
191 for(
int i = 1; i < argc - 1; i++) {
192 std::string arg = argv[i];
193 if (arg.size() <= 2 || arg[0] !=
'-' || arg[1] !=
'-') {
196 std::string var = arg.substr(2);
197 std::string val = argv[i + 1];
207 LARGE_INTEGER time,freq;
208 if (!QueryPerformanceFrequency(&freq)){
212 if (!QueryPerformanceCounter(&time)){
216 return (
double)time.QuadPart / freq.QuadPart;
221 if (GetProcessTimes(GetCurrentProcess(),&a,&b,&c,&d) != 0){
225 (
double)(d.dwLowDateTime |
226 ((
unsigned long long)d.dwHighDateTime << 32)) * 0.0000001;
237 if (gettimeofday(&time,NULL)){
241 return (
double)time.tv_sec + (double)time.tv_usec * .000001;
244 return (
double)clock() / CLOCKS_PER_SEC;
map< string, double > params
Contains some helper functions.
static bool PrintDisclaimer()
static bool DisclaimerPrinted
The main namespace where all classes and functions of the Thermal-FIST library reside.
long long stringToLongLong(const std::string &str)
std::map< std::string, std::string > ReadParametersFromFile(const std::string &filename, const std::map< std::string, std::string > ¶ms={})
void ParametersFromArgs(int argc, char *argv[], std::map< std::string, std::string > ¶ms)