Hi,
I have a .gsd system file created with hoomd-blue and now I want to change the format to lammps/data using a python script with ovito. In the .gsd file the particle type indices start at “0” and have to be incremented by 1 to work with lammps. Additionally I use a custom hybrid bond charge pair style in lammps, so the data file should look like this:
LAMMPS data file via write_data, version 29 Oct 2020
1000 atoms
988 bonds
4 atom types
1 bond types
-12.0 12.0 xlo xhi
-12.0 12.0 ylo yhi
-12.0 12.0 zlo zhi
Masses
1 1
2 1
3 1
4 1
Atoms # hybrid
1 1 -4.8904447556 -9.0006971359 -4.4801688194 1 0.0 0 0 0
2 2 1.0052903891 1.9645963907 -10.9656629562 1 0.0 0 0 0
3 3 3.8270976543 -1.3371047974 -8.0224752426 1 0.0 0 0 0
4 4 2.8785529137 -1.7345225811 -7.4386529922 1 0.0 0 0 0
If i use the export file function of ovito:
export_file(pipeline, “test.data”, “lammps/data”, atom_style=“hybrid”, atom_substyles=(“bond”, “charge”))
the data file looks like this:
LAMMPS data file written by Ovito 3.7.12
1000 atoms
988 bonds
4 atom types
1 bond types
-12.0 12.0 xlo xhi
-12.0 12.0 ylo yhi
-12.0 12.0 zlo zhi
Atoms # hybrid bond charge
1 0 -4.8904447556 -9.0006971359 -4.4801688194 1 0.0
2 1 1.0052903891 1.9645963907 -10.9656629562 1 0.0
3 2 3.8270976543 -1.3371047974 -8.0224752426 1 0.0
4 3 2.8785529137 -1.7345225811 -7.4386529922 1 0.0
…
I tried to define some custom particle property “lammps particle type” and use something like
export_file(pipeline, “outputfile.dump”, “lammps/dump”,
columns = [“Position.X”, “Position.Y”, “Position.Z”, “My Property”])
or
export_file(pipeline, “FENE.xyz”, “xyz”, columns =
[“Particle Identifier”, “Particle Type”, “Position.X”, “Position.Y”, “Position.Z”])
to achive the right format for the columns, without success. I would be glad for any help you can give.
Best,
Hendrik