forked from lijiext/lammps
use min_post_force() method to hook fix halt into minimization
This commit is contained in:
parent
cc6f1be82d
commit
80e0dddae0
|
@ -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;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue