Commit 4de9cec1 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

make old_velocities allocation safer while retaining the test for nlocal

parent 09ad2934
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
  nrigid = 0;
  rfix = NULL;

  maxold = 0;
  maxold = -1;
  old_velocity = NULL;
}

@@ -458,7 +458,7 @@ void FixMSST::initial_integrate(int vflag)

  // realloc old_velocity if necessary

  if (atom->nmax > maxold) {
  if (nlocal > maxold) {
    memory->destroy(old_velocity);
    maxold = atom->nmax;
    memory->create(old_velocity,maxold,3,"msst:old_velocity");