Added the boxinfo argument
This commit is contained in:
@ -483,24 +483,26 @@ bigint ReadDump::next(bigint ncurrent, bigint nlast, int nevery, int nskip)
|
|||||||
|
|
||||||
void ReadDump::header(int fieldinfo)
|
void ReadDump::header(int fieldinfo)
|
||||||
{
|
{
|
||||||
int triclinic_snap;
|
int boxinfo, triclinic_snap;
|
||||||
int fieldflag,xflag,yflag,zflag;
|
int fieldflag,xflag,yflag,zflag;
|
||||||
|
|
||||||
if (filereader) {
|
if (filereader) {
|
||||||
for (int i = 0; i < nreader; i++)
|
for (int i = 0; i < nreader; i++)
|
||||||
nsnapatoms[i] = readers[i]->read_header(box,triclinic_snap,fieldinfo,
|
nsnapatoms[i] = readers[i]->read_header(box,boxinfo,triclinic_snap,fieldinfo,
|
||||||
nfield,fieldtype,fieldlabel,
|
nfield,fieldtype,fieldlabel,
|
||||||
scaleflag,wrapflag,fieldflag,
|
scaleflag,wrapflag,fieldflag,
|
||||||
xflag,yflag,zflag);
|
xflag,yflag,zflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPI_Bcast(nsnapatoms,nreader,MPI_LMP_BIGINT,0,clustercomm);
|
MPI_Bcast(nsnapatoms,nreader,MPI_LMP_BIGINT,0,clustercomm);
|
||||||
|
MPI_Bcast(&boxinfo,1,MPI_INT,0,clustercomm);
|
||||||
MPI_Bcast(&triclinic_snap,1,MPI_INT,0,clustercomm);
|
MPI_Bcast(&triclinic_snap,1,MPI_INT,0,clustercomm);
|
||||||
MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,clustercomm);
|
MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,clustercomm);
|
||||||
|
|
||||||
// local copy of snapshot box parameters
|
// local copy of snapshot box parameters
|
||||||
// used in xfield,yfield,zfield when converting dump atom to absolute coords
|
// used in xfield,yfield,zfield when converting dump atom to absolute coords
|
||||||
|
|
||||||
|
if (boxinfo) {
|
||||||
xlo = box[0][0];
|
xlo = box[0][0];
|
||||||
xhi = box[0][1];
|
xhi = box[0][1];
|
||||||
ylo = box[1][0];
|
ylo = box[1][0];
|
||||||
@ -508,9 +510,7 @@ void ReadDump::header(int fieldinfo)
|
|||||||
zlo = box[2][0];
|
zlo = box[2][0];
|
||||||
zhi = box[2][1];
|
zhi = box[2][1];
|
||||||
|
|
||||||
// value of 1 indicates possible change in tilt factors
|
if (triclinic_snap) {
|
||||||
|
|
||||||
if (triclinic_snap == 1) {
|
|
||||||
xy = box[0][2];
|
xy = box[0][2];
|
||||||
xz = box[1][2];
|
xz = box[1][2];
|
||||||
yz = box[2][2];
|
yz = box[2][2];
|
||||||
@ -528,6 +528,7 @@ void ReadDump::header(int fieldinfo)
|
|||||||
xprd = xhi - xlo;
|
xprd = xhi - xlo;
|
||||||
yprd = yhi - ylo;
|
yprd = yhi - ylo;
|
||||||
zprd = zhi - zlo;
|
zprd = zhi - zlo;
|
||||||
|
}
|
||||||
|
|
||||||
// done if not checking fields
|
// done if not checking fields
|
||||||
|
|
||||||
@ -539,12 +540,12 @@ void ReadDump::header(int fieldinfo)
|
|||||||
MPI_Bcast(&zflag,1,MPI_INT,0,clustercomm);
|
MPI_Bcast(&zflag,1,MPI_INT,0,clustercomm);
|
||||||
|
|
||||||
// error check on current vs new box and fields
|
// error check on current vs new box and fields
|
||||||
// triclinic_snap < 0 means no box info in file
|
// boxinfo == 0 means no box info in file
|
||||||
|
|
||||||
if (triclinic_snap < 0 && boxflag > 0)
|
if (boxflag) {
|
||||||
|
if (!boxinfo)
|
||||||
error->all(FLERR,"No box information in dump, must use 'box no'");
|
error->all(FLERR,"No box information in dump, must use 'box no'");
|
||||||
if (triclinic_snap >= 0) {
|
else if ((triclinic_snap && !triclinic) ||
|
||||||
if ((triclinic_snap && !triclinic) ||
|
|
||||||
(!triclinic_snap && triclinic))
|
(!triclinic_snap && triclinic))
|
||||||
error->one(FLERR,"Read_dump triclinic status does not match simulation");
|
error->one(FLERR,"Read_dump triclinic status does not match simulation");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class Reader : protected Pointers {
|
|||||||
|
|
||||||
virtual int read_time(bigint &) = 0;
|
virtual int read_time(bigint &) = 0;
|
||||||
virtual void skip() = 0;
|
virtual void skip() = 0;
|
||||||
virtual bigint read_header(double [3][3], int &, int, int, int *, char **,
|
virtual bigint read_header(double [3][3], int &, int &, int, int, int *, char **,
|
||||||
int, int, int &, int &, int &, int &) = 0;
|
int, int, int &, int &, int &, int &) = 0;
|
||||||
virtual void read_atoms(int, int, double **) = 0;
|
virtual void read_atoms(int, int, double **) = 0;
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ void ReaderNative::skip()
|
|||||||
only called by proc 0
|
only called by proc 0
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
bigint ReaderNative::read_header(double box[3][3], int &triclinic,
|
bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic,
|
||||||
int fieldinfo, int nfield,
|
int fieldinfo, int nfield,
|
||||||
int *fieldtype, char **fieldlabel,
|
int *fieldtype, char **fieldlabel,
|
||||||
int scaleflag, int wrapflag, int &fieldflag,
|
int scaleflag, int wrapflag, int &fieldflag,
|
||||||
@ -113,6 +113,7 @@ bigint ReaderNative::read_header(double box[3][3], int &triclinic,
|
|||||||
read_lines(2);
|
read_lines(2);
|
||||||
sscanf(line,BIGINT_FORMAT,&natoms);
|
sscanf(line,BIGINT_FORMAT,&natoms);
|
||||||
|
|
||||||
|
boxinfo = 1;
|
||||||
triclinic = 0;
|
triclinic = 0;
|
||||||
box[0][2] = box[1][2] = box[2][2] = 0.0;
|
box[0][2] = box[1][2] = box[2][2] = 0.0;
|
||||||
read_lines(1);
|
read_lines(1);
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class ReaderNative : public Reader {
|
|||||||
|
|
||||||
int read_time(bigint &);
|
int read_time(bigint &);
|
||||||
void skip();
|
void skip();
|
||||||
bigint read_header(double [3][3], int &, int, int, int *, char **,
|
bigint read_header(double [3][3], int &, int &, int, int, int *, char **,
|
||||||
int, int, int &, int &, int &, int &);
|
int, int, int &, int &, int &, int &);
|
||||||
void read_atoms(int, int, double **);
|
void read_atoms(int, int, double **);
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ void ReaderXYZ::skip()
|
|||||||
only called by proc 0
|
only called by proc 0
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
bigint ReaderXYZ::read_header(double /*box*/[3][3], int &triclinic,
|
bigint ReaderXYZ::read_header(double /*box*/[3][3], int &boxinfo, int &/*triclinic*/,
|
||||||
int fieldinfo, int nfield,
|
int fieldinfo, int nfield,
|
||||||
int *fieldtype, char **/*fieldlabel*/,
|
int *fieldtype, char **/*fieldlabel*/,
|
||||||
int scaleflag, int wrapflag, int &fieldflag,
|
int scaleflag, int wrapflag, int &fieldflag,
|
||||||
@ -128,7 +128,7 @@ bigint ReaderXYZ::read_header(double /*box*/[3][3], int &triclinic,
|
|||||||
|
|
||||||
// signal that we have no box info at all
|
// signal that we have no box info at all
|
||||||
|
|
||||||
triclinic = -1;
|
boxinfo = 0;
|
||||||
|
|
||||||
// if no field info requested, just return
|
// if no field info requested, just return
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class ReaderXYZ : public Reader {
|
|||||||
|
|
||||||
int read_time(bigint &);
|
int read_time(bigint &);
|
||||||
void skip();
|
void skip();
|
||||||
bigint read_header(double [3][3], int &, int, int, int *, char **,
|
bigint read_header(double [3][3], int &, int &, int, int, int *, char **,
|
||||||
int, int, int &, int &, int &, int &);
|
int, int, int &, int &, int &, int &);
|
||||||
void read_atoms(int, int, double **);
|
void read_atoms(int, int, double **);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user