9 #include <util/keyval/keyval.h>
10 #include <chemistry/molecule/molecule.h>
12 class MPQCInFlexLexer;
24 const T &operator =(
const T&v) { set_ = 1; val_ = v;
return val_; }
25 void reset(
const T &val) { set_ = 0; val_ = val; }
26 int set()
const {
return set_; }
27 T val()
const {
return val_; }
38 Basis() : name(0), uc(0), split(0), puream(0) {}
39 Basis(
const char* n,
bool u,
bool s,
bool p) : name(0), uc(u), split(s), puream(p) {
40 if (n) name = strdup(n);
41 if (uc.val()) split =
false;
44 if (
other.name.set()) name = strdup(
other.name.val());
49 ~
Basis() {
if (name.val()) free(name.val()); }
51 void set_name(
char* c) { name = c; }
52 void set_uc(
bool b) { uc = b; }
53 void set_split(
bool b) { split = b; }
54 void set_puream(
bool b) { puream = b; }
55 void write(std::ostream &ostrs,
56 const char *keyword)
const;
59 return strcmp(name.val(),
other.name.val()) == 0 &&
60 uc.val() ==
other.uc.val() &&
61 split.val() ==
other.split.val() &&
62 puream.val() ==
other.puream.val();
65 return ! (*
this ==
other);
75 MPQCInFlexLexer *lexer_;
126 enum IntegralsFactoryType {
131 static std::string to_string(IntegralsFactoryType ifactory);
132 static Basis guess_basis(IntegralsFactoryType ifactory);
133 static bool psi_method(
const char*);
134 static bool r12_method(
const char*);
137 void infer_defaults();
139 void write_energy_object(std::ostream&,
const char *keyword,
141 Basis
const* basis,
int coor,
142 IntegralsFactoryType& ifactory);
143 void write_vector(std::ostream &ostrs,
144 const char *keyvalname,
149 static int checking_;
154 char *parse_string(
const char *s);
155 int check_string(
const char *s);
159 void error(
const char* s);
160 void error2(
const char* s,
const char* s2);
161 void yerror(
const char* s);
162 void yerror2(
const char* s,
const char *);
164 void begin_molecule();
166 void add_atom(
char *,
char *,
char *,
char *);
167 void set_charge(
char *);
168 void set_method(
char *);
169 void set_multiplicity(
char *);
170 void set_memory(
char *);
171 void set_tmpstore(
char *);
172 void set_tmpdir(
char *);
173 void set_accuracy(
char *);
174 void set_lindep(
char *);
175 void set_optimize(
int);
176 void set_opt_type(
int);
177 void set_opt_convergence(
char *);
178 void set_atom_charge(
char *);
179 void set_molecule_unit(
char *);
180 void set_symmetry(
char *);
181 void set_redund_coor(
int);
182 void set_gradient(
int);
183 void set_frequencies(
int);
184 void set_freq_accuracy(
char *);
185 void set_restart(
int);
186 void set_checkpoint(
int);
187 void set_precise_findif(
int);
188 void set_molecule_bohr(
int);
189 void set_debug(
char *);
190 void set_pccsd(
char *,
char *,
char *);
191 void set_docc(std::vector<int> *);
192 void set_socc(std::vector<int> *);
193 void set_alpha(std::vector<int> *);
194 void set_beta(std::vector<int> *);
195 void set_frozen_docc(std::vector<int> *);
196 void set_frozen_uocc(std::vector<int> *);
197 std::vector<int> *make_nnivec(std::vector<int> *,
char *);
199 void set_scf_maxiter(
char *);
201 void set_dftmethod_xc(
char *);
202 void set_dftmethod_grid(
char *);
203 void set_r12method_f12(
char *);
204 void set_r12method_app(
char *);
205 void set_r12method_ri(
char *);
206 void set_r12method_ansatz(
char *);
208 static int checking() {
return checking_; }