avoid segmentation fault when atom map is cleared before sametag is allocated

This commit is contained in:
Axel Kohlmeyer
2023-03-28 01:48:16 -04:00
parent 2610feb270
commit 824ed3379a

View File

@ -118,7 +118,7 @@ void Atom::map_clear()
if (map_style == MAP_ARRAY) {
int nall = nlocal + nghost;
for (int i = 0; i < nall; i++) {
sametag[i] = -1;
if (sametag) sametag[i] = -1;
map_array[tag[i]] = -1;
}
@ -127,7 +127,7 @@ void Atom::map_clear()
tagint global;
int nall = nlocal + nghost;
for (int i = 0; i < nall; i++) {
sametag[i] = -1;
if (sametag) sametag[i] = -1;
// search for key
// if don't find it, done