data file

hi

I’ve made a ice box with moltemplate and I’ve made Graphene sheet and water with vmd .Now I want to have a data file of these three systems. I can not merg ice with water or graphene in vmd.how I can build a data file for all of them?

Meymanat Zokaie

You most certainly can merge data files in vmd. It is not a black box process, though.

Axel

Hi Meymanat.

--- Merging two data files: ---

Manual method:
It's not a bad idea to get familiar with the two data files. If you
have not done this yet, you should open them up in a text editor and
see the format. Although, in principle you could write a script (to
renumber all of the atom-ids, atom-types, bond-ids, bond-types, ... in
the second data file, and merge the various sections together), this
is not necessary.

Since I don't know how to do this in topotools, I'll explain how to do
this in moltemplate instead:

Moltemplate method:
Since you are using moltemplate already, I recommend using the
"ltemplify.py" program to import your graphene sheet into moltemplate.
(it is included with moltemplate). Then you can import the graphene
sheet inside your system.lt file, and run moltemplate.sh on that file.

---- details ----

Step 1)
Create an .LT file containing the definition of a new
molecule-template-object containing the contents of the graphene
sheet. (A "molecule object" is a collection of atoms, bonds and
force-fields. -Everything which describes your graphene sheet.)

For example, use:

ltemplify.py -name Graphene graphene.in graphene.data > graphene.lt
    (Read appendix B of the moltemplate_manual.)

ltemplify expects two files:
  i) an input script ("graphene.in" in this example), which contains
the masses and force-field parameters for graphene. (If you don't know
them, then leave this file empty)
  i) a data file containing the list of atoms, bonds, angles, etc...

Step 2)
Then modify your "system.lt" file that you are using in moltemplate.
Add these lines to the end of it:

--- Merging two data files: ---
Since I don't know how to do this in topotools, I'll explain how to do
this in moltemplate instead:

Step 1)
Create an .LT file containing the definition of a new
molecule-template-object containing the contents of the graphene
sheet. (A "molecule object" is a collection of atoms, bonds and
force-fields. -Everything which describes your graphene sheet.)

For example, use:

ltemplify.py -name Graphene graphene.in graphene.data > graphene.lt
    (Read appendix B of the moltemplate_manual.)

ltemplify expects two files:
  i) an input script ("graphene.in" in this example), which contains
the masses and force-field parameters for graphene.

Yes, this works.

(If you don't know
them, then leave this file empty)

Don't do this!
I want to email you back to warn against this.

  i) a data file containing the list of atoms, bonds, angles, etc...

In my last email, I did not have a chance to test my instructions to
see if they work before I posted them. I tried this today. They
work. (You can convert a DATA file into a moltemplate (LT) file this
way. Later you can load this file inside another moltemplate file.)

However if any of the information needed to simulate that part of the
system is missing (for example, the pair_coeffs), moltemplate will
crash.

Hope this helps
-Andrew

   --------- boring details ---------

Axel is right. You have to be careful. Merging two data files is
dangerous, because the atom-types, bond-types, angle-tyles,
dihedral-types, and improper-types in one of the data files must be
renumbered as well. However these numbers are ALSO referred to in
your input-scripts. They appear in your "pair_coeff", "bond_coeff",
"angle_coeff", "dihedral_coeff", and "improper_coeff" commands. This
means, you must also be careful to include this information when using
"ltemplify.py". A DATA file is not enough. You must include a file
containing input script commands which define the force field you are
using on these (graphene) atoms.

So in this example, you must supply ltemplify with a "graphene.in"
file containing "pair_coeff" commands. A blank "graphene.in" file
will not work. (Make sure you put this information in an input
script. I do not recommend specifying this information in data file
itself. I'm not sure, but the "Pair Coeffs" section in a data file
might confuse ltemplify.py, so please use "pair_coeff" commands
instead. If applicable, you must also supply "bond_coeff",
"angle_coeff", "dihedral_coeff", "improper_coeff" commands for your
system as well.)

  --- interactions between different atom types ---

You may also need to define interactions between the atoms in the two
different systems using additional "pair_coeff" commands (especially
if your pair_style does not support automatic mixing, or mixing
produces incorrect results). In this example, you could do this by
adding these lines to the end of your system.lt file:

write_once("In Settings") {
  pair_coeff @atom:Graphene/type1 @atom:SPCE/O 0.114 3.28
  pair_coeff @atom:Graphene/type1 @atom:SPCE/H 0.0 3.28
}

... or something similar
and THEN (finally) you can run moltemplate.sh on this file
("moltemplate.sh system.lt").

...If you omit anything, you will get this errors like this when you
run moltemplate.h:

     "Syntax error: Missing pair coeff.
  No pair coeffs for the "@/atom:Graphene/type1" atom type have been
defined, but a reference to that atom type was discovered
near "graphene.lt", line 4."

  (This error message is useful. If you had tried to run LAMMPS on a
system with missing pair_coeffs, it would not tell you exactly where
in your lammps files the error occured.)

   Summary:
To convert graphene into moltemplate format, you must specify the
force-field for graphene.

   (But in your case, you may be able to build the graphene sheet
directly in moltemplate without needing topotools.)

My apologies for posting such long instructions.
I hope this helps.
Cheers

Andrew