Unverified Commit 6f1055a9 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2281 from jtclemm/patch_fix_store

Patch fix store to encode the size of per-atom data consistently with other related fixes for restarting.
parents 2775b937 e3beec8b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1541,6 +1541,7 @@ int FixWallGran::pack_restart(int i, double *buf)
  if (!use_history) return 0;

  int n = 0;
  // pack buf[0] this way because other fixes unpack it
  buf[n++] = size_history + 1;
  for (int m = 0; m < size_history; m++)
    buf[n++] = history_one[i][m];
@@ -1558,6 +1559,7 @@ void FixWallGran::unpack_restart(int nlocal, int nth)
  double **extra = atom->extra;

  // skip to Nth set of extra values
  // unpack the Nth first values this way because other fixes pack them
  
  int m = 0;
  for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
+3 −1
Original line number Diff line number Diff line
@@ -479,6 +479,7 @@ int FixWallGranRegion::pack_restart(int i, double *buf)
    for (m = 0; m < size_history; m++)
      buf[n++] = history_many[i][iwall][m];
  }
  // pack buf[0] this way because other fixes unpack it
  buf[0] = n;
  return n;
}
@@ -496,6 +497,7 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth)
  double **extra = atom->extra;

  // skip to Nth set of extra values
  // unpack the Nth first values this way because other fixes pack them
  
  int m = 0;
  for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
+3 −1
Original line number Diff line number Diff line
@@ -547,6 +547,7 @@ int FixGLD::unpack_exchange(int nlocal, double *buf)
int FixGLD::pack_restart(int i, double *buf)
{
  int m = 0;
  // pack buf[0] this way because other fixes unpack it
  buf[m++] = 3*prony_terms + 1;
  for (int k = 0; k < 3*prony_terms; k=k+3)
  {
@@ -566,6 +567,7 @@ void FixGLD::unpack_restart(int nlocal, int nth)
  double **extra = atom->extra;

  // skip to the nth set of extended variables
  // unpack the Nth first values this way because other fixes pack them
  
  int m = 0;
  for (int i = 0; i< nth; i++) m += static_cast<int> (extra[nlocal][m]);
+3 −1
Original line number Diff line number Diff line
@@ -656,6 +656,7 @@ void FixTTM::restart(char *buf)

int FixTTM::pack_restart(int i, double *buf)
{
  // pack buf[0] this way because other fixes unpack it
  buf[0] = 4;
  buf[1] = flangevin[i][0];
  buf[2] = flangevin[i][1];
@@ -672,6 +673,7 @@ void FixTTM::unpack_restart(int nlocal, int nth)
  double **extra = atom->extra;

  // skip to Nth set of extra values
  // unpack the Nth first values this way because other fixes pack them
  
  int m = 0;
  for (int i = 0; i < nth; i++) m += static_cast<int> (extra[nlocal][m]);
+4 −2
Original line number Diff line number Diff line
@@ -1041,7 +1041,7 @@ void FixCMAP::read_data_header(char *line)
    sscanf(line,BIGINT_FORMAT,&ncmap);
  } else error->all(FLERR,"Invalid read data header line for fix cmap");

  // didn't set in constructor b/c this fix could be defined
  // didn't set in constructor because this fix could be defined
  // before newton command

  newton_bond = force->newton_bond;
@@ -1291,6 +1291,7 @@ int FixCMAP::pack_restart(int i, double *buf)
    buf[n++] = ubuf(crossterm_atom4[i][m]).d;
    buf[n++] = ubuf(crossterm_atom5[i][m]).d;
  }
  // pack buf[0] this way because other fixes unpack it
  buf[0] = n;

  return n;
@@ -1305,6 +1306,7 @@ void FixCMAP::unpack_restart(int nlocal, int nth)
  double **extra = atom->extra;

  // skip to Nth set of extra values
  // unpack the Nth first values this way because other fixes pack them
  
   int n = 0;
   for (int i = 0; i < nth; i++) n += static_cast<int> (extra[nlocal][n]);
Loading