git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4552 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -277,6 +277,14 @@ void Respa::init()
|
|||||||
|
|
||||||
ev_setup();
|
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[] = timestep for each level
|
||||||
|
|
||||||
step[nlevels-1] = update->dt;
|
step[nlevels-1] = update->dt;
|
||||||
@ -581,6 +589,8 @@ void Respa::recurse(int ilevel)
|
|||||||
|
|
||||||
void Respa::force_clear(int newtonflag)
|
void Respa::force_clear(int newtonflag)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
// clear global force array
|
// clear global force array
|
||||||
// nall includes ghosts only if newton flag is set
|
// nall includes ghosts only if newton flag is set
|
||||||
|
|
||||||
@ -589,11 +599,26 @@ void Respa::force_clear(int newtonflag)
|
|||||||
else nall = atom->nlocal;
|
else nall = atom->nlocal;
|
||||||
|
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
for (int i = 0; i < nall; i++) {
|
for (i = 0; i < nall; i++) {
|
||||||
f[i][0] = 0.0;
|
f[i][0] = 0.0;
|
||||||
f[i][1] = 0.0;
|
f[i][1] = 0.0;
|
||||||
f[i][2] = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -53,6 +53,8 @@ class Respa : public Integrate {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int triclinic; // 0 if domain is orthog, 1 if triclinic
|
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
|
int *newton; // newton flag at each level
|
||||||
class FixRespa *fix_respa; // Fix to store the force level array
|
class FixRespa *fix_respa; // Fix to store the force level array
|
||||||
|
|||||||
Reference in New Issue
Block a user