make certain binlo/binhi are initialized

This commit is contained in:
Axel Kohlmeyer
2022-12-02 14:35:21 -05:00
parent 6fe8b84c23
commit 1eb489236e

View File

@ -43,7 +43,9 @@ static int compare_coords(const int, const int, void *);
/* ---------------------------------------------------------------------- */
ResetAtomsID::ResetAtomsID(LAMMPS *lmp) : Command(lmp) {}
ResetAtomsID::ResetAtomsID(LAMMPS *lmp) : Command(lmp) {
binlo = binhi = -1;
}
/* ---------------------------------------------------------------------- */
@ -480,6 +482,9 @@ int ResetAtomsID::sort_bins(int n, char *inbuf, int &flag, int *&proclist, char
bigint binlo = rptr->binlo;
bigint binhi = rptr->binhi;
if ((binlo < 0) || (binhi < 0))
error->one(FLERR, "Called sort_bins without previous setup of bins");
// nbins = my subset of bins from binlo to binhi-1
// initialize linked lists of my Rvous atoms in each bin