Merge pull request #1234 from lammps/read-dump-keep
bug-fix for miscounting atoms for read_dump add keep
This commit is contained in:
@ -480,11 +480,16 @@ void ReadDump::atoms()
|
||||
nread += nchunk;
|
||||
}
|
||||
|
||||
// if addflag = YESADD or KEEPADD, update total atom count
|
||||
|
||||
if (addflag == YESADD || addflag == KEEPADD) {
|
||||
bigint nblocal = atom->nlocal;
|
||||
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
}
|
||||
|
||||
// if addflag = YESADD, assign IDs to new snapshot atoms
|
||||
|
||||
if (addflag == YESADD) {
|
||||
bigint nblocal = atom->nlocal;
|
||||
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
|
||||
if (atom->natoms < 0 || atom->natoms >= MAXBIGINT)
|
||||
error->all(FLERR,"Too many total atoms");
|
||||
if (atom->tag_enable) atom->tag_extend();
|
||||
|
||||
Reference in New Issue
Block a user