whitespace cleanup
This commit is contained in:
@ -99,9 +99,9 @@ int main(int narg, char **arg)
|
|||||||
// detect end-of-file
|
// detect end-of-file
|
||||||
|
|
||||||
if (feof(fp)) {
|
if (feof(fp)) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fclose(fptxt);
|
fclose(fptxt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fread(&natoms,sizeof(bigint),1,fp);
|
fread(&natoms,sizeof(bigint),1,fp);
|
||||||
@ -114,13 +114,13 @@ int main(int narg, char **arg)
|
|||||||
fread(&zlo,sizeof(double),1,fp);
|
fread(&zlo,sizeof(double),1,fp);
|
||||||
fread(&zhi,sizeof(double),1,fp);
|
fread(&zhi,sizeof(double),1,fp);
|
||||||
if (triclinic) {
|
if (triclinic) {
|
||||||
fread(&xy,sizeof(double),1,fp);
|
fread(&xy,sizeof(double),1,fp);
|
||||||
fread(&xz,sizeof(double),1,fp);
|
fread(&xz,sizeof(double),1,fp);
|
||||||
fread(&yz,sizeof(double),1,fp);
|
fread(&yz,sizeof(double),1,fp);
|
||||||
}
|
}
|
||||||
fread(&size_one,sizeof(int),1,fp);
|
fread(&size_one,sizeof(int),1,fp);
|
||||||
fread(&nchunk,sizeof(int),1,fp);
|
fread(&nchunk,sizeof(int),1,fp);
|
||||||
|
|
||||||
fprintf(fptxt,"ITEM: TIMESTEP\n");
|
fprintf(fptxt,"ITEM: TIMESTEP\n");
|
||||||
fprintf(fptxt,BIGINT_FORMAT "\n",ntimestep);
|
fprintf(fptxt,BIGINT_FORMAT "\n",ntimestep);
|
||||||
fprintf(fptxt,"ITEM: NUMBER OF ATOMS\n");
|
fprintf(fptxt,"ITEM: NUMBER OF ATOMS\n");
|
||||||
@ -128,26 +128,26 @@ int main(int narg, char **arg)
|
|||||||
|
|
||||||
m = 0;
|
m = 0;
|
||||||
for (int idim = 0; idim < 3; idim++) {
|
for (int idim = 0; idim < 3; idim++) {
|
||||||
for (int iside = 0; iside < 2; iside++) {
|
for (int iside = 0; iside < 2; iside++) {
|
||||||
if (boundary[idim][iside] == 0) boundstr[m++] = 'p';
|
if (boundary[idim][iside] == 0) boundstr[m++] = 'p';
|
||||||
else if (boundary[idim][iside] == 1) boundstr[m++] = 'f';
|
else if (boundary[idim][iside] == 1) boundstr[m++] = 'f';
|
||||||
else if (boundary[idim][iside] == 2) boundstr[m++] = 's';
|
else if (boundary[idim][iside] == 2) boundstr[m++] = 's';
|
||||||
else if (boundary[idim][iside] == 3) boundstr[m++] = 'm';
|
else if (boundary[idim][iside] == 3) boundstr[m++] = 'm';
|
||||||
}
|
}
|
||||||
boundstr[m++] = ' ';
|
boundstr[m++] = ' ';
|
||||||
}
|
}
|
||||||
boundstr[8] = '\0';
|
boundstr[8] = '\0';
|
||||||
|
|
||||||
if (!triclinic) {
|
if (!triclinic) {
|
||||||
fprintf(fptxt,"ITEM: BOX BOUNDS %s\n",boundstr);
|
fprintf(fptxt,"ITEM: BOX BOUNDS %s\n",boundstr);
|
||||||
fprintf(fptxt,"%g %g\n",xlo,xhi);
|
fprintf(fptxt,"%g %g\n",xlo,xhi);
|
||||||
fprintf(fptxt,"%g %g\n",ylo,yhi);
|
fprintf(fptxt,"%g %g\n",ylo,yhi);
|
||||||
fprintf(fptxt,"%g %g\n",zlo,zhi);
|
fprintf(fptxt,"%g %g\n",zlo,zhi);
|
||||||
} else {
|
} else {
|
||||||
fprintf(fptxt,"ITEM: BOX BOUNDS %s xy xz yz\n",boundstr);
|
fprintf(fptxt,"ITEM: BOX BOUNDS %s xy xz yz\n",boundstr);
|
||||||
fprintf(fptxt,"%g %g %g\n",xlo,xhi,xy);
|
fprintf(fptxt,"%g %g %g\n",xlo,xhi,xy);
|
||||||
fprintf(fptxt,"%g %g %g\n",ylo,yhi,xz);
|
fprintf(fptxt,"%g %g %g\n",ylo,yhi,xz);
|
||||||
fprintf(fptxt,"%g %g %g\n",zlo,zhi,yz);
|
fprintf(fptxt,"%g %g %g\n",zlo,zhi,yz);
|
||||||
}
|
}
|
||||||
fprintf(fptxt,"ITEM: ATOMS\n");
|
fprintf(fptxt,"ITEM: ATOMS\n");
|
||||||
|
|
||||||
@ -156,25 +156,25 @@ int main(int narg, char **arg)
|
|||||||
// loop over processor chunks in file
|
// loop over processor chunks in file
|
||||||
|
|
||||||
for (i = 0; i < nchunk; i++) {
|
for (i = 0; i < nchunk; i++) {
|
||||||
fread(&n,sizeof(int),1,fp);
|
fread(&n,sizeof(int),1,fp);
|
||||||
|
|
||||||
// extend buffer to fit chunk size
|
// extend buffer to fit chunk size
|
||||||
|
|
||||||
if (n > maxbuf) {
|
|
||||||
if (buf) delete [] buf;
|
|
||||||
buf = new double[n];
|
|
||||||
maxbuf = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
// read chunk and write as size_one values per line
|
if (n > maxbuf) {
|
||||||
|
if (buf) delete [] buf;
|
||||||
|
buf = new double[n];
|
||||||
|
maxbuf = n;
|
||||||
|
}
|
||||||
|
|
||||||
fread(buf,sizeof(double),n,fp);
|
// read chunk and write as size_one values per line
|
||||||
n /= size_one;
|
|
||||||
m = 0;
|
fread(buf,sizeof(double),n,fp);
|
||||||
for (j = 0; j < n; j++) {
|
n /= size_one;
|
||||||
for (k = 0; k < size_one; k++) fprintf(fptxt,"%g ",buf[m++]);
|
m = 0;
|
||||||
fprintf(fptxt,"\n");
|
for (j = 0; j < n; j++) {
|
||||||
}
|
for (k = 0; k < size_one; k++) fprintf(fptxt,"%g ",buf[m++]);
|
||||||
|
fprintf(fptxt,"\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" " BIGINT_FORMAT,ntimestep);
|
printf(" " BIGINT_FORMAT,ntimestep);
|
||||||
|
|||||||
Reference in New Issue
Block a user