Commit 80e0ddda authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

use min_post_force() method to hook fix halt into minimization

parent cc6f1be8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ int FixHalt::setmask()
  int mask = 0;
  mask |= END_OF_STEP;
  mask |= POST_RUN;
  mask |= MIN_POST_FORCE;
  return mask;
}

@@ -138,14 +139,17 @@ void FixHalt::init()
  // settings used by TLIMIT

  nextstep = (update->ntimestep/nevery)*nevery + nevery;
  thisstep = -1;
  tratio = 0.5;
}

/* ---------------------------------------------------------------------- */

void FixHalt::min_step(double, double *)
void FixHalt::min_post_force(int /* vflag */)
{
  if (update->ntimestep == thisstep) return;
  if ((update->ntimestep % nevery) == 0) end_of_step();
  thisstep = update->ntimestep;
}

/* ---------------------------------------------------------------------- */
+2 −2
Original line number Diff line number Diff line
@@ -32,12 +32,12 @@ class FixHalt : public Fix {
  int setmask();
  void init();
  void end_of_step();
  void min_step(double, double *);
  void min_post_force(int);
  void post_run();

 private:
  int attribute,operation,eflag,msgflag,ivar;
  bigint nextstep;
  bigint nextstep,thisstep;
  double value,tratio;
  char *idvar;