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

This commit is contained in:
sjplimp 2012-02-07 23:28:25 +00:00
parent ebebc70142
commit 6b4e526dbc
1 changed files with 21 additions and 9 deletions

View File

@ -755,7 +755,7 @@ int Atom::count_words(const char *line)
void Atom::data_atoms(int n, char *buf)
{
int m,imagedata,xptr,iptr;
double xdata[3],lamda[3],sublo[3],subhi[3];
double xdata[3],lamda[3];
double *coord;
char *next;
@ -774,6 +774,16 @@ void Atom::data_atoms(int n, char *buf)
// insures all data atoms will be owned even with round-off
int triclinic = domain->triclinic;
double epsilon[3];
if (triclinic) epsilon[0] = epsilon[1] = epsilon[2] = EPSILON;
else {
epsilon[0] = domain->prd[0] * EPSILON;
epsilon[1] = domain->prd[1] * EPSILON;
epsilon[2] = domain->prd[2] * EPSILON;
}
double sublo[3],subhi[3];
if (triclinic == 0) {
sublo[0] = domain->sublo[0]; subhi[0] = domain->subhi[0];
sublo[1] = domain->sublo[1]; subhi[1] = domain->subhi[1];
@ -785,16 +795,16 @@ void Atom::data_atoms(int n, char *buf)
}
if (domain->xperiodic) {
if (comm->myloc[0] == 0) sublo[0] -= EPSILON;
if (comm->myloc[0] == comm->procgrid[0]-1) subhi[0] += EPSILON;
if (comm->myloc[0] == 0) sublo[0] -= epsilon[0];
if (comm->myloc[0] == comm->procgrid[0]-1) subhi[0] += epsilon[0];
}
if (domain->yperiodic) {
if (comm->myloc[1] == 0) sublo[1] -= EPSILON;
if (comm->myloc[1] == comm->procgrid[1]-1) subhi[1] += EPSILON;
if (comm->myloc[1] == 0) sublo[1] -= epsilon[1];
if (comm->myloc[1] == comm->procgrid[1]-1) subhi[1] += epsilon[1];
}
if (domain->zperiodic) {
if (comm->myloc[2] == 0) sublo[2] -= EPSILON;
if (comm->myloc[2] == comm->procgrid[2]-1) subhi[2] += EPSILON;
if (comm->myloc[2] == 0) sublo[2] -= epsilon[2];
if (comm->myloc[2] == comm->procgrid[2]-1) subhi[2] += epsilon[2];
}
// xptr = which word in line starts xyz coords
@ -815,10 +825,12 @@ void Atom::data_atoms(int n, char *buf)
next = strchr(buf,'\n');
values[0] = strtok(buf," \t\n\r\f");
if (values[0] == NULL) error->all(FLERR,"Incorrect atom format in data file");
if (values[0] == NULL)
error->all(FLERR,"Incorrect atom format in data file");
for (m = 1; m < nwords; m++) {
values[m] = strtok(NULL," \t\n\r\f");
if (values[m] == NULL) error->all(FLERR,"Incorrect atom format in data file");
if (values[m] == NULL)
error->all(FLERR,"Incorrect atom format in data file");
}
if (imageflag)