forked from lijiext/lammps
replace hard crash with disabling atom sorting, when no suitable binsize is found
This commit is contained in:
parent
09abc0c75a
commit
ea6d8a5dca
12
src/atom.cpp
12
src/atom.cpp
|
@ -1884,11 +1884,19 @@ void Atom::setup_sort_bins()
|
|||
// user setting if explicitly set
|
||||
// default = 1/2 of neighbor cutoff
|
||||
// check if neighbor cutoff = 0.0
|
||||
// and in that case, disable sorting
|
||||
|
||||
double binsize;
|
||||
if (userbinsize > 0.0) binsize = userbinsize;
|
||||
else binsize = 0.5 * neighbor->cutneighmax;
|
||||
if (binsize == 0.0) error->all(FLERR,"Atom sorting has bin size = 0.0");
|
||||
else if (neighbor->cutneighmax > 0.0) binsize = 0.5 * neighbor->cutneighmax;
|
||||
|
||||
if ((binsize == 0.0) && (sortfreq > 0)) {
|
||||
sortfreq = 0;
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"No pairwise cutoff or binsize set. "
|
||||
"Atom sorting therefore disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
double bininv = 1.0/binsize;
|
||||
|
||||
|
|
Loading…
Reference in New Issue