Commit 98d9a9a4 authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Added call to PLUMED with setStopFlag so that PLUMED can stop LAMMPS if it...

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
parent daa53e30
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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.