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

This commit is contained in:
sjplimp 2016-07-07 14:39:49 +00:00
parent 526f95e050
commit cdc9712261
1 changed files with 10 additions and 6 deletions

View File

@ -463,7 +463,8 @@ void Molecule::read(int flag)
// error checks
if (natoms < 1) error->all(FLERR,"No count or invalid atom count in molecule file");
if (natoms < 1)
error->all(FLERR,"No count or invalid atom count in molecule file");
if (nbonds < 0) error->all(FLERR,"Invalid bond count in molecule file");
if (nangles < 0) error->all(FLERR,"Invalid angle count in molecule file");
if (ndihedrals < 0)
@ -590,13 +591,16 @@ void Molecule::read(int flag)
error->all(FLERR,"Molecule file has no Body Doubles section");
}
// auto-generate special bonds
// auto-generate special bonds if needed and not in file
// set maxspecial on first pass, so allocate() has a size
if (bondflag && !specialflag) {
if (bondflag && specialflag == 0) {
maxspecial = atom->maxspecial;
if (flag) {
special_generate();
specialflag = 1;
nspecialflag = 1;
maxspecial = atom->maxspecial;
if (flag) special_generate();
}
}
// body particle must have natom = 1