How to visualize the trajectory of a simulation with variable number of atoms

Hi to everyone,

I’m using lammps to perform a simulation in the gran canonical montecarlo ensemble (with fix gcmc) and so the total number of atoms change along the simulation.

I have some problem to visualize the trajectory.
I saw that I cannot use the dcd or xtc format cause the total number must be constant.

Using the xyz format I can dump the snapshots but when I load it into VMD it semms to not read properly since the number of atom reported in the xyz trajectory does not correspond to the number of beads in VMD (but in xyz file is reported correctly).

Moreover the xyz does not have any information about the box dimension. I also tryed with others style of dump like atom yaml and custom but VMD seems to not be able to read them.

Does someone have any suggestion ?

Sorry probably it’s not the right place where to write it cause it’s more a visualization problem

I’ll attach the example scrpt that I’m using

Thank you in advance

Daniele

dimension 3
boundary p p p
units real
atom_style atomic


lattice sc 1
region box_1 block -100 100 -100 100 -100 100
create_box 1 box_1
create_atoms 1 random 10 1234 box_1




pair_style lj/cut 20
pair_modify shift yes
pair_coeff * * 10 10
mass 1 1


write_data initial_topology.data


group    dyg dynamic all region box_1 every 1
variable n equal count(dyg)

neighbor 2 bin
neigh_modify delay 0 every 1


timestep 10


fix 1 all gcmc 100 1 1 1 12345 400 100 1 region box_1

thermo_style custom step v_n
thermo 1

dump 1 dyg xyz 1 example.xyz



run 10000

This is not really a LAMMPS question, so I’ll only give you a hint. Google for LAMMPSMAXATOMS.
It is also possible to read an XYZ file with variable number of atoms into VMD using the TopoTools plugin.

There are workarounds for that, but VMD at the fundamental level expects the number of atoms to be constant. Thus is may be a more convenient choice to switch to a different visualization software that supports a variable number of atoms. Visualization Tools for use with LAMMPS

Many thaks for your kind answare.

Yeah I know that it was not the place where to write it I’m sorry.

by the way I tryed OVITO and it semmps to work well

Thanks again