Unverified Commit bc1b876a authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

make fix widom errors and test output consistent with the fix name capitalization

parent 612f1d7c
Loading
Loading
Loading
Loading
+38 −38
Original line number Diff line number Diff line
@@ -62,10 +62,10 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :
  local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL),
  random_equal(NULL)
{
  if (narg < 8) error->all(FLERR,"Illegal fix Widom command");
  if (narg < 8) error->all(FLERR,"Illegal fix widom command");

  if (atom->molecular == 2)
    error->all(FLERR,"Fix Widom does not (yet) work with atom_style template");
    error->all(FLERR,"Fix widom does not (yet) work with atom_style template");

  dynamic_group_allow = 1;

@@ -86,11 +86,11 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :
  seed = utils::inumeric(FLERR,arg[6],false,lmp);
  insertion_temperature = utils::numeric(FLERR,arg[7],false,lmp);

  if (nevery <= 0) error->all(FLERR,"Illegal fix Widom command");
  if (ninsertions < 0) error->all(FLERR,"Illegal fix Widom command");
  if (seed <= 0) error->all(FLERR,"Illegal fix Widom command");
  if (nevery <= 0) error->all(FLERR,"Illegal fix widom command");
  if (ninsertions < 0) error->all(FLERR,"Illegal fix widom command");
  if (seed <= 0) error->all(FLERR,"Illegal fix widom command");
  if (insertion_temperature < 0.0)
    error->all(FLERR,"Illegal fix Widom command");
    error->all(FLERR,"Illegal fix widom command");

  // read options from end of input line

@@ -106,9 +106,9 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :
    region_zlo = region_zhi = 0.0;
  if (regionflag) {
    if (domain->regions[iregion]->bboxflag == 0)
      error->all(FLERR,"Fix Widom region does not support a bounding box");
      error->all(FLERR,"Fix widom region does not support a bounding box");
    if (domain->regions[iregion]->dynamic_check())
      error->all(FLERR,"Fix Widom region cannot be dynamic");
      error->all(FLERR,"Fix widom region cannot be dynamic");

    region_xlo = domain->regions[iregion]->extent_xlo;
    region_xhi = domain->regions[iregion]->extent_xhi;
@@ -120,7 +120,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :
    if (region_xlo < domain->boxlo[0] || region_xhi > domain->boxhi[0] ||
        region_ylo < domain->boxlo[1] || region_yhi > domain->boxhi[1] ||
        region_zlo < domain->boxlo[2] || region_zhi > domain->boxhi[2])
      error->all(FLERR,"Fix Widom region extends outside simulation box");
      error->all(FLERR,"Fix widom region extends outside simulation box");

    // estimate region volume using MC trials

@@ -146,22 +146,22 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :

  if (exchmode == EXCHMOL) {
    if (onemols[imol]->xflag == 0)
      error->all(FLERR,"Fix Widom molecule must have coordinates");
      error->all(FLERR,"Fix widom molecule must have coordinates");
    if (onemols[imol]->typeflag == 0)
      error->all(FLERR,"Fix Widom molecule must have atom types");
      error->all(FLERR,"Fix widom molecule must have atom types");
    if (nwidom_type != 0)
      error->all(FLERR,"Atom type must be zero in fix Widom mol command");
      error->all(FLERR,"Atom type must be zero in fix widom mol command");
    if (onemols[imol]->qflag == 1 && atom->q == NULL)
      error->all(FLERR,"Fix Widom molecule has charges, but atom style does not");
      error->all(FLERR,"Fix widom molecule has charges, but atom style does not");

    if (atom->molecular == 2 && onemols != atom->avec->onemols)
      error->all(FLERR,"Fix Widom molecule template ID must be same "
      error->all(FLERR,"Fix widom molecule template ID must be same "
                 "as atom_style template ID");
    onemols[imol]->check_attributes(0);
  }

  if (charge_flag && atom->q == NULL)
    error->all(FLERR,"Fix Widom atom has charge, but atom style does not");
    error->all(FLERR,"Fix widom atom has charge, but atom style does not");

  // setup of array of coordinates for molecule insertion

@@ -186,7 +186,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) :

void FixWidom::options(int narg, char **arg)
{
  if (narg < 0) error->all(FLERR,"Illegal fix Widom command");
  if (narg < 0) error->all(FLERR,"Illegal fix widom command");

  // defaults

@@ -208,29 +208,29 @@ void FixWidom::options(int narg, char **arg)
  int iarg = 0;
  while (iarg < narg) {
  if (strcmp(arg[iarg],"mol") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command");
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command");
      imol = atom->find_molecule(arg[iarg+1]);
      if (imol == -1)
        error->all(FLERR,"Molecule template ID for fix Widom does not exist");
        error->all(FLERR,"Molecule template ID for fix widom does not exist");
      if (atom->molecules[imol]->nset > 1 && comm->me == 0)
        error->warning(FLERR,"Molecule template for "
                       "fix Widom has multiple molecules");
                       "fix widom has multiple molecules");
      exchmode = EXCHMOL;
      onemols = atom->molecules;
      nmol = onemols[imol]->nset;
      iarg += 2;
    } else if (strcmp(arg[iarg],"region") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command");
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command");
      iregion = domain->find_region(arg[iarg+1]);
      if (iregion == -1)
        error->all(FLERR,"Region ID for fix Widom does not exist");
        error->all(FLERR,"Region ID for fix widom does not exist");
      int n = strlen(arg[iarg+1]) + 1;
      idregion = new char[n];
      strcpy(idregion,arg[iarg+1]);
      regionflag = 1;
      iarg += 2;
    } else if (strcmp(arg[iarg],"charge") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command");
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command");
      charge = utils::numeric(FLERR,arg[iarg+1],false,lmp);
      charge_flag = true;
      iarg += 2;
@@ -238,10 +238,10 @@ void FixWidom::options(int narg, char **arg)
      full_flag = true;
      iarg += 1;
    } else if (strcmp(arg[iarg],"intra_energy") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command");
      if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command");
      energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp);
      iarg += 2;
    } else error->all(FLERR,"Illegal fix Widom command");
    } else error->all(FLERR,"Illegal fix widom command");
  }
}

@@ -291,7 +291,7 @@ void FixWidom::init()
        ) {
      full_flag = true;
      if (comm->me == 0)
        error->warning(FLERR,"Fix Widom using full_energy option");
        error->warning(FLERR,"Fix widom using full_energy option");
    }
  }

@@ -299,7 +299,7 @@ void FixWidom::init()

  if (exchmode == EXCHATOM) {
    if (nwidom_type <= 0 || nwidom_type > atom->ntypes)
      error->all(FLERR,"Invalid atom type in fix Widom command");
      error->all(FLERR,"Invalid atom type in fix widom command");
  }

  // if molecules are exchanged or moved, check for unset mol IDs
@@ -314,17 +314,17 @@ void FixWidom::init()
    MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
    if (flagall && comm->me == 0)
      error->all(FLERR,
       "All mol IDs should be set for fix Widom group atoms");
       "All mol IDs should be set for fix widom group atoms");
  }

  if (exchmode == EXCHMOL)
    if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style)
      error->all(FLERR,
       "Fix Widom molecule command requires that "
       "Fix widom molecule command requires that "
       "atoms have molecule attributes");

  if (domain->dimension == 2)
    error->all(FLERR,"Cannot use fix Widom in a 2d simulation");
    error->all(FLERR,"Cannot use fix widom in a 2d simulation");

  // create a new group for interaction exclusions
  // used for attempted atom or molecule deletions
@@ -387,7 +387,7 @@ void FixWidom::init()
  } else gas_mass = atom->mass[nwidom_type];

  if (gas_mass <= 0.0)
    error->all(FLERR,"Illegal fix Widom gas mass <= 0");
    error->all(FLERR,"Illegal fix widom gas mass <= 0");

  // check that no deletable atoms are in atom->firstgroup
  // deleting such an atom would not leave firstgroup atoms first
@@ -404,7 +404,7 @@ void FixWidom::init()
    MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);

    if (flagall)
      error->all(FLERR,"Cannot do Widom on atoms in atom_modify first group");
      error->all(FLERR,"Cannot use fix widom on atoms in atom_modify first group");
  }

  // compute beta
@@ -417,7 +417,7 @@ void FixWidom::init()
  // full_flag on molecules on more than one processor.
  // Print error if this is the current mode
  if (full_flag && (exchmode == EXCHMOL) && comm->nprocs > 1)
    error->all(FLERR,"fix Widom does currently not support full_energy option with molecules on more than 1 MPI process.");
    error->all(FLERR,"fix widom does currently not support full_energy option with molecules on more than 1 MPI process.");

}

@@ -535,7 +535,7 @@ void FixWidom::attempt_atomic_insertion()
    if (triclinic == 0) {
      domain->remap(coord);
      if (!domain->inside(coord))
        error->one(FLERR,"Fix Widom put atom outside box");
        error->one(FLERR,"Fix widom put atom outside box");
      if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
    coord[1] >= sublo[1] && coord[1] < subhi[1] &&
    coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1;
@@ -648,7 +648,7 @@ void FixWidom::attempt_molecule_insertion()
      xtmp[2] = molcoords[i][2];
      domain->remap(xtmp);
      if (!domain->inside(xtmp))
        error->one(FLERR,"Fix Widom put atom outside box");
        error->one(FLERR,"Fix widom put atom outside box");

      procflag[i] = false;
      if (triclinic == 0) {
@@ -737,7 +737,7 @@ void FixWidom::attempt_atomic_insertion_full()
    if (triclinic == 0) {
      domain->remap(coord);
      if (!domain->inside(coord))
        error->one(FLERR,"Fix Widom put atom outside box");
        error->one(FLERR,"Fix widom put atom outside box");
      if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
    coord[1] >= sublo[1] && coord[1] < subhi[1] &&
    coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1;
@@ -803,7 +803,7 @@ void FixWidom::attempt_molecule_insertion_full()
  MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
  maxmol_all++;
  if (maxmol_all >= MAXTAGINT)
    error->all(FLERR,"Fix Widom ran out of available molecule IDs");
    error->all(FLERR,"Fix widom ran out of available molecule IDs");
  int insertion_molecule = maxmol_all;

  tagint maxtag = 0;
@@ -883,7 +883,7 @@ void FixWidom::attempt_molecule_insertion_full()
      imageint imagetmp = imagezero;
      domain->remap(xtmp,imagetmp);
      if (!domain->inside(xtmp))
        error->one(FLERR,"Fix Widom put atom outside box");
        error->one(FLERR,"Fix widom put atom outside box");

      int proc_flag = 0;
      if (triclinic == 0) {
@@ -904,7 +904,7 @@ void FixWidom::attempt_molecule_insertion_full()
        atom->image[m] = imagetmp;
        atom->molecule[m] = insertion_molecule;
        if (maxtag_all+i+1 >= MAXTAGINT)
    error->all(FLERR,"Fix Widom ran out of available atom IDs");
    error->all(FLERR,"Fix widom ran out of available atom IDs");
        atom->tag[m] = maxtag_all + i + 1;
        atom->v[m][0] = 0;
        atom->v[m][1] = 0;