Skip to content

Commit 263dbdf

Browse files
committed
matched with qchem at Aug. 8 2022
1 parent e52ae11 commit 263dbdf

11 files changed

Lines changed: 2191 additions & 1107 deletions

File tree

efpmd/src/main.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static struct cfg *make_cfg(void)
152152
cfg_add_double(cfg, "thermostat_tau", 1.0e3);
153153
cfg_add_double(cfg, "barostat_tau", 1.0e4);
154154

155-
cfg_add_int(cfg, "ligand", 0);
155+
cfg_add_int(cfg, "ligand", -100);
156156
cfg_add_bool(cfg, "enable_pairwise", false);
157157
cfg_add_bool(cfg, "print_pbc", false);
158158
cfg_add_bool(cfg, "symmetry", false);
@@ -166,6 +166,8 @@ static struct cfg *make_cfg(void)
166166
cfg_add_int(cfg, "update_params", 0);
167167
cfg_add_double(cfg, "update_params_cutoff", 0.0);
168168

169+
cfg_add_int(cfg, "print", 0);
170+
169171
return cfg;
170172
}
171173

@@ -286,12 +288,13 @@ static struct efp *create_efp(const struct cfg *cfg, const struct sys *sys)
286288
.symmetry = cfg_get_bool(cfg, "symmetry"),
287289
.symm_frag = cfg_get_enum(cfg, "symm_frag"),
288290
.update_params = cfg_get_int(cfg, "update_params"),
289-
.update_params_cutoff = cfg_get_double(cfg, "update_params_cutoff")
291+
.update_params_cutoff = cfg_get_double(cfg, "update_params_cutoff"),
292+
.print = cfg_get_int(cfg, "print")
290293
};
291294

292295
if (opts.xr_cutoff == 0.0) {
293296
opts.xr_cutoff = opts.swf_cutoff;
294-
printf("xr_cutoff is set to %lf \n\n\n", opts.xr_cutoff*0.52917721092);
297+
printf("xr_cutoff is set to %lf \n\n", opts.xr_cutoff*0.52917721092);
295298
}
296299

297300
enum efp_coord_type coord_type = cfg_get_enum(cfg, "coord");
@@ -306,7 +309,7 @@ static struct efp *create_efp(const struct cfg *cfg, const struct sys *sys)
306309
add_potentials(efp, cfg, sys);
307310

308311
for (size_t i = 0; i < sys->n_frags; i++)
309-
check_fail(efp_add_fragment(efp, sys->frags[i].name));
312+
check_fail(efp_add_fragment(efp, sys->frags[i].name));
310313

311314
if (sys->n_charges > 0) {
312315
double q[sys->n_charges];
@@ -331,7 +334,10 @@ static struct efp *create_efp(const struct cfg *cfg, const struct sys *sys)
331334
if (cfg_get_bool(cfg, "enable_ff"))
332335
opts.terms &= ~(EFP_TERM_ELEC | EFP_TERM_POL | EFP_TERM_DISP | EFP_TERM_XR);
333336

334-
check_fail(efp_set_opts(efp, &opts));
337+
if (opts.enable_pairwise)
338+
check_fail(efp_add_ligand(efp, opts.ligand));
339+
340+
check_fail(efp_set_opts(efp, &opts));
335341
check_fail(efp_prepare(efp));
336342
check_fail(efp_set_symmlist(efp));
337343

efpmd/src/parse.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ struct sys *parse_input(struct cfg *cfg, const char *path)
253253
if (cfg_get_bool(cfg, "enable_pbc"))
254254
cfg_set_bool(cfg, "enable_cutoff", true);
255255

256+
// turn off pairwise calculations if ligand is not set
257+
if (cfg_get_int(cfg, "ligand") == -100 && cfg_get_bool(cfg, "enable_pairwise") == true)
258+
error("Specify ligand for pairwise calculations");
259+
256260
check_cfg(cfg);
257261
efp_stream_close(stream);
258262

0 commit comments

Comments
 (0)