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

This commit is contained in:
sjplimp
2013-11-20 17:21:27 +00:00
parent 5ec8a7c930
commit ec6c602730
17 changed files with 1273 additions and 1221 deletions

View File

@ -543,12 +543,12 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
if (ellipsoid[j] < 0) buf[m++] = 0;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -575,12 +575,12 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
if (ellipsoid[j] < 0) buf[m++] = 0;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -617,12 +617,12 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = x[j][0];
buf[m++] = x[j][1];
buf[m++] = x[j][2];
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
if (ellipsoid[j] < 0) buf[m++] = 0;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -656,12 +656,12 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
if (ellipsoid[j] < 0) buf[m++] = 0;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -688,12 +688,12 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
buf[m++] = tag[j];
buf[m++] = type[j];
buf[m++] = mask[j];
if (ellipsoid[j] < 0) buf[m++] = 0;
buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -737,9 +737,9 @@ int AtomVecEllipsoid::pack_border_hybrid(int n, int *list, double *buf)
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
if (ellipsoid[j] < 0) buf[m++] = 0;
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
shape = bonus[ellipsoid[j]].shape;
quat = bonus[ellipsoid[j]].quat;
buf[m++] = shape[0];
@ -768,10 +768,10 @@ void AtomVecEllipsoid::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = static_cast<int> (buf[m++]);
type[i] = static_cast<int> (buf[m++]);
mask[i] = static_cast<int> (buf[m++]);
ellipsoid[i] = static_cast<int> (buf[m++]);
tag[i] = (int) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
@ -811,10 +811,10 @@ void AtomVecEllipsoid::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
tag[i] = static_cast<int> (buf[m++]);
type[i] = static_cast<int> (buf[m++]);
mask[i] = static_cast<int> (buf[m++]);
ellipsoid[i] = static_cast<int> (buf[m++]);
tag[i] = (int) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
@ -856,7 +856,7 @@ int AtomVecEllipsoid::unpack_border_hybrid(int n, int first, double *buf)
m = 0;
last = first + n;
for (i = first; i < last; i++) {
ellipsoid[i] = static_cast<int> (buf[m++]);
ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else {
j = nlocal_bonus + nghost_bonus;
@ -892,19 +892,19 @@ int AtomVecEllipsoid::pack_exchange(int i, double *buf)
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = mask[i];
*((tagint *) &buf[m++]) = image[i];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = rmass[i];
buf[m++] = angmom[i][0];
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (ellipsoid[i] < 0) buf[m++] = 0;
if (ellipsoid[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
int j = ellipsoid[i];
double *shape = bonus[j].shape;
double *quat = bonus[j].quat;
@ -939,17 +939,17 @@ int AtomVecEllipsoid::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
tag[nlocal] = static_cast<int> (buf[m++]);
type[nlocal] = static_cast<int> (buf[m++]);
mask[nlocal] = static_cast<int> (buf[m++]);
image[nlocal] = *((tagint *) &buf[m++]);
tag[nlocal] = (int) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (tagint) ubuf(buf[m++]).i;
rmass[nlocal] = buf[m++];
angmom[nlocal][0] = buf[m++];
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
ellipsoid[nlocal] = static_cast<int> (buf[m++]);
ellipsoid[nlocal] = (int) ubuf(buf[m++]).i;
if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
@ -1010,10 +1010,10 @@ int AtomVecEllipsoid::pack_restart(int i, double *buf)
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = mask[i];
*((tagint *) &buf[m++]) = image[i];
buf[m++] = ubuf(tag[i]).d;
buf[m++] = ubuf(type[i]).d;
buf[m++] = ubuf(mask[i]).d;
buf[m++] = ubuf(image[i]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
@ -1023,9 +1023,9 @@ int AtomVecEllipsoid::pack_restart(int i, double *buf)
buf[m++] = angmom[i][1];
buf[m++] = angmom[i][2];
if (ellipsoid[i] < 0) buf[m++] = 0;
if (ellipsoid[i] < 0) buf[m++] = ubuf(0).d;
else {
buf[m++] = 1;
buf[m++] = ubuf(1).d;
int j = ellipsoid[i];
buf[m++] = bonus[j].shape[0];
buf[m++] = bonus[j].shape[1];
@ -1061,10 +1061,10 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
tag[nlocal] = static_cast<int> (buf[m++]);
type[nlocal] = static_cast<int> (buf[m++]);
mask[nlocal] = static_cast<int> (buf[m++]);
image[nlocal] = *((tagint *) &buf[m++]);
tag[nlocal] = (int) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (tagint) ubuf(buf[m++]).i;
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
@ -1074,7 +1074,7 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
angmom[nlocal][1] = buf[m++];
angmom[nlocal][2] = buf[m++];
ellipsoid[nlocal] = static_cast<int> (buf[m++]);
ellipsoid[nlocal] = (int) ubuf(buf[m++]).i;
if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1;
else {
if (nlocal_bonus == nmax_bonus) grow_bonus();
@ -1265,10 +1265,10 @@ void AtomVecEllipsoid::pack_data(double **buf)
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = tag[i];
buf[i][1] = type[i];
if (ellipsoid[i] < 0) buf[i][2] = 0;
else buf[i][2] = 1;
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = ubuf(type[i]).d;
if (ellipsoid[i] < 0) buf[i][2] = ubuf(0).d;
else buf[i][2] = ubuf(1).d;
if (ellipsoid[i] < 0) buf[i][3] = rmass[i];
else {
shape = bonus[ellipsoid[i]].shape;
@ -1277,9 +1277,9 @@ void AtomVecEllipsoid::pack_data(double **buf)
buf[i][4] = x[i][0];
buf[i][5] = x[i][1];
buf[i][6] = x[i][2];
buf[i][7] = (image[i] & IMGMASK) - IMGMAX;
buf[i][8] = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
buf[i][9] = (image[i] >> IMG2BITS) - IMGMAX;
buf[i][7] = ubuf((image[i] & IMGMASK) - IMGMAX).d;
buf[i][8] = ubuf((image[i] >> IMGBITS & IMGMASK) - IMGMAX).d;
buf[i][9] = ubuf((image[i] >> IMG2BITS) - IMGMAX).d;
}
}
@ -1289,8 +1289,8 @@ void AtomVecEllipsoid::pack_data(double **buf)
int AtomVecEllipsoid::pack_data_hybrid(int i, double *buf)
{
if (ellipsoid[i] < 0) buf[0] = 0;
else buf[0] = 1;
if (ellipsoid[i] < 0) buf[0] = ubuf(0).d;
else buf[0] = ubuf(1).d;
if (ellipsoid[i] < 0) buf[1] = rmass[i];
else {
double *shape = bonus[ellipsoid[i]].shape;
@ -1307,9 +1307,11 @@ void AtomVecEllipsoid::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
(int) buf[i][0],(int) buf[i][1],(int) buf[i][2],
(int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) buf[i][7],(int) buf[i][8],(int) buf[i][9]);
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
(int) ubuf(buf[i][9]).i);
}
/* ----------------------------------------------------------------------
@ -1318,7 +1320,7 @@ void AtomVecEllipsoid::write_data(FILE *fp, int n, double **buf)
int AtomVecEllipsoid::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," %d %-1.16e",(int) buf[0],buf[1]);
fprintf(fp," %d %-1.16e",(int) ubuf(buf[0]).i,buf[1]);
return 2;
}
@ -1330,7 +1332,7 @@ void AtomVecEllipsoid::pack_vel(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
buf[i][0] = tag[i];
buf[i][0] = ubuf(tag[i]).d;
buf[i][1] = v[i][0];
buf[i][2] = v[i][1];
buf[i][3] = v[i][2];
@ -1360,7 +1362,7 @@ void AtomVecEllipsoid::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
(int) buf[i][0],buf[i][1],buf[i][2],buf[i][3],
(int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}