diff --git a/src/fix_group.cpp b/src/fix_group.cpp index 2447002bc5..68d74b8b1f 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -84,7 +84,7 @@ idregion(NULL), idvar(NULL), idprop(NULL) idprop = new char[n]; strcpy(idprop,arg[iarg+1]); iarg += 2; - } else if (strcmp(arg[iarg],"every") == 0) { + } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal group command"); nevery = force->inumeric(FLERR,arg[iarg+1]); if (nevery <= 0) error->all(FLERR,"Illegal group command"); diff --git a/src/group.cpp b/src/group.cpp index 9d33da9acb..dd5e53bb3c 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -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 ------------------------------------------------------------------------- */ diff --git a/src/group.h b/src/group.h index 6b6cbb1def..962d37b32a 100644 --- a/src/group.h +++ b/src/group.h @@ -37,6 +37,7 @@ class Group : protected Pointers { void write_restart(FILE *); void read_restart(FILE *); + bigint count_all(); // count atoms in group all bigint count(int); // count atoms in group bigint count(int,int); // count atoms in group & region double mass(int); // total mass of atoms in group diff --git a/src/thermo.cpp b/src/thermo.cpp index ade7a3c333..ddbbd0f496 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1698,7 +1698,7 @@ void Thermo::compute_timeremain() void Thermo::compute_atoms() { - bivalue = atom->natoms; + bivalue = group->count_all(); } /* ---------------------------------------------------------------------- */