Author Topic: Updating Molecule IDs in Replicate Copies  (Read 292 times)


  • Newbie
  • *
  • Posts: 24
Updating Molecule IDs in Replicate Copies
« on: November 16, 2018, 12:40:32 AM »
Hello All,

I have one question, please pardon me if I am missing anything. Let's say I have a system in which I have 10 atoms in which first five atoms had molecule ID 1 and next five has molecule ID as 2. And now if I replicate 1 copy in any direction, then why it doesn't assign updated molecule IDs to the newly generated atoms as it does for atom IDs i.e. new 10 atoms still have molecule IDs as 1 and 2 instead of 3 and 4.

Thanks a lot for your time.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 595
Re: Updating Molecule IDs in Replicate Copies
« Reply #1 on: November 16, 2018, 08:45:44 AM »

This appears to be an accidental slip in the implementation of the replicate modifier. Thanks for reporting this.

I fixed the issue in the source code of Ovito today.

You can work around this problem by applying the Compute Property modifier after replicating the atoms. Use the following formula to recompute the Molecule Identifier property:

Code: [Select]

This will assign new unique molecule IDs to the atoms. Note, however, that the Compute Property in the current dev build Ovito 3.0.0-dev contains another bug that sets the expression variable 'N'  to zero. Thus, in this program version you might have to replace the dynamic variable 'N' in the formula above with the literal number of (replicated) atoms.



  • Newbie
  • *
  • Posts: 24
Re: Updating Molecule IDs in Replicate Copies
« Reply #2 on: November 28, 2018, 10:38:05 PM »
Hi Alex,

Thanks for the information. I will look into it but for a quick fix I just used LAMMPS to make my data file. Anyways thanks for your efforts, and I am definitely looking forward for the update in the future version of OVITO.