Added call to PLUMED with setStopFlag so that PLUMED can stop LAMMPS if it needs to. This would be needed if you were computing committors for example

This commit is contained in:
Gareth Tribello
2019-06-16 16:09:32 +01:00
parent daa53e3008
commit 98d9a9a4d2

View File

@ -406,6 +406,8 @@ void FixPlumed::post_force(int /* vflag */)
// pass all pointers to plumed:
p->cmd("setStep",&step);
int plumedStopCondition=0;
p->cmd("setStopFlag",&plumedStopCondition);
p->cmd("setPositions",&atom->x[0][0]);
p->cmd("setBox",&box[0][0]);
p->cmd("setForces",&atom->f[0][0]);
@ -478,6 +480,8 @@ void FixPlumed::post_force(int /* vflag */)
// do the real calculation:
p->cmd("performCalc");
if(plumedStopCondition) error->all(FLERR,"received instruction from PLUMED to stop");
// retransform virial to lammps representation and assign it to this
// fix's virial. If the energy is biased, Plumed is giving back the full
// virial and therefore we have to subtract the initial virial i.e. virial_lmp.