use ev_init for fixes

This commit is contained in:
Sebastian Hütter
2019-03-13 17:50:10 +01:00
parent 06a57dd659
commit 17c81295c2
4 changed files with 7 additions and 6 deletions

View File

@ -239,8 +239,7 @@ void FixLatte::pre_reverse(int eflag, int /*vflag*/)
void FixLatte::post_force(int vflag)
{
int eflag = eflag_caller;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
ev_init(eflag,vflag);
// compute Coulombic potential = pe[i]/q[i]
// invoke compute pe/atom

View File

@ -341,8 +341,7 @@ void FixCMAP::post_force(int vflag)
ecmap = 0.0;
int eflag = eflag_caller;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = 0;
ev_init(eflag,vflag);
for (n = 0; n < ncrosstermlist; n++) {
i1 = crosstermlist[n][0];

View File

@ -224,6 +224,10 @@ class Fix : protected Pointers {
int dynamic; // recount atoms for temperature computes
void ev_setup(int, int);
void ev_init(int eflag, int vflag) {
if (eflag||vflag) ev_setup(eflag, vflag);
else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0;
}
void ev_tally(int, int *, double, double, double *);
void v_setup(int);
void v_tally(int, int *, double, double *);

View File

@ -141,8 +141,7 @@ void FixExternal::post_force(int vflag)
bigint ntimestep = update->ntimestep;
int eflag = eflag_caller;
if (eflag || vflag) ev_setup(eflag,vflag);
else evflag = 0;
ev_init(eflag,vflag);
// invoke the callback in driver program
// it will fill fexternal with forces