From 1eb489236e6c6d232046b146a8148f461675db11 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 2 Dec 2022 14:35:21 -0500 Subject: [PATCH] make certain binlo/binhi are initialized --- src/reset_atoms_id.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/reset_atoms_id.cpp b/src/reset_atoms_id.cpp index 26685f1972..c0fce95326 100644 --- a/src/reset_atoms_id.cpp +++ b/src/reset_atoms_id.cpp @@ -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