adding type,bond, etc offsets to molecule command

Hello LAMMPS,

Currently a molecule template must be modified for a particular simulation. To make these files more like a template, the atom, bond etc. type offsets could be inputted with the molecule command, such as:

molecule my_mol template_1 offset atom_offset bond_offset angle_offset dihedral_offset improper_offset

where offset is the optional keyword

e.g.

molecule my_mol template_1 offset 6 9 18 23 14

Please find the files attached. They are backwards compatible, and makes the atom type offset for create_atoms (molecule mode) obsolete.

The next iteration which might be handy for some people is an automatic offset option, adding to the current number of bonds, angles. etc.

Thanks,

Jake

PS. these were modified from a 18March_2015 download

atom.cpp (61.7 KB)

atom.h (13.1 KB)

molecule.cpp (43.3 KB)

molecule.h (7.59 KB)

Sounds interesting. Can you also provide updated doc/*.txt

files so I can understand how it is used and what it is designed

to do?

Steve

Please find the doc file attached.

Thanks,

Jake

molecule.txt (15.1 KB)

atom.cpp (61.7 KB)

atom.h (13.1 KB)

molecule.cpp (43.3 KB)

molecule.h (7.59 KB)

Hey Steve,

I have added another option to the molecule command. This is the an optional ‘autospecial’ keyword which automatically creates the special and nspecial arrays based on connectivity (with no Special Bonds sections). This makes the molecule template feature more accessible to people like me who create templates the same way they create data files. I imagine this would make the Special Bond Counts and Special Bonds section of the molecule template obsolete. If so, the ‘autospecial’ keyword could just work behind the scenes whenever a ‘Bonds’ section is specified.

Thanks,

Jake

PS. i added this onto my previous ‘offset’ modification

atom.cpp (61.8 KB)

atom.h (13.1 KB)

molecule.cpp (46 KB)

molecule.h (7.62 KB)

PS. The autospecial option currently crashes without explanation when adding a molecule to an empty box without enough extra/special/per/atom defined, so I have added an error message to alert the user