git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@937 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -93,21 +93,13 @@ void Verlet::init()
|
||||
|
||||
// set flags for what arrays to clear in force_clear()
|
||||
// need to clear torques if array exists
|
||||
// don't need to clear f_pair if atom_style is only granular (no virial)
|
||||
|
||||
torqueflag = 0;
|
||||
if (atom->torque_flag) torqueflag = 1;
|
||||
pairflag = 1;
|
||||
if (strcmp(atom->atom_style,"granular") == 0) pairflag = 0;
|
||||
|
||||
// orthogonal vs triclinic simulation box
|
||||
|
||||
triclinic = domain->triclinic;
|
||||
|
||||
// local copies of Update quantities
|
||||
|
||||
maxpair = update->maxpair;
|
||||
f_pair = update->f_pair;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -139,6 +131,8 @@ void Verlet::setup()
|
||||
int vflag = virial_style;
|
||||
force_clear(vflag);
|
||||
|
||||
if (force->pair) force->pair->compute(eflag,vflag);
|
||||
|
||||
if (atom->molecular) {
|
||||
if (force->bond) force->bond->compute(eflag,vflag);
|
||||
if (force->angle) force->angle->compute(eflag,vflag);
|
||||
@ -146,8 +140,6 @@ void Verlet::setup()
|
||||
if (force->improper) force->improper->compute(eflag,vflag);
|
||||
}
|
||||
|
||||
if (force->pair) force->pair->compute(eflag,vflag);
|
||||
|
||||
if (force->kspace) {
|
||||
force->kspace->setup();
|
||||
force->kspace->compute(eflag,vflag);
|
||||
@ -233,6 +225,12 @@ void Verlet::iterate(int n)
|
||||
force_clear(vflag);
|
||||
|
||||
timer->stamp();
|
||||
|
||||
if (force->pair) {
|
||||
force->pair->compute(eflag,vflag);
|
||||
timer->stamp(TIME_PAIR);
|
||||
}
|
||||
|
||||
if (atom->molecular) {
|
||||
if (force->bond) force->bond->compute(eflag,vflag);
|
||||
if (force->angle) force->angle->compute(eflag,vflag);
|
||||
@ -241,11 +239,6 @@ void Verlet::iterate(int n)
|
||||
timer->stamp(TIME_BOND);
|
||||
}
|
||||
|
||||
if (force->pair) {
|
||||
force->pair->compute(eflag,vflag);
|
||||
timer->stamp(TIME_PAIR);
|
||||
}
|
||||
|
||||
if (force->kspace) {
|
||||
force->kspace->compute(eflag,vflag);
|
||||
timer->stamp(TIME_KSPACE);
|
||||
@ -305,23 +298,6 @@ void Verlet::force_clear(int vflag)
|
||||
torque[i][2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
// clear f_pair array if using it this timestep to compute virial
|
||||
|
||||
if (vflag == 2 && pairflag) {
|
||||
if (atom->nmax > maxpair) {
|
||||
maxpair = atom->nmax;
|
||||
memory->destroy_2d_double_array(f_pair);
|
||||
f_pair = memory->create_2d_double_array(maxpair,3,"verlet:f_pair");
|
||||
update->maxpair = maxpair;
|
||||
update->f_pair = f_pair;
|
||||
}
|
||||
for (i = 0; i < nall; i++) {
|
||||
f_pair[i][0] = 0.0;
|
||||
f_pair[i][1] = 0.0;
|
||||
f_pair[i][2] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user