enable more correct natoms computation when atoms are lost
This commit is contained in:
@ -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");
|
||||
|
||||
@ -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
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1698,7 +1698,7 @@ void Thermo::compute_timeremain()
|
||||
|
||||
void Thermo::compute_atoms()
|
||||
{
|
||||
bivalue = atom->natoms;
|
||||
bivalue = group->count_all();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user