Skip to content
Snippets Groups Projects
Commit 18216de0 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

correctly check for fixes that maintain their own pressure compute

parent 3cb2291a
No related branches found
No related tags found
No related merge requests found
...@@ -229,16 +229,29 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : ...@@ -229,16 +229,29 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
delete [] newarg; delete [] newarg;
int ipress = modify->find_compute(id_press); int ipress = modify->find_compute(id_press);
c_press = modify->compute[ipress]; c_press = modify->compute[ipress];
// Check if nh type fixes have been called
// See comment in the setup method
for (int i = 0; i < modify->nfix; i++) { for (int i = 0; i < modify->nfix; i++) {
if ( strncmp(modify->fix[i]->style,"nph",3) || const char * const check_style = modify->fix[i]->style;
strncmp(modify->fix[i]->style,"nph_sphere",10) ||
strncmp(modify->fix[i]->style,"npt",3) || // There must be only one
strncmp(modify->fix[i]->style,"npt_sphere",10) )
error->all(FLERR,"Fix plumed must be called before fix_nh derived fixes, " if (strcmp(check_style,"plumed") == 0)
"for instance nph and npt fixes"); error->all(FLERR,"There must be only one instance of fix plumed");
// Avoid conflict with fixes that define internal pressure computes.
// See comment in the setup method
if ((strncmp(check_style,"nph",3) == 0) ||
(strncmp(check_style,"npt",3) == 0) ||
(strncmp(check_style,"rigid/nph",9) == 0) ||
(strncmp(check_style,"rigid/npt",9) == 0) ||
(strncmp(check_style,"msst",4) == 0) ||
(strncmp(check_style,"nphug",5) == 0) ||
(strncmp(check_style,"ipi",3) == 0) ||
(strncmp(check_style,"press/berendsen",15) == 0) ||
(strncmp(check_style,"qbmsst",6) == 0))
error->all(FLERR,"Fix plumed must be defined before any other fixes, "
"that compute pressure internally");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment