Commit 19252df8 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11403 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 15a48a27
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
+3 −4
Original line number Diff line number Diff line
@@ -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
+3 −3
Original line number Diff line number Diff line
@@ -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 {