Commit 6c8d3ed4 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15463 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 550be1d5
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -75,11 +75,10 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
  // expand args if any have wildcard character "*"

  int expand = 0;
  char **earg,**arghold;
  char **earg;
  int nargnew = input->expand_args(narg-iarg,&arg[iarg],1,earg);

  if (earg != &arg[iarg]) expand = 1;
  arghold = arg;
  arg = earg;

  // parse values until one isn't recognized
@@ -190,9 +189,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
  // if wildcard expansion occurred, free earg memory from expand_args()

  if (expand) {
    for (int i = 0; i < nvalues; i++) delete [] earg[i];
    for (int i = 0; i < nargnew; i++) delete [] earg[i];
    memory->sfree(earg);
    arg = arghold;
  }

  // setup and error check
+6 −7
Original line number Diff line number Diff line
@@ -68,13 +68,15 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
  // nfield may be shrunk below if extra optional args exist

  expand = 0;
  nfield = input->expand_args(narg-5,&arg[5],1,earg);
  nfield = nargnew = input->expand_args(narg-5,&arg[5],1,earg);
  if (earg != &arg[5]) expand = 1;

  // allocate field vectors

  pack_choice = new FnPtrPack[nfield];
  vtype = new int[nfield];
  field2index = new int[nfield];
  argindex = new int[nfield];

  buffer_allow = 1;
  buffer_flag = 1;
@@ -87,9 +89,6 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :

  // computes, fixes, variables which the dump accesses

  memory->create(field2index,nfield,"dump:field2index");
  memory->create(argindex,nfield,"dump:argindex");

  ncompute = 0;
  id_compute = NULL;
  compute = NULL;
@@ -181,14 +180,14 @@ DumpCustom::~DumpCustom()
  // could not do in constructor, b/c some derived classes process earg

  if (expand) {
    for (int i = 0; i < nfield; i++) delete [] earg[i];
    for (int i = 0; i < nargnew; i++) delete [] earg[i];
    memory->sfree(earg);
  }

  delete [] pack_choice;
  delete [] vtype;
  memory->destroy(field2index);
  memory->destroy(argindex);
  delete [] field2index;
  delete [] argindex;

  delete [] idregion;
  memory->destroy(thresh_array);
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ class DumpCustom : public Dump {

  int expand;                // flag for whether field args were expanded
  char **earg;               // field names with wildcard expansion
  int nargnew;               // size of earg

  int *vtype;                // type of each vector (INT, DOUBLE)
  char **vformat;            // format string for each vector element
+1 −3
Original line number Diff line number Diff line
@@ -49,11 +49,10 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
  // this can reset nvalues

  int expand = 0;
  char **earg,**arghold;
  char **earg;
  nvalues = input->expand_args(nvalues,&arg[6],1,earg);

  if (earg != &arg[6]) expand = 1;
  arghold = arg;
  arg = earg;

  // parse values
@@ -128,7 +127,6 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
  if (expand) {
    for (int i = 0; i < nvalues; i++) delete [] earg[i];
    memory->sfree(earg);
    arg = arghold;
  }

  // setup and error check
+4 −5
Original line number Diff line number Diff line
@@ -60,11 +60,10 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
  // expand args if any have wildcard character "*"

  int expand = 0;
  char **earg,**arghold;
  char **earg;
  int nargnew = input->expand_args(narg-7,&arg[7],1,earg);

  if (earg != &arg[7]) expand = 1;
  arghold = arg;
  arg = earg;

  // parse values until one isn't recognized
@@ -75,8 +74,9 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
  value2index = new int[nargnew];
  nvalues = 0;

  int iarg = 7;
  int iarg = 0;
  while (iarg < narg) {

    ids[nvalues] = NULL;

    if (strcmp(arg[iarg],"vx") == 0) {
@@ -376,9 +376,8 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
  // wait to do this until after file comment lines are printed

  if (expand) {
    for (int i = 0; i < nvalues; i++) delete [] earg[i];
    for (int i = 0; i < nargnew; i++) delete [] earg[i];
    memory->sfree(earg);
    arg = arghold;
  }

  // this fix produces a global array
Loading