Commit 0e511f16 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1718 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 75d43933
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ FixNVENoforce::FixNVENoforce(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
{
  if (narg != 3) error->all("Illegal fix nve/noforce command");

  time_integrate = 1;
}

/* ---------------------------------------------------------------------- */
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ FixNVESphere::FixNVESphere(LAMMPS *lmp, int narg, char **arg) :
{
  if (narg < 3) error->all("Illegal fix nve/sphere command");

  time_integrate = 1;

  // process extra keywords

  extra = NONE;
+28 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ Modify::~Modify()

void Modify::init()
{
  int i;
  int i,j;

  // delete storage of restart info since it is not valid after 1st run

@@ -165,6 +165,33 @@ void Modify::init()

  for (i = 0; i < ncompute; i++) compute[i]->init();
  modify->addstep_compute_all(update->ntimestep);

  // warn if any particle is time integrated more than once

  int nlocal = atom->nlocal;
  int *mask = atom->mask;

  int *flag = new int[nlocal];
  for (i = 0; i < nlocal; i++) flag[i] = 0;

  int groupbit;
  for (i = 0; i < nfix; i++) {
    if (fix[i]->time_integrate == 0) continue;
    groupbit = fix[i]->groupbit;
    for (j = 0; j < nlocal; j++)
      if (mask[j] & groupbit) flag[j]++;
  }

  int check = 0;
  for (i = 0; i < nlocal; i++)
    if (flag[i] > 1) check = 1;

  delete [] flag;

  int checkall;
  MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
  if (comm->me == 0 && checkall)
    error->warning("One or more atoms are time integrated more than once");
}

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