Commit e3e687f7 authored by athomps's avatar athomps
Browse files

Added peratom keyword

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14470 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 56ef0d40
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -113,6 +113,12 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) :
      else if (strcmp(arg[iarg+1],"no") == 0) faces_flag = 0;
      else error->all(FLERR,"Illegal compute voronoi/atom command");
      iarg += 2;
    } else if (strcmp(arg[iarg], "peratom") == 0) {
      if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
      if (strcmp(arg[iarg+1],"yes") == 0) peratom_flag = 1;
      else if (strcmp(arg[iarg+1],"no") == 0) peratom_flag = 0;
      else error->all(FLERR,"Illegal compute voronoi/atom command");
      iarg += 2;
    }
    else error->all(FLERR,"Illegal compute voronoi/atom command");
  }
@@ -137,6 +143,7 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) :
  if (faces_flag) {
    local_flag = 1;
    size_local_cols = 3;
    size_local_rows = 0;
    nfacesmax = 0;
  }
}
@@ -298,7 +305,7 @@ void ComputeVoronoi::buildCells()
  }

  // clear edge statistics
  for (i = 0; i < maxedge; ++i) edge[i]=0;
  for (i = 0; i <= maxedge; ++i) edge[i]=0;

  // initialize voro++ container
  // preallocates 8 atoms per cell
@@ -606,6 +613,14 @@ void ComputeVoronoi::compute_vector()

/* ---------------------------------------------------------------------- */

void ComputeVoronoi::compute_local()
{
  invoked_local = update->ntimestep;
  if( invoked_peratom < invoked_local ) compute_peratom();
}

/* ---------------------------------------------------------------------- */

int ComputeVoronoi::pack_forward_comm(int n, int *list, double *buf,
                                  int pbc_flag, int *pbc)
{
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class ComputeVoronoi : public Compute {
  void init();
  void compute_peratom();
  void compute_vector();
  void compute_local();
  double memory_usage();

  int pack_forward_comm(int, int *, double *, int, int *);