Another thing to keep in mind that if the two data files contain
different types of molecules, AND if you use pair_coeff, bond_coeff,
angle_coeff, dihedral_coeff, and improper_coeff commands in an INPUT
script (instead of putting the force-field information in the DATA
file), then you will have to modify the atom-type, bond-type,
angle-type, dihedral-type, and improper-type number which appear in
these commands.
If the two data files contain completely different kinds of
molecules with no overlap, then you can use the LAMMPS read_data
command with the add, offset, shift, extra, keywords.
The difficult case is when the two data files share some (but not
all) of the bond, angle, dihedral, and improper types. (Such as would
be the case when the two data files have some molecules or chemical
groups in common.)
Andrew
P.S.
If your data files do contain overlapping atom, bond, or angle
types, etc..., the conventional way to overcome this problem would be
to manually extract the text from the Angles, Dihedrals, and Improper
sections of the second data file, and carefully change some of the
numbers in the second column of these sections so that they are
compatible. (I suggest using "awk", writing your own simple script,
or using a spreadsheet.) You can probably fix these issues in
topotools as well, and there are other ways to do this.
--- moltemplate ---
Alternately, the "moltemplate" program has a simple way to get
around these problems. (Please download the newest version from
www.moltemplate.org. I apologize in advance. Nearly all of my posts
here somehow seem to end up being advertisements for my "moltemplate"
program. However in the process of replying to your post, I
discovered and fixed a new moltemplate bug today, so I guess it's a
good thing.)
Anyway, suppose you have two data files "file1.data", and
"file2.data", and two input scripts ("file1.in", and "file2.in")
ltemplify.py -name Subsystem1 file1.in file1.data > file1.lt
ltemplify.py -name Subsystem2 file2.in file2.data > file2.lt
Comment: As you can see from the example, you need to supply a
LAMMPS input script(s). The input script should contain an
"atom_style" command which tells "ltemplify.py" how to interpret your
LAMMPS data file. It's okay if it contains only one line:
atom_style full
If you don't have any input scripts, then just create a new file and
put that line in it.
(If your input script also contains "pair_coeff", "bond_coeff",
"angle_coeff", etc... commands for your molecules, then the
"ltemplify.py" will keep track of them, and convert the
atom,bond,angle,... type numbers accordingly, making sure they don't
overlap, etc...)
Then create a new file "system.lt"
--- system.lt ---
import file1.lt
import file2.lt
subsystem1 = new Subsystem1
subsystem2 = new Subsystem2.move(0,0,50.0)
# The .move() and .rot() commands are useful to prevent overlap
--- end of system.lt ---
Finally run moltemplate
moltemplate system.lt
or
moltemplate system.lt -vmd # this will display your new system
By default, this will create a new data file named "system.data" where
every atom-type, bond-type, angle-type, dihedral-type, and
improper-type is unique.
Atom types, dihedral types and improper types, will appear in your
file1.lt and file2.lt files as:
@atom:type7
@dihedral:type47
@improper:type13
Now if you want several of the atom types (or angle types), etc to be
shared between the same molecules, (for example "@atom:type7" from
"file1.lt" and "@atom:3" from "file2.lt", corresponding to atom types
7 and 3 from your original file1.data and file2.data files)... THEN
you would replace these with something like:
@atom:../shared_type1
Do this replacement everywhere that "@atom:type7" appears in
"file1.lt" and "@atom:type3" appears in "file2.lt". (You can have
multiple shared atom types. Just make sure they have unique names,
and they are preceeded by "../") Similarly, for angle-types,
bond-types, dihedral_types and improper types use something like this:
@bond:../shared_type1
@angle:../shared_type1
@dihedral:../shared_type1
@improper:../shared_type1
Final comment:
By default, moltemplate will put all of your force-field information
in a lammps input script file named "system.in.settings". If you
prefer to keep all the force-field information in your DATA file
("Coeffs" sections), then run ltemplify.py this way:
ltemplify.py -datacoeffs -name Subsystem1 file1.in file1.data > file1.lt
ltemplify.py -datacoeffs -name Subsystem2 file2.in file2.data > file2.lt
Cheers
Andrew
If you need more information, Appendix B of the moltemplate manual
explains all the boring details regarding how to use ltemplify.py
http://moltemplate.org/doc/moltemplate_manual.pdf