support offsets for molecule IDs (if available) in read_data similar to atomIDs

suggested by felipe perez in https://sourceforge.net/p/lammps/mailman/message/36236631/
This commit is contained in:
Axel Kohlmeyer
2018-02-23 18:02:05 -05:00
parent 0003bb6766
commit bba4bd1489
5 changed files with 47 additions and 25 deletions

View File

@ -822,8 +822,8 @@ void Atom::deallocate_topology()
call style-specific routine to parse line
------------------------------------------------------------------------- */
void Atom::data_atoms(int n, char *buf, tagint id_offset, int type_offset,
int shiftflag, double *shift)
void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
int type_offset, int shiftflag, double *shift)
{
int m,xptr,iptr;
imageint imagedata;
@ -948,6 +948,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, int type_offset,
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
avec->data_atom(xdata,imagedata,values);
if (id_offset) tag[nlocal-1] += id_offset;
if (mol_offset) molecule[nlocal-1] += mol_offset;
if (type_offset) {
type[nlocal-1] += type_offset;
if (type[nlocal-1] > ntypes)