5#ifndef MADNESS_APPS_DFPARAMS_H_INCLUDED
6#define MADNESS_APPS_DFPARAMS_H_INCLUDED
20 const auto first =
name.find_first_not_of(
" \t\n\r");
21 if (first == std::string::npos)
return "";
22 const auto last =
name.find_last_not_of(
" \t\n\r");
23 name =
name.substr(first, (last - first + 1));
27 bool all_digits =
true;
28 for (
size_t i =
name.size() - 5; i <
name.size(); ++i) {
29 if (!std::isdigit(
static_cast<unsigned char>(
name[i]))) {
39 if (!std::filesystem::exists(
name +
".00000") && std::filesystem::exists(
name +
".restartdata.00000")) {
40 name +=
".restartdata";
86 template<
typename Archive>
131 else if (s[0] ==
'#'){
133 std::getline(
f, dummy);
136 else if (s ==
"archive"){
140 else if (s ==
"job"){
143 else if (s ==
"max_iter"){
146 else if (s ==
"small"){
149 else if (s ==
"thresh"){
153 else if (s ==
"dconv"){
159 else if (s ==
"kain"){
162 else if (s ==
"maxsub"){
165 else if (s ==
"maxrotn"){
168 else if (s ==
"restart"){
171 else if (s ==
"nucleus"){
174 else if (s ==
"no_save"){
177 else if (s ==
"savefile"){
181 else if (s ==
"lb_iter"){
184 else if (s ==
"nwchem"){
187 else if (s ==
"lineplot"){
190 else if (s ==
"no_compute"){
193 else if (s ==
"bohr_rad"){
196 else if (s ==
"speed_of_light"){
199 else if (s ==
"min_iter"){
202 else if (s ==
"Krestricted"){
206 std::cout <<
"Dirac Fock: unrecognized input keyword " << s << std::endl;
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:13
static const char * filename
Definition legendre.cc:96
std::istream & position_stream(std::istream &f, const std::string &tag, bool rewind=true)
Definition position_stream.cc:48
std::string clean_archive_filename(std::string name)
Definition DFParameters.h:17
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:227
NDIM & f
Definition mra.h:2620
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
Definition DFParameters.h:45
bool no_compute
If true, will skip all computation.
Definition DFParameters.h:75
int k
Number of legendre polynomials in scaling basis.
Definition DFParameters.h:64
void read(std::istream &f)
Definition DFParameters.h:123
double maxrotn
maximum step allowed by kain
Definition DFParameters.h:67
double small
Minimum length scale to be resolved.
Definition DFParameters.h:61
bool kain
Turns on KAIN nonlinear solver.
Definition DFParameters.h:65
bool restart
Indicates this is a restarted DF job.
Definition DFParameters.h:68
int lb_iter
How many iterations to load balance (after the initial load balancing)
Definition DFParameters.h:72
int min_iter
minimum number of iterations (default: 2)
Definition DFParameters.h:78
double dconv
Accuracy criterion for charge density. Defaults to thresh.
Definition DFParameters.h:63
std::string archive
Name of input archive to read in ground state.
Definition DFParameters.h:52
int max_iter
Maximum number of iterations.
Definition DFParameters.h:60
double speed_of_light
speed_of_light in au (default: 137.03599917697017 CODATA2022)
Definition DFParameters.h:77
bool lineplot
Whether or not to make lineplots at the end of the job.
Definition DFParameters.h:74
bool Krestricted
Definition DFParameters.h:79
void serialize(Archive &ar)
Definition DFParameters.h:87
double thresh
Accuracy criterion when truncating.
Definition DFParameters.h:62
void print_params() const
Definition DFParameters.h:213
std::string savefile
Gives the file to save the archive each iteration Default: DFrestartdata (in working directory)
Definition DFParameters.h:71
double bohr_rad
bohr radius in fm (default: 52917.7210544 CODATA2022)
Definition DFParameters.h:76
int job
Definition DFParameters.h:53
void read_file(const std::string &filename)
Definition DFParameters.h:117
bool nwchem
Indicates archive given is actually an nwchem file for starting the job.
Definition DFParameters.h:73
int nucleus
Indicates which nucleus model to use (1 for fermi, anything else for Gaussian)
Definition DFParameters.h:69
DFParameters()
Definition DFParameters.h:92
bool do_save
Whether or not to save after each iteration. Defaults to true. Turn off with 'no_save'.
Definition DFParameters.h:70
int maxsub
Sets maximum subspace size for KAIN.
Definition DFParameters.h:66
void e()
Definition test_sig.cc:75