Skip to content

Commit

Permalink
Add new FDA option ‘ignore_missing_potentials’
Browse files Browse the repository at this point in the history
  • Loading branch information
BerndDoser committed Sep 10, 2019
1 parent 06cb638 commit 5a5ab96
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/gromacs/fda/FDASettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ FDASettings::FDASettings(int nfile, const t_filenm fnm[], gmx_mtop_t *mtop, bool
index_group2(-1),
groups(nullptr),
groupnames(nullptr),
normalize_psr(false)
normalize_psr(false),
ignore_missing_potentials(false)
{
/// Parallel execution not implemented yet
if (parallel_execution)
Expand Down Expand Up @@ -245,6 +246,10 @@ FDASettings::FDASettings(int nfile, const t_filenm fnm[], gmx_mtop_t *mtop, bool
// Normalize punctual stress per residue
normalize_psr = strcasecmp(get_estr(&ninp, &inp, "normalize_punctual_stress_per_residue", "no"), "no");
std::cout << "Normalize punctual stress per residue: " << normalize_psr << std::endl;

// Ignore missing potentials
ignore_missing_potentials = strcasecmp(get_estr(&ninp, &inp, "ignore_missing_potentials", "no"), "no");
std::cout << "Ignore missing potentials: " << ignore_missing_potentials << std::endl;
}

std::vector<int> FDASettings::groupatoms2residues(std::vector<int> const& group_atoms) const
Expand Down
5 changes: 5 additions & 0 deletions src/gromacs/fda/FDASettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ struct FDASettings
/// Normalize punctual stress per residue (default: off)
bool normalize_psr;

/// If true unsupported potentials will be ignored.
/// Be aware that the sum of distributed forces do not agree with the total forces.
/// If false the rerun will be stopped if a unsupported potential is used.
bool ignore_missing_potentials;

};

} // namespace fda
Expand Down
10 changes: 5 additions & 5 deletions src/gromacs/listed-forces/bonded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2414,7 +2414,7 @@ static real low_angres(int nbonds,
real st, sth, nrij2, nrkl2, c, cij, ckl;
ivec dt;

if (fda)
if (fda and !fda->get_settings().ignore_missing_potentials)
gmx_fatal(FARGS, "FDA is not supporting low_angres.");

t2 = 0; /* avoid warning with gcc-3.3. It is never used uninitialized */
Expand Down Expand Up @@ -2648,7 +2648,7 @@ real restrangles(int nbonds,
real prefactor, ratio_ante, ratio_post;
rvec delta_ante, delta_post, vec_temp;

if (fda)
if (fda and !fda->get_settings().ignore_missing_potentials)
gmx_fatal(FARGS, "FDA is not supporting restrangles.");

vtot = 0.0;
Expand Down Expand Up @@ -2760,7 +2760,7 @@ real restrdihs(int nbonds,
real prefactor_phi;


if (fda)
if (fda and !fda->get_settings().ignore_missing_potentials)
gmx_fatal(FARGS, "FDA is not supporting restrdihs.");

vtot = 0.0;
Expand Down Expand Up @@ -2870,7 +2870,7 @@ real cbtdihs(int nbonds,
rvec f_theta_post_aj, f_theta_post_ak, f_theta_post_al;


if (fda)
if (fda and !fda->get_settings().ignore_missing_potentials)
gmx_fatal(FARGS, "FDA is not supporting cbtdihs.");

vtot = 0.0;
Expand Down Expand Up @@ -3154,7 +3154,7 @@ cmap_dihs(int nbonds,
{3, 7, 11, 15}
};

if (fda)
if (fda and !fda->get_settings().ignore_missing_potentials)
gmx_fatal(FARGS, "FDA is not supporting cmap_dihs.");

/* Total CMAP energy */
Expand Down

0 comments on commit 5a5ab96

Please sign in to comment.