From 19252df8ad20121677f8977dfa7acb6e7ad8624d Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 30 Jan 2014 21:34:55 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11403 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/atom.cpp | 3 ++- src/atom.h | 7 +++---- src/atom_map.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/atom.cpp b/src/atom.cpp index fb2fa564ea..a850c66f58 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -162,6 +162,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) tag_enable = 1; map_style = map_user = 0; map_tag_max = 0; + map_maxarray = 0; map_nhash = 0; max_same = 0; @@ -1848,7 +1849,7 @@ bigint Atom::memory_usage() bytes += max_same*sizeof(int); if (map_style == 1) - bytes += memory->usage(map_array,max_array); + bytes += memory->usage(map_array,map_maxarray); else if (map_style == 2) { bytes += map_nbucket*sizeof(int); bytes += map_nhash*sizeof(HashElem); diff --git a/src/atom.h b/src/atom.h index fd48f7620a..fae87653cd 100644 --- a/src/atom.h +++ b/src/atom.h @@ -241,9 +241,10 @@ class Atom : protected Pointers { // global to local ID mapping - int *map_array; // direct map of length map_tag_max + 1 + int *map_array; // direct map via array that holds map_tag_max + int map_maxarray; // allocated size of map_array (1 larger than this) - struct HashElem { + struct HashElem { // hashed map tagint global; // key to search on = global ID int local; // value associated with key = local index int next; // next entry in this bucket, -1 if last @@ -255,8 +256,6 @@ class Atom : protected Pointers { int *map_bucket; // ptr to 1st entry in each bucket HashElem *map_hash; // hash table - int max_array; // allocated size of map_array (+1) - int max_nhash; // allocated size of hash table int max_same; // allocated size of sametag // spatial sorting of atoms diff --git a/src/atom_map.cpp b/src/atom_map.cpp index eab9b226f3..c04676c2b8 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -60,7 +60,7 @@ void Atom::map_init() int recreate = 0; if (map_style != map_style_old) recreate = 1; - else if (map_style == 1 && map_tag_max > max_array) recreate = 1; + else if (map_style == 1 && map_tag_max > map_maxarray) recreate = 1; else if (map_style == 2 && nlocal+nghost > map_nhash) recreate = 1; // if not recreating: @@ -84,8 +84,8 @@ void Atom::map_init() map_delete(); if (map_style == 1) { - max_array = map_tag_max; - memory->create(map_array,max_array+1,"atom:map_array"); + map_maxarray = map_tag_max; + memory->create(map_array,map_maxarray+1,"atom:map_array"); for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1; } else {