Commit 134b1d70 authored by Andrew Schultz's avatar Andrew Schultz
Browse files

Cleanup, add memory_usage method

parent 29cd4eb5
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -169,7 +169,8 @@ void ComputeHMA::init() {
  neighbor->requests[irequest]->occasional = 1; 
}

void ComputeHMA::init_list(int id, NeighList *ptr) {
void ComputeHMA::init_list(int id, NeighList *ptr)
{
  list = ptr;
}

@@ -196,12 +197,7 @@ void ComputeHMA::compute_vector()
{
  invoked_vector = update->ntimestep;         

// dx,dy,dz = displacement of atom from original position
  // original unwrapped position is stored by fix
  // for triclinic, need to unwrap current atom coord via h matrix

  // grow deltaR array if necessary

  if (comm_forward>0 && atom->nmax > nmax) {
    memory->destroy(deltaR);
    nmax = atom->nmax;
@@ -391,7 +387,8 @@ void ComputeHMA::compute_vector()
  }
}

double ComputeHMA::virial_compute(int n) {
double ComputeHMA::virial_compute(int n)
{
  double v = 0;

  // sum contributions to virial from forces and fixes
@@ -468,3 +465,9 @@ void ComputeHMA::set_arrays(int i)
  xoriginal[i][1] = x[i][1];
  xoriginal[i][2] = x[i][2];
}

double ComputeHMA::memory_usage()
{
  double bytes = nmax * 3 * sizeof(double);
  return bytes;
}
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class ComputeHMA : public Compute {
  void set_arrays(int);
  int pack_forward_comm(int, int *, double *, int, int *);
  void unpack_forward_comm(int, int, double *);
  double memory_usage();

 private:
  int nmax;