we must initialize the number of types with any "extra" values

so far, the "extra" value will only be applied if the "types" line is
present in the header. if not, the "extra" value is ignored. now will
first apply this and then lets it be overwritten in case a "types" line
is present in the header.
This commit is contained in:
Axel Kohlmeyer 2020-10-11 23:26:35 -04:00
parent a6df6cf84c
commit c01ff34785
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 11 additions and 0 deletions

View File

@ -917,6 +917,17 @@ void ReadData::header(int firstpass)
int n;
char *ptr;
// initialize type counts by the "extra" numbers so they get counted
// in case the corresponding "types" line is missing and thus the extra
// value will not be processed.
if (addflag == NONE) {
atom->ntypes = extra_atom_types;
atom->nbondtypes = extra_bond_types;
atom->nangletypes = extra_angle_types;
atom->ndihedraltypes = extra_dihedral_types;
atom->nimpropertypes = extra_improper_types;
}
// customize for new sections
const char *section_keywords[NSECTIONS] =