code issues

This commit is contained in:
iafoss
2020-03-25 20:18:07 -04:00
parent c793db66d2
commit fa4ef70829
56 changed files with 1275 additions and 2252 deletions

View File

@ -109,10 +109,11 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
edpd_temp = edpd_flux = edpd_cv = NULL;
// USER-MESONT package
mesont_flag = 0;
length = NULL;
buckling = NULL;
bond_cnt = NULL;
bond_nt = NULL;
// USER-SMD
@ -377,9 +378,10 @@ Atom::~Atom()
memory->sfree(molecules);
// USER-MESONT package
memory->destroy(length);
memory->destroy(buckling);
memory->destroy(bond_cnt);
memory->destroy(bond_nt);
// delete per-type arrays
@ -984,23 +986,16 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
error->all(FLERR,"Incorrect atom format in data file");
}
int imx = 0;
int imy = 0;
int imz = 0;
if (imageflag) {
imx = utils::inumeric(FLERR,values[iptr],false,lmp);
imy = utils::inumeric(FLERR,values[iptr+1],false,lmp);
imz = utils::inumeric(FLERR,values[iptr+2],false,lmp);
if ((domain->dimension == 2) && (imz != 0))
error->all(FLERR,"Z-direction image flag must be 0 for 2d-systems");
}
imagedata = ((imageint) (imx + IMGMAX) & IMGMASK) |
(((imageint) (imy + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (imz + IMGMAX) & IMGMASK) << IMG2BITS);
if (imageflag)
imagedata = ((imageint) (atoi(values[iptr]) + IMGMAX) & IMGMASK) |
(((imageint) (atoi(values[iptr+1]) + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (atoi(values[iptr+2]) + IMGMAX) & IMGMASK) << IMG2BITS);
else imagedata = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
xdata[0] = utils::numeric(FLERR,values[xptr],false,lmp);
xdata[1] = utils::numeric(FLERR,values[xptr+1],false,lmp);
xdata[2] = utils::numeric(FLERR,values[xptr+2],false,lmp);
xdata[0] = atof(values[xptr]);
xdata[1] = atof(values[xptr+1]);
xdata[2] = atof(values[xptr+2]);
if (shiftflag) {
xdata[0] += shift[0];
xdata[1] += shift[1];
@ -2308,7 +2303,7 @@ void *Atom::extract(char *name)
// USER-MESONT package
if (strcmp(name,"length") == 0) return (void *) length;
if (strcmp(name,"buckling") == 0) return (void *) buckling;
if (strcmp(name,"bond_cnt") == 0) return (void *) bond_cnt;
if (strcmp(name,"bond_nt") == 0) return (void *) bond_nt;
return NULL;
}