From 6023ea7ff679015b47531e22d557b93af7931a92 Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Wed, 23 Mar 2011 14:02:40 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5812
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/USER-EFF/atom_vec_electron.cpp | 32 +++++++++++++++---------------
 src/USER-EFF/atom_vec_electron.h   |  3 +--
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp
index 15de2e1a84..c54fa8cbb4 100644
--- a/src/USER-EFF/atom_vec_electron.cpp
+++ b/src/USER-EFF/atom_vec_electron.cpp
@@ -793,23 +793,23 @@ int AtomVecElectron::data_vel_hybrid(int m, char **values)
    return # of bytes of allocated memory 
 ------------------------------------------------------------------------- */
 
-double AtomVecElectron::memory_usage()
+bigint AtomVecElectron::memory_usage()
 {
-  double bytes = 0.0;
-  
-  if (atom->memcheck("tag")) bytes += nmax * sizeof(int);
-  if (atom->memcheck("type")) bytes += nmax * sizeof(int);
-  if (atom->memcheck("mask")) bytes += nmax * sizeof(int);
-  if (atom->memcheck("image")) bytes += nmax * sizeof(int);
-  if (atom->memcheck("x")) bytes += nmax*3 * sizeof(double);
-  if (atom->memcheck("v")) bytes += nmax*3 * sizeof(double);
-  if (atom->memcheck("f")) bytes += nmax*3 * sizeof(double);
-  
-  if (atom->memcheck("q")) bytes += nmax * sizeof(double);
-  if (atom->memcheck("spin")) bytes += nmax * sizeof(int);
-  if (atom->memcheck("eradius")) bytes += nmax * sizeof(double);
-  if (atom->memcheck("ervel")) bytes += nmax * sizeof(double);
-  if (atom->memcheck("erforce")) bytes += nmax * sizeof(double);
+  bigint bytes = 0;
+  
+  if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
+  if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
+  if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
+  if (atom->memcheck("image")) bytes += memory->usage(image,nmax);
+  if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
+  if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
+  if (atom->memcheck("f")) bytes += memory->usage(f,nmax,3);
+  
+  if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
+  if (atom->memcheck("spin")) bytes += memory->usage(spin,nmax);
+  if (atom->memcheck("eradius")) bytes += memory->usage(eradius,nmax);
+  if (atom->memcheck("ervel")) bytes += memory->usage(ervel,nmax);
+  if (atom->memcheck("erforce")) bytes += memory->usage(erforce,nmax);
   
   return bytes;
 }
diff --git a/src/USER-EFF/atom_vec_electron.h b/src/USER-EFF/atom_vec_electron.h
index 704a8378fe..3670958c16 100644
--- a/src/USER-EFF/atom_vec_electron.h
+++ b/src/USER-EFF/atom_vec_electron.h
@@ -57,7 +57,7 @@ class AtomVecElectron : public AtomVec {
   int data_atom_hybrid(int, char **);
   void data_vel(int, char **);
   int data_vel_hybrid(int, char **);
-  double memory_usage();
+  bigint memory_usage();
   
  private:
   double PI;
@@ -71,4 +71,3 @@ class AtomVecElectron : public AtomVec {
 
 #endif
 #endif
-
-- 
GitLab