Suppose I want to modify "fix_bond_break.cpp" so that whenever a bond
is broken, both atoms from the bond are also changed to atom type 2
(for example). How would I go about this?
--- Goal ----
Actually, I have already written a much more general fix (based on
"fix_bond_break.cpp") which allows LAMMPS users to simulate
"intelligent molecules". These molecules can make or break bonds and
make arbitrarily complex decisions to alter their properties in
response to contact with other molecules. (Essentially, this fix
allows LAMMPS users to run arbitrary cellular automaton on networks of
bonded atoms. There's a Conway's game of life example which uses this
The reason we created this fix was to study coarse-grained machines in
cells which are driven out of equilibrium and exhibit complex behavior
(such as microtubules which are dynamically unstable, as well as
proteins which read and walk along DNA controlling gene expression and
cell fate). Because the fix is general, the hope is that anybody
could use it to model new biomolecules we don't understand yet. We
want to eventually get many biologists interested in using LAMMPS.
Alas, I have not released this fix because when I run it in parallel,
it crashes, (unsurprisingly). But it only seems to crash when I ask
it to alter the atom types. Rather than post that code, just knowing
the answer to the question above would be incredibly useful.
Thanks to everyone who read this far.
P.S. We are currently writing a paper on this, in case anyone wants be
part of that. Help on this issue would definitely earn authorship.
P.P.S. More specific questions (feel free to ignore these):
1) I'm curious: Is it a problem to change the atom types from within
FixBondBreak::post_integrate()? (I ask because I noticed that
"fix_atom_swap.cpp" places the code that changes the atom types inside
2) Is there anything else I have to do after changing the atom types
besides invoke comm->forward_comm_fix() and update
"un/pack_forward_comm()"? (To make it easier, let's assume, for the
moment, that the distance c.utoff is the same for all atoms types.
I'll worry about that issue later.)