git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4552 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-08-20 21:03:54 +00:00
parent a8fdc4f569
commit ec22dce59b
2 changed files with 28 additions and 1 deletions

View File

@ -277,6 +277,14 @@ void Respa::init()
ev_setup();
// set flags for what arrays to clear in force_clear()
// need to clear torques,eforce if arrays exists
torqueflag = 0;
if (atom->torque_flag) torqueflag = 1;
eforceflag = 0;
if (atom->eforce_flag) eforceflag = 1;
// step[] = timestep for each level
step[nlevels-1] = update->dt;
@ -581,6 +589,8 @@ void Respa::recurse(int ilevel)
void Respa::force_clear(int newtonflag)
{
int i;
// clear global force array
// nall includes ghosts only if newton flag is set
@ -589,11 +599,26 @@ void Respa::force_clear(int newtonflag)
else nall = atom->nlocal;
double **f = atom->f;
for (int i = 0; i < nall; i++) {
for (i = 0; i < nall; i++) {
f[i][0] = 0.0;
f[i][1] = 0.0;
f[i][2] = 0.0;
}
if (torqueflag) {
double **torque = atom->torque;
for (i = 0; i < nall; i++) {
torque[i][0] = 0.0;
torque[i][1] = 0.0;
torque[i][2] = 0.0;
}
}
if (eforceflag) {
double *eforce = atom->eforce;
for (i = 0; i < nall; i++)
eforce[i] = 0.0;
}
}
/* ----------------------------------------------------------------------

View File

@ -53,6 +53,8 @@ class Respa : public Integrate {
private:
int triclinic; // 0 if domain is orthog, 1 if triclinic
int torqueflag; // zero out arrays every step
int eforceflag;
int *newton; // newton flag at each level
class FixRespa *fix_respa; // Fix to store the force level array