Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ Grid_t
◆ PosType
◆ RealType
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 51 of file qmcfinitesize.cpp.
References APP_ABORT, OHMMS::Controller, Communicate::finalize(), Communicate::initialize(), QMCAppBase::parse(), and Random.
55 std::cout.setf(std::ios::scientific, std::ios::floatfield);
56 std::cout.setf(std::ios::right, std::ios::adjustfield);
57 std::cout.precision(12);
59 std::unique_ptr<SkParserBase> skparser(
nullptr);
61 bool show_usage =
false;
62 bool show_warn =
false;
71 std::cout <<
"Insufficient number of arguments.\n\n";
77 bool skf_found =
false;
78 while (iargc + 1 < argc)
80 std::string a(argv[iargc]);
81 std::string anxt(argv[iargc + 1]);
84 skparser = std::make_unique<SkParserASCII>();
90 else if (a ==
"--scalardat")
92 skparser = std::make_unique<SkParserScalarDat>();
98 else if (a ==
"--hdf5")
100 skparser = std::make_unique<SkParserHDF5>();
106 else if (a ==
"--skname")
112 std::cout <<
"Unrecognized flag '" << a <<
"'.\n\n";
121 std::cout <<
"Usage: qmcfinitesize [main.xml] --[skformat] [SK_FILE] --[optional_arg] [option]\n";
122 std::cout <<
" [main.xml]\n";
123 std::cout <<
" input file to qmcpack corresponding that calculated S(k) data. ";
124 std::cout <<
" [skformat]\n";
125 std::cout <<
" ascii: S(k) given in kx ky kz sk sk_err format. Header necessary.\n";
126 std::cout <<
" scalardat: File containing skall elements with energy.pl output format.\n";
127 std::cout <<
" hdf5: stat.h5 file containing skall data.\n";
128 std::cout <<
" [SK_FILE]\n";
129 std::cout <<
" filename containing the S(k) data\n";
130 std::cout <<
" [optional_args]\n";
131 std::cout <<
" --skname: in the stat.h5, the S(k) group name. Set to \"name\" defined in qmcpack input file " 132 "where SkAll estimator was specified\n";
133 std::cout <<
" [option]\n";
134 std::cout <<
" option corresonding to the optional_arg\n";
135 std::cout <<
"---------------------------\n";
136 std::cout <<
"Examples:\n";
137 std::cout <<
" qmcfinitesize qmc.in.xml --hdf5 qmc.g000.s000.stat.h5 --skname SkAll\n";
138 std::cout <<
" qmcfinitesize qmc.in.xml --ascii processed_sk.dat\n";
143 std::cout <<
"WARNING: multiple skformats were provided. All but the last will be ignored.\n\n";
146 skparser->setName(skname);
147 skparser->parse(skfile);
149 if (skparser == NULL)
151 APP_ABORT(
"qmcfinitesize: skparser failed to initialize");
155 qmcfs.
parse(std::string(argv[1]));
void initialize(int argc, char **argv)
bool parse(const std::string &infile)
parse an input file
Communicate * Controller
Global Communicator for a process.
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Class to handle FS corrections.