git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1718 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2008-04-04 23:17:45 +00:00
parent 75d43933d4
commit 0e511f1619
3 changed files with 32 additions and 1 deletions

View File

@ -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;
}
/* ---------------------------------------------------------------------- */

View File

@ -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;

View File

@ -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");
}
/* ----------------------------------------------------------------------