Author Topic: Is it possible to fix the positions of select atoms during a trajectory?  (Read 553 times)

Jc112358

  • Newbie
  • *
  • Posts: 4
I have a nudged elastic band run that I'm looking into rendering for a paper. However, during the run, several atoms along the periodic boundaries get wrapped to the other side of the cell. I'd like to render a movie of the reaction without this wrapping occurring. Is it possible to fix the positions of the wrapped atoms in Ovito, to correspond to their positions in the first image?

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 500
Re: Is it possible to fix the positions of select atoms during a trajectory?
« Reply #1 on: February 15, 2018, 08:29:10 AM »
Hi,

Yes, unwrapping the atomic coordinates can be achieved, but it's complicated:

  • First, go to frame 0 of the sequence and make a copy of the current atomic positions using the Freeze Property modifier. Name the copied property "pos0", for example.
  • Use the Displacement Vectors modifier to let Ovito compute the atomic displacements with respect to the initial positions. This is where the minimum image convention comes into play.
  • Finally, use the Compute Property modifier to overwrite the values of the Position property. For the X component, enter the expression "pos0.X+Displacement.X". For the other two components, do correspondingly.

Jc112358

  • Newbie
  • *
  • Posts: 4
Thank you, this works very well. However, I need only the particles at the boundary conditions to remain fixed. Following these steps will freeze all atoms with respect to the initial frame. Is it possible to freeze only a few select atoms? I have tried using the manual selection option to choose specific atoms, and checking off "Compute only for the selected particles" in the Compute Property function, but I still get all atoms to be frozen. Thank you for your help.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 500
The steps I described should not freeze the positions of any of the atoms. All atoms should still move as before, but the trajectories get unwrapped and become continuous, i.e. atoms no longer jump to the opposite of the box when they cross a periodic boundary.

Please double check if you have applied all modifiers in the right order. You can save everything as a .ovito scene file and upload the file here. Then I can verify your steps.

Jc112358

  • Newbie
  • *
  • Posts: 4
Hello,
I apologize for the late response to this, but I revisited this issue earlier today and I believe I now understand what the problem is, but don't know how to fix it (I'm assuming I'm doing something wrong though). The issue seems to be that the Compute function doesn't recognize that I've called the Freeze Property modifier as pos0 and in turn doesn't update the atom's positions correctly. I've attached the *.ovito file for you. Any help you can provide is appreciated. Thank you.

Jc112358

  • Newbie
  • *
  • Posts: 4
I updated to the latest development version of Ovito and it works perfectly. I guess if anyone else is having a similar problem, update your version of Ovito and the steps provided earlier will work. Thank you for your help.