[lammps-users] Using write_data for a group of atoms

Dear Lammps Community,

Is there anyway to use write_data to create a data file a group of atoms? For instance, I have groups 1, 2, and the default group all in my lammps script. I want to use write_data create three data files for group 1, group 2 and all atoms at the end of simulation.

Thanks,
Amir

Dear Lammps Community,

Is there anyway to use write_data to create a data file a group of atoms? For instance, I have groups 1, 2, and the default group all in my lammps script. I want to use write_data create three data files for group 1, group 2 and all atoms at the end of simulation.

No. That is not supported. It is the whole system only.

Mind you, there is a good reason for the whole system requirement: the write_data command and the subroutines it triggers cannot know about whether all atoms belonging to a bond or an angle or a dihedral or an improper are included in a group. To do that check would require lots of additional communication that would make that operation impractical for parallel calculations, especially for runs on a lot of MPI processes which is what LAMMPS is supposed to be efficient at.

There is, however, a workaround for what you want to do.

  • write out a restart file at the end of your regular calculation
  • write an input where you read the restart file and first delete all other atoms except for the group your want to write to a data file and then write the data file
  • repeat this for each group

This way the delete_atoms command can take care of deleting any bonded interactions.

Axel.