Unverified Commit a39a35af authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1517 from jrgissing/bond/react-clarify-template-check-messages

Bond/react: clarify reaction-template warning messages
parents 1452d3d2 4178c516
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -636,12 +636,12 @@ Please ensure reaction map files are properly formatted. :dd

{Bond/react: Atom affected by reaction too close to template edge} :dt

This means an atom which changes type during the reaction is too close
to an 'edge' atom defined in the superimpose file. This could cause
incorrect assignment of bonds, angle, etc. Generally, this means you
must include more atoms in your templates, such that there are at
least two atoms between each atom involved in the reaction and an edge
atom. :dd
This means an atom which changes type or connectivity during the
reaction is too close to an 'edge' atom defined in the superimpose
file. This could cause incorrect assignment of bonds, angle, etc.
Generally, this means you must include more atoms in your templates,
such that there are at least two atoms between each atom involved in
the reaction and an edge atom. :dd

{Bond/react: Fix bond/react needs ghost atoms from farther away} :dt

+8 −4
Original line number Diff line number Diff line
@@ -82,10 +82,14 @@ bond/angle/dihedral. LAMMPS computes this by taking the maximum bond
length, multiplying by the number of bonds in the interaction (e.g. 3
for a dihedral) and adding a small amount of stretch. :dd

{Bond/react: An atom in 'react #%d' changes bond connectivity but not atom type} :dt

You may want to double-check that all atom types are properly assigned
in the post-reaction template. :dd
{Bond/react: Atom affected by reaction too close to template edge} :dt

This means an atom which changes type or connectivity during the
reaction is too close to an 'edge' atom defined in the superimpose
file. This could cause incorrect assignment of bonds, angle, etc.
Generally, this means you must include more atoms in your templates,
such that there are at least two atoms between each atom involved in
the reaction and an edge atom. :dd

{Both groups in compute group/group have a net charge; the Kspace boundary correction to energy will be non-zero} :dt

+15 −8
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :

  // this looks excessive
  // the price of vectorization (all reactions in one command)?
  memory->create(rxn_name,nreacts,MAXLINE,"bond/react:rxn_name");
  memory->create(nevery,nreacts,"bond/react:nevery");
  memory->create(cutsq,nreacts,2,"bond/react:cutsq");
  memory->create(unreacted_mol,nreacts,"bond/react:unreacted_mol");
@@ -207,8 +208,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :

    iarg++;

    iarg++; // read in reaction name here
    //for example, rxn_name[rxn] = ...
    rxn_name[rxn] = arg[iarg++];

    int igroup = group->find(arg[iarg++]);
    if (igroup == -1) error->all(FLERR,"Could not find fix group ID");
@@ -1720,8 +1720,11 @@ void FixBondReact::find_landlocked_atoms(int myrxn)
  // bad molecule templates check
  // if atoms change types, but aren't landlocked, that's bad
  for (int i = 0; i < twomol->natoms; i++) {
    if (twomol->type[i] != onemol->type[equivalences[i][1][myrxn]-1] && landlocked_atoms[i][myrxn] == 0)
      error->one(FLERR,"Bond/react: Atom affected by reaction too close to template edge");
    if (twomol->type[i] != onemol->type[equivalences[i][1][myrxn]-1] && landlocked_atoms[i][myrxn] == 0) {
      char str[128];
      snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]);
      error->all(FLERR,str);
    }
  }

  // additionally, if a bond changes type, but neither involved atom is landlocked, bad
@@ -1737,7 +1740,9 @@ void FixBondReact::find_landlocked_atoms(int myrxn)
            onemol_batom = onemol->bond_atom[onemol_atomi-1][m];
            if (onemol_batom == equivalences[twomol_atomj-1][1][myrxn]) {
              if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomi-1][m]) {
                error->one(FLERR,"Bond/react: Bond type affected by reaction too close to template edge");
                char str[128];
                snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]);
                error->all(FLERR,str);
              }
            }
          }
@@ -1747,7 +1752,9 @@ void FixBondReact::find_landlocked_atoms(int myrxn)
              onemol_batom = onemol->bond_atom[onemol_atomj-1][m];
              if (onemol_batom == equivalences[i][1][myrxn]) {
                if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomj-1][m]) {
                  error->one(FLERR,"Bond/react: Bond type affected by reaction too close to template edge");
                  char str[128];
                  snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]);
                  error->all(FLERR,str);
                }
              }
            }
@@ -1763,7 +1770,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn)
      int ii = reverse_equiv[i][1][myrxn] - 1;
      for (int j = 0; j < twomol_nxspecial[ii][0]; j++) {
        if (delete_atoms[equivalences[twomol_xspecial[ii][j]-1][1][myrxn]-1][myrxn] == 0) {
         error->one(FLERR,"Bond/react: A deleted atom cannot remain bonded to an atom that is not deleted");
         error->all(FLERR,"Bond/react: A deleted atom cannot remain bonded to an atom that is not deleted");
        }
      }
    }
@@ -1774,7 +1781,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn)
    for (int i = 0; i < twomol->natoms; i++) {
      if (twomol_nxspecial[i][0] != onemol_nxspecial[equivalences[i][1][myrxn]-1][0] && landlocked_atoms[i][myrxn] == 0) {
        char str[128];
        sprintf(str,"Bond/react: An atom in 'react #%d' changes bond connectivity but not atom type",myrxn+1);
        snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]);
        error->warning(FLERR,str);
        break;
      }
+8 −12
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ class FixBondReact : public Fix {
  int *groupbits;

  int rxnID; // integer ID for identifying current bond/react
  char **rxn_name; // name of reaction
  int *reaction_count;
  int *reaction_count_total;
  int nmax; // max num local atoms
@@ -213,14 +214,14 @@ E: Bond/react: Unknown section in map file

Please ensure reaction map files are properly formatted.

E: Bond/react: Atom affected by reaction too close to template edge
E or W: Bond/react: Atom affected by reaction %s too close to template edge

This means an atom which changes type during the reaction is too close
to an 'edge' atom defined in the superimpose file. This could cause
incorrect assignment of bonds, angle, etc. Generally, this means you
must include more atoms in your templates, such that there are at
least two atoms between each atom involved in the reaction and an edge
atom.
This means an atom which changes type or connectivity during the
reaction is too close to an 'edge' atom defined in the superimpose
file. This could cause incorrect assignment of bonds, angle, etc.
Generally, this means you must include more atoms in your templates,
such that there are at least two atoms between each atom involved in
the reaction and an edge atom.

E: Bond/react: Fix bond/react needs ghost atoms from farther away

@@ -233,11 +234,6 @@ E: Bond/react: A deleted atom cannot remain bonded to an atom that is not delete

Self-explanatory.

W: Bond/react: An atom in 'react #%d' changes bond connectivity but not atom type

You may want to double-check that all atom types are properly assigned
in the post-reaction template.

E: Bond/react special bond generation overflow

The number of special bonds per-atom created by a reaction exceeds the