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

This commit is contained in:
sjplimp
2008-04-08 22:55:40 +00:00
parent cfe0d02a30
commit 30f801f5cb
18 changed files with 93 additions and 151 deletions

View File

@ -53,18 +53,14 @@ FixNPTSphere::~FixNPTSphere()
void FixNPTSphere::init()
{
FixNPT::init();
dtfrotate = dtf / INERTIA;
if (!atom->shape)
error->all("Fix npt/sphere requires atom attribute shape");
double *mass = atom->mass;
double **shape = atom->shape;
for (int i = 1; i <= atom->ntypes; i++) {
for (int i = 1; i <= atom->ntypes; i++)
if (shape[i][0] != shape[i][1] || shape[i][0] != shape[i][2])
error->all("Fix npt/sphere requires spherical particle shapes");
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
}
}
/* ----------------------------------------------------------------------
@ -155,6 +151,14 @@ void FixNPTSphere::initial_integrate(int vflag)
}
}
// recompute timesteps since dt may have changed or come via rRESPA
double dtfrotate = dtf / INERTIA;
int ntypes = atom->ntypes;
double **shape = atom->shape;
for (int i = 1; i <= ntypes; i++)
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
// update angular momentum by 1/2 step
// update quaternion a full step via Richardson iteration
// returns new normalized quaternion
@ -196,6 +200,14 @@ void FixNPTSphere::final_integrate()
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
// recompute timesteps since dt may have changed or come via rRESPA
double dtfrotate = dtf / INERTIA;
int ntypes = atom->ntypes;
double **shape = atom->shape;
for (int i = 1; i <= ntypes; i++)
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
if (which == NOBIAS) {
for (i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) {
@ -268,11 +280,3 @@ void FixNPTSphere::final_integrate()
omega_dot[i] *= drag_factor;
}
}
/* ---------------------------------------------------------------------- */
void FixNPTSphere::reset_dt()
{
FixNPT::reset_dt();
dtfrotate = dtf / INERTIA;
}