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

This commit is contained in:
sjplimp
2012-05-18 22:45:56 +00:00
parent d99dd02a72
commit f35d71d798
3 changed files with 19 additions and 13 deletions

View File

@ -30,9 +30,8 @@ using namespace LAMMPS_NS;
using namespace FixConst;
#define DELTA 4
#define BIG 1.0e20
#define NEXCEPT 3 // change when add to exceptions in add_fix()
/* ---------------------------------------------------------------------- */
@ -70,8 +69,6 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
id_restart_peratom = style_restart_peratom = NULL;
index_restart_peratom = NULL;
allow_early_fix = 0;
ncompute = maxcompute = 0;
compute = NULL;
}
@ -216,7 +213,8 @@ void Modify::init()
int checkall;
MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
if (comm->me == 0 && checkall)
error->warning(FLERR,"One or more atoms are time integrated more than once");
error->warning(FLERR,
"One or more atoms are time integrated more than once");
}
/* ----------------------------------------------------------------------
@ -570,10 +568,24 @@ int Modify::min_reset_ref()
void Modify::add_fix(int narg, char **arg, char *suffix)
{
if (domain->box_exist == 0 && allow_early_fix == 0)
error->all(FLERR,"Fix command before simulation box is defined");
const char *exceptions[NEXCEPT] = {"GPU","OMP","cmap"};
if (narg < 3) error->all(FLERR,"Illegal fix command");
// cannot define fix before box exists unless style is in exception list
// don't like this way of checking for exceptions by adding to list,
// but can't think of better way
// too late if instantiate fix, then check flag set in fix constructor,
// since some fixes access domain settings in their constructor
if (domain->box_exist == 0) {
int m;
for (m = 0; m < NEXCEPT; m++)
if (strcmp(arg[2],exceptions[m]) == 0) break;
if (m == NEXCEPT)
error->all(FLERR,"Fix command before simulation box is defined");
}
// check group ID
int igroup = group->find(arg[1]);