bugfix for 2 recenty reported neighbor issues, also a ReaxFF fix species issue

This commit is contained in:
Steve Plimpton
2017-05-16 15:51:41 -06:00
parent 06c151421c
commit 7f9a331c73
47 changed files with 80 additions and 98 deletions

View File

@ -29,6 +29,7 @@ NBin::NBin(LAMMPS *lmp) : Pointers(lmp)
maxbin = maxatom = 0;
binhead = NULL;
bins = NULL;
atom2bin = NULL;
// geometry settings
@ -42,6 +43,7 @@ NBin::~NBin()
{
memory->destroy(binhead);
memory->destroy(bins);
memory->destroy(atom2bin);
}
/* ---------------------------------------------------------------------- */
@ -87,12 +89,15 @@ void NBin::bin_atoms_setup(int nall)
memory->create(binhead,maxbin,"neigh:binhead");
}
// bins = per-atom vector
// bins and atom2bin = per-atom vectors
// for both local and ghost atoms
if (nall > maxatom) {
maxatom = nall;
memory->destroy(bins);
memory->create(bins,maxatom,"neigh:bins");
memory->destroy(atom2bin);
memory->create(atom2bin,maxatom,"neigh:atom2bin");
}
}
@ -148,6 +153,6 @@ bigint NBin::memory_usage()
{
bigint bytes = 0;
bytes += maxbin*sizeof(int);
bytes += maxatom*sizeof(int);
bytes += 2*maxatom*sizeof(int);
return bytes;
}