enable more correct natoms computation when atoms are lost

This commit is contained in:
Steven J. Plimpton
2018-08-07 15:05:07 -06:00
parent e88311235f
commit d27215b7e1
4 changed files with 15 additions and 2 deletions

View File

@ -754,6 +754,18 @@ void Group::read_restart(FILE *fp)
// computations on a group of atoms
// ----------------------------------------------------------------------
/* ----------------------------------------------------------------------
count atoms in group all
------------------------------------------------------------------------- */
bigint Group::count_all()
{
bigint nme = atom->nlocal;
bigint nall;
MPI_Allreduce(&nme,&nall,1,MPI_LMP_BIGINT,MPI_SUM,world);
return nall;
}
/* ----------------------------------------------------------------------
count atoms in group
------------------------------------------------------------------------- */