[lammps-users] several polymers

Dear Dr Kohlmeyer,

The problem is that I cannot simply introduce breaks to the polymer below to get two polymers, but translate it to another polymer of same length and with the only restriction that it has to be close to the initial polymer. I cannot see how to do this in one simulation -- do I have to define another set of atoms bonds and angles or can I create a new input file use use two inputs for one simulation? or can I just continue in one input file but instead of this:

Atoms

     1 1 1 0.0 0.0 -5.0
     2 1 1 0.0 0.0 -4.0
     3 1 1 0.0 0.0 -3.0

do something like this?

Atoms

     11 2 2 0.0 0.0 -20.0
     12 2 2 0.0 0.0 -19.0
     13 2 2 0.0 0.0 -18.0

and similarly for bonds and angles with 2 in the second column...

Thank you for your time!

Anna

anna,

Dear Dr Kohlmeyer,

The problem is that I cannot simply introduce breaks to the polymer below to
get two polymers, but translate it to another polymer of same length and
with the only restriction that it has to be close to the initial polymer. I
cannot see how to do this in one simulation -- do I have to define another
set of atoms bonds and angles or can I create a new input file use use two
inputs for one simulation? or can I just continue in one input file but
instead of this:

what you are describing is something that cannot be done
from within LAMMPS. LAMMPS is an "MD engine" but not
a tool to prepare complex topologies. its topology generating
capabilities are limited to atomic lattices or crystals and
creating exact copies of the total system.

you will have to create a new data file and
then start a new simulation for the second system.

there are a number of ways how you can build and
manipulate a new topology from an existing one.
- you can create a new data file from scratch
- you can manipulate an existing data file with a text editor
  or write a small script in python/perl/sed/awk for it.
- you can use a graphical tool to edit the molecular
  structure and then convert it to a lammps data file
- you can write a script for a "domain specific tool"
  like VMD that has an interface to lammps.

my personal preference for that is to use VMD, but that
is mainly because i have been using and programming
it for a very long time and wrote a script package (topotools)
that provides "primitives" that can be combined with other
VMD script commands for exactly that purpose and much more
however, that requires some familiarity with VMD scripting
since there is currently no real documentation and no tutorial.

i've been thinking to start writing a small tutorial for the
upcoming release of the next VMD version and your
case seems simple enough, so if you are ok with it,
and willing to spend a little extra time, i can use your
problem for the tutorial and you help me checking that
the tutorial is written so that a beginner can understand it.

so for starters, you would want create a copy of the one
polymer and then translate it by 15 angstrom in z-direction.
is that correct?

cheers,
    axel.

anna,

i've been thinking to start writing a small tutorial for the
upcoming release of the next VMD version and your
case seems simple enough, so if you are ok with it,
and willing to spend a little extra time, i can use your
problem for the tutorial and you help me checking that
the tutorial is written so that a beginner can understand it.

here is the first installment of VMD script files. they are
meant to be used in text mode and will terminate VMD when done.

the first script, simplexyztodata.tcl is a minimal example for how
plain coordinate data can be converted into a LAMMPS data file.
it will load only the coordinates from a .xyz file and then set the
atom type (to "A"), determine bonds and angles and infer their
types from the respective atom types. this should recreate your
original data file. to run the script do:

vmd -dispdev text -e simplexyztodata.tcl

you will see some information about the conversion on the screen.
check it closely to see, if there are any error messages.
the script has comments that explain the individual steps.

the second script tries to do what you were asking about:
it will create a data file that contains two molecules from
the data of the first molecule, but has the second molecule
translated by -15 angstrom in z direction.

vmd -dispdev text -e twochainsfromone.tcl

there is also the option to change the atom type and other
properties of the atoms in the second molecule, but that
is commented out.
please note, that VMD does not store any information about
the origin of the simulation cell, so the xlo/xhi/ylo/yhi/zlo/zhi
parameters are always chosen to have the coordinates in
the center. if this is not desired, you can easily edit the
data file in a text editor.

good luck,
    axel.

simplexyztodata.tcl (1.67 KB)

chain.xyz (620 Bytes)

twochainsfromone.tcl (2.76 KB)

Dear Dr Kohlmeyer,

Thank You very much for Your reply: please feel free to use the example for the tutorial. I will now work through everything that You have sent and will get back to You very soon!
Thank You very much again!
Sincerely Yours,
Anna

Dear Dr Kohlmeyer,

I have used the example You wrote for the 10-mer, however, when I have something more complex with other parameters that have to be taken into account (bonds, angles...), I thought to try to create a new file from scratch in lammps.
I have been trying to work on this for a while with no improvement. This is what I have initially, (my input is ca 1200-mer):

units lj
atom_style angle #with stiffness
boundary p p p
neighbor 0.3 bin
neigh_modify every 1 delay 1 check yes
dump 1 all custom 10000 chain.N100.dump.* id x y z ix iy iz
dump_modify 1 format "d .5f \.5f .5f %d %d %d"
restart 10000 chain.N100.restart
read_data mychain.chain.N100.input
thermo 1000
thermo_style custom step temp epair emol press pxx pyy pzz pxy pxz pyz vol
angle_style cosine
angle_coeff 1 0
pair_style lj/cut 1.12246152962189
pair_modify shift yes
pair_coeff 1 1 1.0 1.0
bond_style fene
bond_coeff 1 30.0 1.5 1.0 1.0
group all type 1
fix 1 all nve
fix 2 all indent 10.0 sphere 0.0 0.0 0.0 10 units box side in
fix 3 all langevin 1.0 1.0 2.0 424242
timestep 0.012
reset_timestep 0
run 100000

I understand that when I make a new polymer input and say

LAMMPS input data file

        1273 atoms
        1272 bonds
        1271 angles

         2 atom types
         2 bond types
         2 angle types

   -150.0 150.0 xlo xhi
   -150.0 150.0 ylo yhi
   -150.0 150.0 zlo zhi

  Masses

            1 1.000000

  Atoms

  1 2 2 0. 0. 9.4
......
1273 ....

Bonds

  1 2 1 2
  2 2 2 3

Angles

  1 2 1 2 3
  2 2 2 3 4