forked from lijiext/lammps
move memory allocation for atom style variable data where it belongs and cannot be skipped
this fixes the bug reported on lammps-users on 2020-01-22 by Olivier Politano
This commit is contained in:
parent
cc81dc2046
commit
48cae2703b
|
@ -316,6 +316,10 @@ void ComputeGlobalAtom::compute_peratom()
|
||||||
nmax = atom->nmax;
|
nmax = atom->nmax;
|
||||||
memory->destroy(indices);
|
memory->destroy(indices);
|
||||||
memory->create(indices,nmax,"global/atom:indices");
|
memory->create(indices,nmax,"global/atom:indices");
|
||||||
|
if (whichref == VARIABLE) {
|
||||||
|
memory->destroy(varatom);
|
||||||
|
memory->create(varatom,nmax,"global/atom:varatom");
|
||||||
|
}
|
||||||
if (nvalues == 1) {
|
if (nvalues == 1) {
|
||||||
memory->destroy(vector_atom);
|
memory->destroy(vector_atom);
|
||||||
memory->create(vector_atom,nmax,"global/atom:vector_atom");
|
memory->create(vector_atom,nmax,"global/atom:vector_atom");
|
||||||
|
@ -373,12 +377,6 @@ void ComputeGlobalAtom::compute_peratom()
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (whichref == VARIABLE) {
|
} else if (whichref == VARIABLE) {
|
||||||
if (atom->nmax > nmax) {
|
|
||||||
nmax = atom->nmax;
|
|
||||||
memory->destroy(varatom);
|
|
||||||
memory->create(varatom,nmax,"global/atom:varatom");
|
|
||||||
}
|
|
||||||
|
|
||||||
input->variable->compute_atom(ref2index,igroup,varatom,1,0);
|
input->variable->compute_atom(ref2index,igroup,varatom,1,0);
|
||||||
for (i = 0; i < nlocal; i++)
|
for (i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit)
|
if (mask[i] & groupbit)
|
||||||
|
|
Loading…
Reference in New Issue