How to load lammps data file with bonds

Dear lammps users

I have a lammps data file which is an output of simulation of cells
flow in a tube. It contains cells, represented by atoms, bonds,
angles, and dihedrals. The simulation domain is {-7 7, -7 7, -35 35}.
I want to visualize this data somehow, the only program I know can do
that is VMD.
When I load it to the VMD it looks weird (to illustrate it, I attached
screenshot) because of periodicity and I can’t sort it out because
don’t understand several things:
1) How VMD transforms lammps coordinates into it’s own? For instance,
I found that coordinate of the point near the center of my simultaion
box (picked a point in VMD) is like {-7174 -7168 -35823}.
2) As far as I understood in order to do wrap correctly I need to
specify unitcell. I can do that using set command: pbc set {14 14 70}.
But this command specifies size of the box only, is it enough to
specify periodic domain? Don’t I need to specify center of the domain
as well (the point, not center of mass)?
3) Do I need to apply wrap several times if particles are far away
from the original box?

To load lammps data file, I use the following command

topo readlammpsdata <filename> molecualr
pbc set {14 14 70}
pbc wrap

wrap changes the picture but it is still weird. In order to illustrate
how it the data should look like I attached before.png file - it is
rendered input data file for the simulation (all points are inside box
at this point).

problem.png

before.png

dear kirill,

Dear lammps users

this is more of a VMD question than a LAMMPS question.
you probably should post future similar questions better
to the VMD mailing list.

I have a lammps data file which is an output of simulation of cells
flow in a tube. It contains cells, represented by atoms, bonds,
angles, and dihedrals. The simulation domain is {-7 7, -7 7, -35 35}.
I want to visualize this data somehow, the only program I know can do
that is VMD.
When I load it to the VMD it looks weird (to illustrate it, I attached
screenshot) because of periodicity and I can’t sort it out because
don’t understand several things:

1) How VMD transforms lammps coordinates into it’s own? For instance,
I found that coordinate of the point near the center of my simultaion
box (picked a point in VMD) is like {-7174 -7168 -35823}.

this is not about VMD per se, but about the data file reader
code in the topotools plugin. in short, it doesn't do anything
to the coordinates. however, it does depend on you correctly
providing the atom style that is used to read the data file.

it is impossible to argue without having example files.

2) As far as I understood in order to do wrap correctly I need to
specify unitcell. I can do that using set command: pbc set {14 14 70}.

no. you only need to provide box information if it is not already present.
the topotools plugin will try to read box information from a provided
data file. you can verify this with: pbc get

But this command specifies size of the box only, is it enough to
specify periodic domain? Don’t I need to specify center of the domain
as well (the point, not center of mass)?

no. why should that be needed. periodicity is invariant to translation.

3) Do I need to apply wrap several times if particles are far away
from the original box?

no. the pbc wrap command is very smart.

To load lammps data file, I use the following command

topo readlammpsdata <filename> molecualr

there is a typo here: it should be "molecular"

pbc set {14 14 70}

this is not needed.

pbc wrap

this will wrap by atoms, which is probably not what you want.

wrap changes the picture but it is still weird. In order to illustrate
how it the data should look like I attached before.png file - it is
rendered input data file for the simulation (all points are inside box
at this point).

this is because you are expecting non-default settings to be
active when using "pbc wrap". if you want individual molecules
to be wrapped as complete entities, you have to use

pbc wrap -compound fragment

the default setting is -compound atom, i.e. it will wrap
individual atoms and not care if that leads to bonds
spanning across periodic boundaries which give rise to
the unwanted graphics you show.

cheers,
    axel.

Dear Axel

I tried to use fragment and played with selection option for wrap
command (I thought that, perhaps, I shall apply different commands to
atoms and bonds).
But couldn't manage to obtain results, I attached a file which
contains one cell(atom type 1), not connected particles(types 2 and
3).

Thanks in advance,
Kirill

cell.tar (2.16 MB)

Dear Axel

I tried to use fragment and played with selection option for wrap
command (I thought that, perhaps, I shall apply different commands to
atoms and bonds).
But couldn't manage to obtain results, I attached a file which
contains one cell(atom type 1), not connected particles(types 2 and
3).

hmmm... your data file looks strange.

try using the restart2data code from here:
http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blob_plain;f=tools/restart2data.cpp

axel.

Thank you. Now it works, because of this line:

data.image[iatoms] = *((tagint *) &buf[m++]);