second round of making per-atom allocations consistent.
now all sections that dimension per-atom local arrays to atom->nmax will also *test* for atom->nmax and thus we avoid potential segfaults in all cases where atom->nlocal or atom->nlocal+atom->nghost are 0. it doesn't make sense to test for these if the arrays are dimensioned to atom->nmax afterwards anyway.
This commit is contained in:
@ -585,7 +585,7 @@ void FixAveSpatial::end_of_step()
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (nlocal > maxatom) {
|
||||
if (atom->nmax > maxatom) {
|
||||
maxatom = atom->nmax;
|
||||
memory->destroy(bin);
|
||||
memory->create(bin,maxatom,"ave/spatial:bin");
|
||||
@ -716,7 +716,7 @@ void FixAveSpatial::end_of_step()
|
||||
// evaluate atom-style variable
|
||||
|
||||
} else if (which[m] == VARIABLE) {
|
||||
if (nlocal > maxvar) {
|
||||
if (atom->nmax > maxvar) {
|
||||
maxvar = atom->nmax;
|
||||
memory->destroy(varatom);
|
||||
memory->create(varatom,maxvar,"ave/spatial:varatom");
|
||||
|
||||
Reference in New Issue
Block a user