git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2190 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -157,7 +157,7 @@ void FixNPTSphere::initial_integrate(int vflag)
|
|||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
|
|
||||||
// update angular momentum by 1/2 step
|
// update angular momentum by 1/2 step
|
||||||
// update quaternion a full step via Richardson iteration
|
// update quaternion a full step via Richardson iteration
|
||||||
@ -206,7 +206,7 @@ void FixNPTSphere::final_integrate()
|
|||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
|
|
||||||
if (which == NOBIAS) {
|
if (which == NOBIAS) {
|
||||||
for (i = 0; i < nlocal; i++) {
|
for (i = 0; i < nlocal; i++) {
|
||||||
|
|||||||
@ -131,7 +131,7 @@ void FixNVESphere::initial_integrate(int vflag)
|
|||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update v,x,omega for all particles
|
// update v,x,omega for all particles
|
||||||
@ -225,7 +225,7 @@ void FixNVESphere::final_integrate()
|
|||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mass) {
|
if (mass) {
|
||||||
|
|||||||
@ -102,7 +102,7 @@ void FixNVTSphere::initial_integrate(int vflag)
|
|||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
|
|
||||||
if (which == NOBIAS) {
|
if (which == NOBIAS) {
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
@ -173,7 +173,7 @@ void FixNVTSphere::final_integrate()
|
|||||||
int ntypes = atom->ntypes;
|
int ntypes = atom->ntypes;
|
||||||
double **shape = atom->shape;
|
double **shape = atom->shape;
|
||||||
for (int i = 1; i <= ntypes; i++)
|
for (int i = 1; i <= ntypes; i++)
|
||||||
dttype[i] = dtfrotate / (0.25*shape[i][0]*shape[i][0]*mass[i]);
|
dttype[i] = dtfrotate / (shape[i][0]*shape[i][0]*mass[i]);
|
||||||
|
|
||||||
if (which == NOBIAS) {
|
if (which == NOBIAS) {
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
|
|||||||
32
src/pair.cpp
32
src/pair.cpp
@ -699,10 +699,11 @@ void Pair::virial_compute()
|
|||||||
{
|
{
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
|
|
||||||
|
// sum over force on all particles including ghosts
|
||||||
|
|
||||||
|
if (neighbor->includegroup == 0) {
|
||||||
int nall = atom->nlocal + atom->nghost;
|
int nall = atom->nlocal + atom->nghost;
|
||||||
|
|
||||||
// sum over own & ghost atoms
|
|
||||||
|
|
||||||
for (int i = 0; i < nall; i++) {
|
for (int i = 0; i < nall; i++) {
|
||||||
virial[0] += f[i][0]*x[i][0];
|
virial[0] += f[i][0]*x[i][0];
|
||||||
virial[1] += f[i][1]*x[i][1];
|
virial[1] += f[i][1]*x[i][1];
|
||||||
@ -711,6 +712,31 @@ void Pair::virial_compute()
|
|||||||
virial[4] += f[i][2]*x[i][0];
|
virial[4] += f[i][2]*x[i][0];
|
||||||
virial[5] += f[i][2]*x[i][1];
|
virial[5] += f[i][2]*x[i][1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// neighbor includegroup flag is set
|
||||||
|
// sum over force on initial nfirst particles and ghosts
|
||||||
|
|
||||||
|
} else {
|
||||||
|
int nall = atom->nfirst;
|
||||||
|
for (int i = 0; i < nall; i++) {
|
||||||
|
virial[0] += f[i][0]*x[i][0];
|
||||||
|
virial[1] += f[i][1]*x[i][1];
|
||||||
|
virial[2] += f[i][2]*x[i][2];
|
||||||
|
virial[3] += f[i][1]*x[i][0];
|
||||||
|
virial[4] += f[i][2]*x[i][0];
|
||||||
|
virial[5] += f[i][2]*x[i][1];
|
||||||
|
}
|
||||||
|
|
||||||
|
nall = atom->nlocal + atom->nghost;
|
||||||
|
for (int i = atom->nlocal; i < nall; i++) {
|
||||||
|
virial[0] += f[i][0]*x[i][0];
|
||||||
|
virial[1] += f[i][1]*x[i][1];
|
||||||
|
virial[2] += f[i][2]*x[i][2];
|
||||||
|
virial[3] += f[i][1]*x[i][0];
|
||||||
|
virial[4] += f[i][2]*x[i][0];
|
||||||
|
virial[5] += f[i][2]*x[i][1];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user