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

Merge pull request #1913 from jrgissing/molecule_template_moleculeIDs

Molecule template: molecule-IDs and fragments
parents d1388b4e d7cade9d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -4724,6 +4724,12 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
*Invalid Masses section in molecule file*
   Self-explanatory.

*Invalid molecule ID in molecule file*
   Molecule ID must be a non-zero positive integer.

*Invalid Molecules section in molecule file*
   Self-explanatory.

*Invalid REAX atom type*
   There is a mis-match between LAMMPS atom types and the elements
   listed in the ReaxFF force field file.
@@ -4790,6 +4796,9 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
   Atom IDs must be positive integers and within range of defined
   atoms.

*Invalid atom ID in Fragments section of molecule file*
   Self-explanatory.

*Invalid atom ID in Impropers section of data file*
   Atom IDs must be positive integers and within range of defined
   atoms.
+23 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ templates include:
* :doc:`fix rigid/small <fix_rigid>`
* :doc:`fix shake <fix_shake>`
* :doc:`fix gcmc <fix_gcmc>`
* :doc:`fix bond/react <fix_bond_react>`
* :doc:`create_atoms <create_atoms>`
* :doc:`atom_style template <atom_style>`

@@ -144,6 +145,7 @@ appear if the value(s) are different than the default.
* Na *angles* = # of angles Na in molecule, default = 0
* Nd *dihedrals* = # of dihedrals Nd in molecule, default = 0
* Ni *impropers* = # of impropers Ni in molecule, default = 0
* Nf *fragments* = # of fragments in molecule, default = 0
* Mtotal *mass* = total mass of molecule
* Xc Yc Zc *com* = coordinates of center-of-mass of molecule
* Ixx Iyy Izz Ixy Ixz Iyz *inertia* = 6 components of inertia tensor of molecule
@@ -166,7 +168,7 @@ internally.

These are the allowed section keywords for the body of the file.

* *Coords, Types, Charges, Diameters, Masses* = atom-property sections
* *Coords, Types, Molecules, Fragments, Charges, Diameters, Masses* = atom-property sections
* *Bonds, Angles, Dihedrals, Impropers* = molecular topology sections
* *Special Bond Counts, Special Bonds* = special neighbor info
* *Shake Flags, Shake Atoms, Shake Bond Types* = SHAKE info
@@ -223,6 +225,26 @@ listed in order from 1 to Nlines, but LAMMPS does not check for this.

----------

*Molecules* section:

* one line per atom
* line syntax: ID molecule-ID
* molecule-ID = molecule ID of atom

----------

*Fragments* section:

* one line per fragment
* line syntax: ID a b c d ...
* a,b,c,d,... = IDs of atoms in fragment

The ID of a fragment can only contain alphanumeric characters and
underscores.  The atom IDs should be values from 1 to Natoms, where
Natoms = # of atoms in the molecule.

----------

*Charges* section:

* one line per atom
+14 −2
Original line number Diff line number Diff line
@@ -632,7 +632,13 @@ void FixPour::pre_exchange()
        int n = atom->nlocal - 1;
        atom->tag[n] = maxtag_all + m+1;
        if (mode == MOLECULE) {
          if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1;
          if (atom->molecule_flag) {
            if (onemols[imol]->moleculeflag) {
              atom->molecule[n] = maxmol_all + onemols[imol]->molecule[m];
            } else {
              atom->molecule[n] = maxmol_all+1;
            }
          }
          if (atom->molecular == 2) {
            atom->molindex[n] = 0;
            atom->molatom[n] = m;
@@ -666,7 +672,13 @@ void FixPour::pre_exchange()
      fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);

    maxtag_all += natom;
    if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
    if (mode == MOLECULE && atom->molecule_flag) {
      if (onemols[imol]->moleculeflag) {
        maxmol_all += onemols[imol]->nmolecules;
      } else {
        maxmol_all++;
      }
    }
  }

  // warn if not successful with all insertions b/c too many attempts
+14 −2
Original line number Diff line number Diff line
@@ -539,7 +539,13 @@ void FixDeposit::pre_exchange()
        n = atom->nlocal - 1;
        atom->tag[n] = maxtag_all + m+1;
        if (mode == MOLECULE) {
          if (atom->molecule_flag) atom->molecule[n] = maxmol_all+1;
          if (atom->molecule_flag) {
            if (onemols[imol]->moleculeflag) {
              atom->molecule[n] = maxmol_all + onemols[imol]->molecule[m];
            } else {
              atom->molecule[n] = maxmol_all+1;
            }
          }
          if (atom->molecular == 2) {
            atom->molindex[n] = 0;
            atom->molatom[n] = m;
@@ -603,7 +609,13 @@ void FixDeposit::pre_exchange()
    maxtag_all += natom;
    if (maxtag_all >= MAXTAGINT)
      error->all(FLERR,"New atom IDs exceed maximum allowed ID");
    if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
    if (mode == MOLECULE && atom->molecule_flag) {
      if (onemols[imol]->moleculeflag) {
        maxmol_all += onemols[imol]->nmolecules;
      } else {
        maxmol_all++;
      }
    }
    if (atom->map_style) {
      atom->map_init();
      atom->map_set();
+14 −1
Original line number Diff line number Diff line
@@ -490,7 +490,13 @@ void CreateAtoms::command(int narg, char **arg)
    for (int i = 0; i < molcreate; i++) {
      if (tag) offset = tag[ilocal]-1;
      for (int m = 0; m < natoms; m++) {
        if (molecule_flag) molecule[ilocal] = moloffset + i+1;
        if (molecule_flag) {
          if (onemol->moleculeflag) {
            molecule[ilocal] = moloffset + onemol->molecule[m];
          } else {
            molecule[ilocal] = moloffset + 1;
          }
        }
        if (molecular == 2) {
          atom->molindex[ilocal] = 0;
          atom->molatom[ilocal] = m;
@@ -524,6 +530,13 @@ void CreateAtoms::command(int narg, char **arg)
        }
        ilocal++;
      }
      if (molecule_flag) {
        if (onemol->moleculeflag) {
          moloffset += onemol->nmolecules;
        } else {
          moloffset++;
        }
      }
    }

    // perform irregular comm to migrate atoms to new owning procs
Loading