Merge pull request #2467 from jrgissing/bond/react-delete_atoms_bugfix
Bond/react: molecule keyword + bugfixes
This commit is contained in:
@ -35,8 +35,8 @@ Syntax
|
|||||||
* react-ID = user-assigned name for the reaction
|
* react-ID = user-assigned name for the reaction
|
||||||
* react-group-ID = only atoms in this group are considered for the reaction
|
* react-group-ID = only atoms in this group are considered for the reaction
|
||||||
* Nevery = attempt reaction every this many steps
|
* Nevery = attempt reaction every this many steps
|
||||||
* Rmin = bonding pair atoms must be separated by more than Rmin to initiate reaction (distance units)
|
* Rmin = initiator atoms must be separated by more than Rmin to initiate reaction (distance units)
|
||||||
* Rmax = bonding pair atoms must be separated by less than Rmax to initiate reaction (distance units)
|
* Rmax = initiator atoms must be separated by less than Rmax to initiate reaction (distance units)
|
||||||
* template-ID(pre-reacted) = ID of a molecule template containing pre-reaction topology
|
* template-ID(pre-reacted) = ID of a molecule template containing pre-reaction topology
|
||||||
* template-ID(post-reacted) = ID of a molecule template containing post-reaction topology
|
* template-ID(post-reacted) = ID of a molecule template containing post-reaction topology
|
||||||
* map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates
|
* map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates
|
||||||
@ -55,6 +55,10 @@ Syntax
|
|||||||
*custom_charges* value = *no* or *fragmentID*
|
*custom_charges* value = *no* or *fragmentID*
|
||||||
no = update all atomic charges (default)
|
no = update all atomic charges (default)
|
||||||
fragmentID = ID of molecule fragment whose charges are updated
|
fragmentID = ID of molecule fragment whose charges are updated
|
||||||
|
*molecule* value = *off* or *inter* or *intra*
|
||||||
|
off = allow both inter- and intramolecular reactions (default)
|
||||||
|
inter = search for reactions between molecules with different IDs
|
||||||
|
intra = search for reactions within the same molecule
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
""""""""
|
""""""""
|
||||||
@ -172,8 +176,8 @@ timesteps. *Nevery* can be specified with an equal-style
|
|||||||
integer.
|
integer.
|
||||||
|
|
||||||
Three physical conditions must be met for a reaction to occur. First,
|
Three physical conditions must be met for a reaction to occur. First,
|
||||||
a bonding atom pair must be identified within the reaction distance
|
an initiator atom pair must be identified within the reaction distance
|
||||||
cutoffs. Second, the topology surrounding the bonding atom pair must
|
cutoffs. Second, the topology surrounding the initiator atom pair must
|
||||||
match the topology of the pre-reaction template. Only atom types and
|
match the topology of the pre-reaction template. Only atom types and
|
||||||
bond connectivity are used to identify a valid reaction site (not bond
|
bond connectivity are used to identify a valid reaction site (not bond
|
||||||
types, etc.). Finally, any reaction constraints listed in the map file
|
types, etc.). Finally, any reaction constraints listed in the map file
|
||||||
@ -181,10 +185,10 @@ types, etc.). Finally, any reaction constraints listed in the map file
|
|||||||
reaction site is eligible to be modified to match the post-reaction
|
reaction site is eligible to be modified to match the post-reaction
|
||||||
template.
|
template.
|
||||||
|
|
||||||
A bonding atom pair will be identified if several conditions are met.
|
An initiator atom pair will be identified if several conditions are
|
||||||
First, a pair of atoms I,J within the specified react-group-ID of type
|
met. First, a pair of atoms I,J within the specified react-group-ID of
|
||||||
itype and jtype must be separated by a distance between *Rmin* and
|
type itype and jtype must be separated by a distance between *Rmin*
|
||||||
*Rmax*\ . *Rmin* and *Rmax* can be specified with equal-style
|
and *Rmax*\ . *Rmin* and *Rmax* can be specified with equal-style
|
||||||
:doc:`variables <variable>`. For example, these reaction cutoffs can
|
:doc:`variables <variable>`. For example, these reaction cutoffs can
|
||||||
be a function of the reaction conversion using the following commands:
|
be a function of the reaction conversion using the following commands:
|
||||||
|
|
||||||
@ -194,20 +198,20 @@ be a function of the reaction conversion using the following commands:
|
|||||||
fix myrxn all bond/react react myrxn1 all 1 0 v_rmax mol1 mol2 map_file.txt
|
fix myrxn all bond/react react myrxn1 all 1 0 v_rmax mol1 mol2 map_file.txt
|
||||||
variable rmax equal 3+f_myrxn[1]/100 # arbitrary function of reaction count
|
variable rmax equal 3+f_myrxn[1]/100 # arbitrary function of reaction count
|
||||||
|
|
||||||
The following criteria are used if multiple candidate bonding atom
|
The following criteria are used if multiple candidate initiator atom
|
||||||
pairs are identified within the cutoff distance: 1) If the bonding
|
pairs are identified within the cutoff distance: 1) If the initiator
|
||||||
atoms in the pre-reaction template are not 1-2 neighbors (i.e. not
|
atoms in the pre-reaction template are not 1-2 neighbors (i.e. not
|
||||||
directly bonded) the closest potential partner is chosen. 2)
|
directly bonded) the closest potential partner is chosen. 2)
|
||||||
Otherwise, if the bonding atoms in the pre-reaction template are 1-2
|
Otherwise, if the initiator atoms in the pre-reaction template are 1-2
|
||||||
neighbors (i.e. directly bonded) the farthest potential partner is
|
neighbors (i.e. directly bonded) the farthest potential partner is
|
||||||
chosen. 3) Then, if both an atom I and atom J have each other as their
|
chosen. 3) Then, if both an atom I and atom J have each other as their
|
||||||
bonding partners, these two atoms are identified as the bonding atom
|
initiator partners, these two atoms are identified as the initiator
|
||||||
pair of the reaction site. Note that it can be helpful to select
|
atom pair of the reaction site. Note that it can be helpful to select
|
||||||
unique atom types for the bonding atoms: if a bonding atom pair is
|
unique atom types for the initiator atoms: if an initiator atom pair
|
||||||
identified, as described in the previous steps, but does not
|
is identified, as described in the previous steps, but does not
|
||||||
correspond to the same pair specified in the pre-reaction template, an
|
correspond to the same pair specified in the pre-reaction template, an
|
||||||
otherwise eligible reaction could be prevented from occurring. Once
|
otherwise eligible reaction could be prevented from occurring. Once
|
||||||
this unique bonding atom pair is identified for each reaction, there
|
this unique initiator atom pair is identified for each reaction, there
|
||||||
could be two or more reactions that involve the same atom on the same
|
could be two or more reactions that involve the same atom on the same
|
||||||
timestep. If this is the case, only one such reaction is permitted to
|
timestep. If this is the case, only one such reaction is permitted to
|
||||||
occur. This reaction is chosen randomly from all potential reactions
|
occur. This reaction is chosen randomly from all potential reactions
|
||||||
@ -217,7 +221,7 @@ with user-specified probabilities.
|
|||||||
|
|
||||||
The pre-reacted molecule template is specified by a molecule command.
|
The pre-reacted molecule template is specified by a molecule command.
|
||||||
This molecule template file contains a sample reaction site and its
|
This molecule template file contains a sample reaction site and its
|
||||||
surrounding topology. As described below, the bonding atom pairs of
|
surrounding topology. As described below, the initiator atom pairs of
|
||||||
the pre-reacted template are specified by atom ID in the map file. The
|
the pre-reacted template are specified by atom ID in the map file. The
|
||||||
pre-reacted molecule template should contain as few atoms as possible
|
pre-reacted molecule template should contain as few atoms as possible
|
||||||
while still completely describing the topology of all atoms affected
|
while still completely describing the topology of all atoms affected
|
||||||
@ -231,18 +235,18 @@ missing topology with respect to the simulation. For example, the
|
|||||||
pre-reacted template may contain an atom that, in the simulation, is
|
pre-reacted template may contain an atom that, in the simulation, is
|
||||||
currently connected to the rest of a long polymer chain. These are
|
currently connected to the rest of a long polymer chain. These are
|
||||||
referred to as edge atoms, and are also specified in the map file. All
|
referred to as edge atoms, and are also specified in the map file. All
|
||||||
pre-reaction template atoms should be linked to a bonding atom, via at
|
pre-reaction template atoms should be linked to an initiator atom, via
|
||||||
least one path that does not involve edge atoms. When the pre-reaction
|
at least one path that does not involve edge atoms. When the
|
||||||
template contains edge atoms, not all atoms, bonds, charges, etc.
|
pre-reaction template contains edge atoms, not all atoms, bonds,
|
||||||
specified in the reaction templates will be updated. Specifically,
|
charges, etc. specified in the reaction templates will be updated.
|
||||||
topology that involves only atoms that are 'too near' to template
|
Specifically, topology that involves only atoms that are 'too near' to
|
||||||
edges will not be updated. The definition of 'too near the edge'
|
template edges will not be updated. The definition of 'too near the
|
||||||
depends on which interactions are defined in the simulation. If the
|
edge' depends on which interactions are defined in the simulation. If
|
||||||
simulation has defined dihedrals, atoms within two bonds of edge atoms
|
the simulation has defined dihedrals, atoms within two bonds of edge
|
||||||
are considered 'too near the edge.' If the simulation defines angles,
|
atoms are considered 'too near the edge.' If the simulation defines
|
||||||
but not dihedrals, atoms within one bond of edge atoms are considered
|
angles, but not dihedrals, atoms within one bond of edge atoms are
|
||||||
'too near the edge.' If just bonds are defined, only edge atoms are
|
considered 'too near the edge.' If just bonds are defined, only edge
|
||||||
considered 'too near the edge.'
|
atoms are considered 'too near the edge.'
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@ -298,23 +302,23 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and
|
|||||||
|
|
||||||
The body of the map file contains two mandatory sections and four
|
The body of the map file contains two mandatory sections and four
|
||||||
optional sections. The first mandatory section begins with the keyword
|
optional sections. The first mandatory section begins with the keyword
|
||||||
'BondingIDs' and lists the atom IDs of the bonding atom pair in the
|
'InitiatorIDs' and lists the two atom IDs of the initiator atom pair
|
||||||
pre-reacted molecule template. The second mandatory section begins
|
in the pre-reacted molecule template. The second mandatory section
|
||||||
with the keyword 'Equivalences' and lists a one-to-one correspondence
|
begins with the keyword 'Equivalences' and lists a one-to-one
|
||||||
between atom IDs of the pre- and post-reacted templates. The first
|
correspondence between atom IDs of the pre- and post-reacted
|
||||||
column is an atom ID of the pre-reacted molecule template, and the
|
templates. The first column is an atom ID of the pre-reacted molecule
|
||||||
second column is the corresponding atom ID of the post-reacted
|
template, and the second column is the corresponding atom ID of the
|
||||||
molecule template. The first optional section begins with the keyword
|
post-reacted molecule template. The first optional section begins with
|
||||||
'EdgeIDs' and lists the atom IDs of edge atoms in the pre-reacted
|
the keyword 'EdgeIDs' and lists the atom IDs of edge atoms in the
|
||||||
molecule template. The second optional section begins with the keyword
|
pre-reacted molecule template. The second optional section begins with
|
||||||
'DeleteIDs' and lists the atom IDs of pre-reaction template atoms to
|
the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction
|
||||||
delete. The third optional section begins with the keyword 'ChiralIDs'
|
template atoms to delete. The third optional section begins with the
|
||||||
lists the atom IDs of chiral atoms whose handedness should be
|
keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose
|
||||||
enforced. The fourth optional section begins with the keyword
|
handedness should be enforced. The fourth optional section begins with
|
||||||
'Constraints' and lists additional criteria that must be satisfied in
|
the keyword 'Constraints' and lists additional criteria that must be
|
||||||
order for the reaction to occur. Currently, there are five types of
|
satisfied in order for the reaction to occur. Currently, there are
|
||||||
constraints available, as discussed below: 'distance', 'angle',
|
five types of constraints available, as discussed below: 'distance',
|
||||||
'dihedral', 'arrhenius', and 'rmsd'.
|
'angle', 'dihedral', 'arrhenius', and 'rmsd'.
|
||||||
|
|
||||||
A sample map file is given below:
|
A sample map file is given below:
|
||||||
|
|
||||||
@ -327,7 +331,7 @@ A sample map file is given below:
|
|||||||
7 equivalences
|
7 equivalences
|
||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
3
|
3
|
||||||
5
|
5
|
||||||
@ -462,7 +466,7 @@ A few capabilities to note: 1) You may specify as many *react*
|
|||||||
arguments as desired. For example, you could break down a complicated
|
arguments as desired. For example, you could break down a complicated
|
||||||
reaction mechanism into several reaction steps, each defined by its
|
reaction mechanism into several reaction steps, each defined by its
|
||||||
own *react* argument. 2) While typically a bond is formed or removed
|
own *react* argument. 2) While typically a bond is formed or removed
|
||||||
between the bonding atom pairs specified in the pre-reacted molecule
|
between the initiator atoms specified in the pre-reacted molecule
|
||||||
template, this is not required. 3) By reversing the order of the pre-
|
template, this is not required. 3) By reversing the order of the pre-
|
||||||
and post- reacted molecule templates in another *react* argument, you
|
and post- reacted molecule templates in another *react* argument, you
|
||||||
can allow for the possibility of one or more reverse reactions.
|
can allow for the possibility of one or more reverse reactions.
|
||||||
@ -491,12 +495,20 @@ situations, decreasing rather than increasing this parameter will
|
|||||||
result in an increase in stability.
|
result in an increase in stability.
|
||||||
|
|
||||||
The *custom_charges* keyword can be used to specify which atoms'
|
The *custom_charges* keyword can be used to specify which atoms'
|
||||||
atomic charges are updated. When the value is set to 'no,' all atomic
|
atomic charges are updated. When the value is set to 'no', all atomic
|
||||||
charges are updated to those specified by the post-reaction template
|
charges are updated to those specified by the post-reaction template
|
||||||
(default). Otherwise, the value should be the name of a molecule
|
(default). Otherwise, the value should be the name of a molecule
|
||||||
fragment defined in the pre-reaction molecule template. In this case,
|
fragment defined in the pre-reaction molecule template. In this case,
|
||||||
only the atomic charges of atoms in the molecule fragment are updated.
|
only the atomic charges of atoms in the molecule fragment are updated.
|
||||||
|
|
||||||
|
The *molecule* keyword can be used to force the reaction to be
|
||||||
|
intermolecular, intramolecular or either. When the value is set to
|
||||||
|
'off', molecule IDs are not considered when searching for reactions
|
||||||
|
(default). When the value is set to 'inter', the initiator atoms must
|
||||||
|
have different molecule IDs in order to be considered for the
|
||||||
|
reaction. When the value is set to 'intra', only initiator atoms with
|
||||||
|
the same molecule ID are considered for the reaction.
|
||||||
|
|
||||||
A few other considerations:
|
A few other considerations:
|
||||||
|
|
||||||
Many reactions result in one or more atoms that are considered
|
Many reactions result in one or more atoms that are considered
|
||||||
@ -558,7 +570,7 @@ These is 1 quantity for each react argument:
|
|||||||
No parameter of this fix can be used with the *start/stop* keywords
|
No parameter of this fix can be used with the *start/stop* keywords
|
||||||
of the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
of the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||||
|
|
||||||
When fix bond/react is 'unfixed,' all internally-created groups are
|
When fix bond/react is 'unfixed', all internally-created groups are
|
||||||
deleted. Therefore, fix bond/react can only be unfixed after unfixing
|
deleted. Therefore, fix bond/react can only be unfixed after unfixing
|
||||||
all other fixes that use any group created by fix bond/react.
|
all other fixes that use any group created by fix bond/react.
|
||||||
|
|
||||||
@ -581,10 +593,14 @@ Default
|
|||||||
"""""""
|
"""""""
|
||||||
|
|
||||||
The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60,
|
The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60,
|
||||||
reset_mol_ids = yes, custom_charges = no
|
reset_mol_ids = yes, custom_charges = no, molecule = off
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _Gissinger:
|
.. _Gissinger:
|
||||||
|
|
||||||
**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211 (2017).
|
**(Gissinger)** Gissinger, Jensen and Wise, Polymer, 128, 211 (2017).
|
||||||
|
|
||||||
|
.. _Gissinger2020:
|
||||||
|
|
||||||
|
**(Gissinger)** Gissinger, Jensen and Wise, Macromolecules (2020, in press).
|
||||||
|
|||||||
@ -279,7 +279,6 @@ Boltzman
|
|||||||
BondAngle
|
BondAngle
|
||||||
BondBond
|
BondBond
|
||||||
bondchk
|
bondchk
|
||||||
BondingIDs
|
|
||||||
bondmax
|
bondmax
|
||||||
bondtype
|
bondtype
|
||||||
Bonet
|
Bonet
|
||||||
@ -1329,6 +1328,7 @@ inhomogeneous
|
|||||||
init
|
init
|
||||||
initialdelay
|
initialdelay
|
||||||
initializations
|
initializations
|
||||||
|
InitiatorIDs
|
||||||
initio
|
initio
|
||||||
InP
|
InP
|
||||||
inregion
|
inregion
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a nominal superimpose file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
18 equivalences
|
18 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
10
|
10
|
||||||
1
|
1
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a nominal superimpose file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
15 equivalences
|
15 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
4
|
4
|
||||||
12
|
12
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a map file
|
|||||||
1 edgeIDs
|
1 edgeIDs
|
||||||
31 equivalences
|
31 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
15
|
15
|
||||||
1
|
1
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a map file
|
|||||||
1 edgeIDs
|
1 edgeIDs
|
||||||
31 equivalences
|
31 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
4
|
4
|
||||||
25
|
25
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a map file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
42 equivalences
|
42 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
15
|
15
|
||||||
32
|
32
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a map file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
42 equivalences
|
42 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
35
|
35
|
||||||
24
|
24
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a nominal superimpose file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
18 equivalences
|
18 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
10
|
10
|
||||||
1
|
1
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a nominal superimpose file
|
|||||||
2 edgeIDs
|
2 edgeIDs
|
||||||
15 equivalences
|
15 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
4
|
4
|
||||||
12
|
12
|
||||||
|
|||||||
@ -3,7 +3,7 @@ this is a map file
|
|||||||
0 edgeIDs
|
0 edgeIDs
|
||||||
32 equivalences
|
32 equivalences
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
4
|
4
|
||||||
30
|
30
|
||||||
|
|||||||
@ -8,7 +8,7 @@ EdgeIDs
|
|||||||
17
|
17
|
||||||
34
|
34
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
14
|
14
|
||||||
38
|
38
|
||||||
|
|||||||
@ -7,7 +7,7 @@ EdgeIDs
|
|||||||
|
|
||||||
30
|
30
|
||||||
|
|
||||||
BondingIDs
|
InitiatorIDs
|
||||||
|
|
||||||
14
|
14
|
||||||
34
|
34
|
||||||
|
|||||||
@ -85,6 +85,9 @@ enum{DISTANCE,ANGLE,DIHEDRAL,ARRHENIUS,RMSD};
|
|||||||
// keyword values that accept variables as input
|
// keyword values that accept variables as input
|
||||||
enum{NEVERY,RMIN,RMAX,PROB};
|
enum{NEVERY,RMIN,RMAX,PROB};
|
||||||
|
|
||||||
|
// values for molecule_keyword
|
||||||
|
enum{OFF,INTER,INTRA};
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
||||||
@ -202,6 +205,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
memory->create(limit_duration,nreacts,"bond/react:limit_duration");
|
memory->create(limit_duration,nreacts,"bond/react:limit_duration");
|
||||||
memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag");
|
memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag");
|
||||||
memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid");
|
memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid");
|
||||||
|
memory->create(molecule_keyword,nreacts,"bond/react:molecule_keyword");
|
||||||
memory->create(constraints,1,MAXCONARGS,"bond/react:constraints");
|
memory->create(constraints,1,MAXCONARGS,"bond/react:constraints");
|
||||||
memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag");
|
memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag");
|
||||||
memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id");
|
memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id");
|
||||||
@ -222,6 +226,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
max_rxn[i] = INT_MAX;
|
max_rxn[i] = INT_MAX;
|
||||||
stabilize_steps_flag[i] = 0;
|
stabilize_steps_flag[i] = 0;
|
||||||
custom_charges_fragid[i] = -1;
|
custom_charges_fragid[i] = -1;
|
||||||
|
molecule_keyword[i] = OFF;
|
||||||
// set default limit duration to 60 timesteps
|
// set default limit duration to 60 timesteps
|
||||||
limit_duration[i] = 60;
|
limit_duration[i] = 60;
|
||||||
reaction_count[i] = 0;
|
reaction_count[i] = 0;
|
||||||
@ -377,6 +382,14 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
"'custom_charges' keyword does not exist");
|
"'custom_charges' keyword does not exist");
|
||||||
}
|
}
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
} else if (strcmp(arg[iarg],"molecule") == 0) {
|
||||||
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: "
|
||||||
|
"'molecule' has too few arguments");
|
||||||
|
if (strcmp(arg[iarg+1],"off") == 0) molecule_keyword[rxn] = OFF; //default
|
||||||
|
else if (strcmp(arg[iarg+1],"inter") == 0) molecule_keyword[rxn] = INTER;
|
||||||
|
else if (strcmp(arg[iarg+1],"intra") == 0) molecule_keyword[rxn] = INTRA;
|
||||||
|
else error->one(FLERR,"Bond/react: Illegal option for 'molecule' keyword");
|
||||||
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix bond/react command: unknown keyword");
|
} else error->all(FLERR,"Illegal fix bond/react command: unknown keyword");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -548,6 +561,7 @@ FixBondReact::~FixBondReact()
|
|||||||
memory->destroy(var_id);
|
memory->destroy(var_id);
|
||||||
memory->destroy(stabilize_steps_flag);
|
memory->destroy(stabilize_steps_flag);
|
||||||
memory->destroy(custom_charges_fragid);
|
memory->destroy(custom_charges_fragid);
|
||||||
|
memory->destroy(molecule_keyword);
|
||||||
|
|
||||||
memory->destroy(iatomtype);
|
memory->destroy(iatomtype);
|
||||||
memory->destroy(jatomtype);
|
memory->destroy(jatomtype);
|
||||||
@ -750,11 +764,12 @@ void FixBondReact::init()
|
|||||||
if (strstr(update->integrate_style,"respa"))
|
if (strstr(update->integrate_style,"respa"))
|
||||||
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||||
|
|
||||||
// check cutoff for iatomtype,jatomtype
|
// check cutoff for iatomtype,jatomtype
|
||||||
for (int i = 0; i < nreacts; i++) {
|
for (int i = 0; i < nreacts; i++) {
|
||||||
if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]])
|
if (closeneigh[i] == -1) // indicates will search for non-bonded bonding atoms
|
||||||
error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff");
|
if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]])
|
||||||
}
|
error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff");
|
||||||
|
}
|
||||||
|
|
||||||
// need a half neighbor list, built every Nevery steps
|
// need a half neighbor list, built every Nevery steps
|
||||||
int irequest = neighbor->request(this,instance_me);
|
int irequest = neighbor->request(this,instance_me);
|
||||||
@ -1053,6 +1068,11 @@ void FixBondReact::far_partner()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (molecule_keyword[rxnID] == INTER)
|
||||||
|
if (atom->molecule[i] == atom->molecule[j]) continue;
|
||||||
|
else if (molecule_keyword[rxnID] == INTRA)
|
||||||
|
if (atom->molecule[i] != atom->molecule[j]) continue;
|
||||||
|
|
||||||
jtype = type[j];
|
jtype = type[j];
|
||||||
possible = 0;
|
possible = 0;
|
||||||
if (itype == iatomtype[rxnID] && jtype == jatomtype[rxnID]) {
|
if (itype == iatomtype[rxnID] && jtype == jatomtype[rxnID]) {
|
||||||
@ -1132,6 +1152,11 @@ void FixBondReact::close_partner()
|
|||||||
if (i_limit_tags[i2] != 0) continue;
|
if (i_limit_tags[i2] != 0) continue;
|
||||||
if (itype != iatomtype[rxnID] || jtype != jatomtype[rxnID]) continue;
|
if (itype != iatomtype[rxnID] || jtype != jatomtype[rxnID]) continue;
|
||||||
|
|
||||||
|
if (molecule_keyword[rxnID] == INTER)
|
||||||
|
if (atom->molecule[i1] == atom->molecule[i2]) continue;
|
||||||
|
else if (molecule_keyword[rxnID] == INTRA)
|
||||||
|
if (atom->molecule[i1] != atom->molecule[i2]) continue;
|
||||||
|
|
||||||
delx = x[i1][0] - x[i2][0];
|
delx = x[i1][0] - x[i2][0];
|
||||||
dely = x[i1][1] - x[i2][1];
|
dely = x[i1][1] - x[i2][1];
|
||||||
delz = x[i1][2] - x[i2][2];
|
delz = x[i1][2] - x[i2][2];
|
||||||
@ -1203,7 +1228,7 @@ void FixBondReact::superimpose_algorithm()
|
|||||||
memory->create(glove,max_natoms,2,"bond/react:glove");
|
memory->create(glove,max_natoms,2,"bond/react:glove");
|
||||||
memory->create(restore_pt,MAXGUESS,4,"bond/react:restore_pt");
|
memory->create(restore_pt,MAXGUESS,4,"bond/react:restore_pt");
|
||||||
memory->create(pioneers,max_natoms,"bond/react:pioneers");
|
memory->create(pioneers,max_natoms,"bond/react:pioneers");
|
||||||
memory->create(restore,max_natoms,MAXGUESS,"bond/react:restore");
|
memory->create(restore,max_natoms,MAXGUESS*4,"bond/react:restore");
|
||||||
memory->create(local_mega_glove,max_natoms+1,allncreate,"bond/react:local_mega_glove");
|
memory->create(local_mega_glove,max_natoms+1,allncreate,"bond/react:local_mega_glove");
|
||||||
memory->create(ghostly_mega_glove,max_natoms+1,allncreate,"bond/react:ghostly_mega_glove");
|
memory->create(ghostly_mega_glove,max_natoms+1,allncreate,"bond/react:ghostly_mega_glove");
|
||||||
|
|
||||||
@ -1304,7 +1329,9 @@ void FixBondReact::superimpose_algorithm()
|
|||||||
// let's go ahead and catch the simplest of hangs
|
// let's go ahead and catch the simplest of hangs
|
||||||
//if (hang_catch > onemol->natoms*4)
|
//if (hang_catch > onemol->natoms*4)
|
||||||
if (hang_catch > atom->nlocal*30) {
|
if (hang_catch > atom->nlocal*30) {
|
||||||
error->one(FLERR,"Bond/react: Excessive iteration of superimpose algorithm");
|
error->one(FLERR,"Bond/react: Excessive iteration of superimpose algorithm. "
|
||||||
|
"Please check that all pre-reaction template atoms are linked to an initiator atom, "
|
||||||
|
"via at least one path that does not involve edge atoms.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1718,6 +1745,17 @@ void FixBondReact::ring_check()
|
|||||||
// ring_check can be made more efficient by re-introducing 'frozen' atoms
|
// ring_check can be made more efficient by re-introducing 'frozen' atoms
|
||||||
// 'frozen' atoms have been assigned and also are no longer pioneers
|
// 'frozen' atoms have been assigned and also are no longer pioneers
|
||||||
|
|
||||||
|
// double check the number of neighbors match for all non-edge atoms
|
||||||
|
// otherwise, atoms at 'end' of symmetric ring can behave like edge atoms
|
||||||
|
for (int i = 0; i < onemol->natoms; i++) {
|
||||||
|
if (edge[i][rxnID] == 0) {
|
||||||
|
if (onemol_nxspecial[i][0] != nxspecial[atom->map(glove[i][1])][0]) {
|
||||||
|
status = GUESSFAIL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < onemol->natoms; i++) {
|
for (int i = 0; i < onemol->natoms; i++) {
|
||||||
for (int j = 0; j < onemol_nxspecial[i][0]; j++) {
|
for (int j = 0; j < onemol_nxspecial[i][0]; j++) {
|
||||||
int ring_fail = 1;
|
int ring_fail = 1;
|
||||||
@ -3131,6 +3169,12 @@ void FixBondReact::update_everything()
|
|||||||
int Tdelta_imprp;
|
int Tdelta_imprp;
|
||||||
MPI_Allreduce(&delta_imprp,&Tdelta_imprp,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&delta_imprp,&Tdelta_imprp,1,MPI_INT,MPI_SUM,world);
|
||||||
atom->nimpropers += Tdelta_imprp;
|
atom->nimpropers += Tdelta_imprp;
|
||||||
|
|
||||||
|
if (ndel && (atom->map_style != Atom::MAP_NONE)) {
|
||||||
|
atom->nghost = 0;
|
||||||
|
atom->map_init();
|
||||||
|
atom->map_set();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
@ -3184,7 +3228,9 @@ void FixBondReact::read(int myrxn)
|
|||||||
|
|
||||||
int equivflag = 0, bondflag = 0;
|
int equivflag = 0, bondflag = 0;
|
||||||
while (strlen(keyword)) {
|
while (strlen(keyword)) {
|
||||||
if (strcmp(keyword,"BondingIDs") == 0) {
|
if (strcmp(keyword,"InitiatorIDs") == 0 || strcmp(keyword,"BondingIDs") == 0) {
|
||||||
|
if (strcmp(keyword,"BondingIDs") == 0)
|
||||||
|
if (me == 0) error->warning(FLERR,"Bond/react: The BondingIDs section title has been deprecated. Please use InitiatorIDs instead.");
|
||||||
bondflag = 1;
|
bondflag = 1;
|
||||||
readline(line);
|
readline(line);
|
||||||
sscanf(line,"%d",&ibonding[myrxn]);
|
sscanf(line,"%d",&ibonding[myrxn]);
|
||||||
@ -3213,7 +3259,7 @@ void FixBondReact::read(int myrxn)
|
|||||||
|
|
||||||
// error check
|
// error check
|
||||||
if (bondflag == 0 || equivflag == 0)
|
if (bondflag == 0 || equivflag == 0)
|
||||||
error->all(FLERR,"Bond/react: Map file missing BondingIDs or Equivalences section\n");
|
error->all(FLERR,"Bond/react: Map file missing InitiatorIDs or Equivalences section\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixBondReact::EdgeIDs(char *line, int myrxn)
|
void FixBondReact::EdgeIDs(char *line, int myrxn)
|
||||||
|
|||||||
@ -65,6 +65,7 @@ class FixBondReact : public Fix {
|
|||||||
int custom_exclude_flag;
|
int custom_exclude_flag;
|
||||||
int *stabilize_steps_flag;
|
int *stabilize_steps_flag;
|
||||||
int *custom_charges_fragid;
|
int *custom_charges_fragid;
|
||||||
|
int *molecule_keyword;
|
||||||
int nconstraints;
|
int nconstraints;
|
||||||
int narrhenius;
|
int narrhenius;
|
||||||
double **constraints;
|
double **constraints;
|
||||||
|
|||||||
Reference in New Issue
Block a user