Author Topic: Time average Positions  (Read 77 times)

tabedzki

  • Newbie
  • *
  • Posts: 8
Time average Positions
« on: November 13, 2018, 11:39:37 PM »
Hi there,
I was wondering if there was an easy way to time average particle positions. I can't find it under modifiers in Ovito 2.9.0. I would greatly appreciate any help.

Thanks in advance.

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 512
Re: Time average Positions
« Reply #1 on: November 14, 2018, 09:28:23 AM »
Hi,

Ovito currently doesn't have a built-in function for doing this. So there is no "easy way", sorry.

If I was you and you are working with LAMMPS dump files, I would use LAMMPS to do the time-averaging using the "fix ave/atom" and "rerun" commands. Otherwise, I would use OVITO's scripting interface to load the trajectory data and implement the time-averaging using Python code. That's kind of a "hard way" of course.

If you think that this is a very common problem for which Ovito should provide a built-in solution, let us know. Perhaps I can add it in the future. Computing time-averaged atomic positions is technically not much different from computing interpolated atomic positions, which the new Interpolate Trajectory modifier of Ovito 3.0.0 already does. 

-Alex

tabedzki

  • Newbie
  • *
  • Posts: 8
Re: Time average Positions
« Reply #2 on: November 15, 2018, 05:53:45 AM »
Hi Alex,

We use a lammps trajectory file but we manually generate it instead of using LAMMPS. Can you use hte fix ave/atom and run commands if you use an outside generated file? 

The feature that I was hoping OVITO would have was found in VMD (which has a less user friendly UI):
https://www.ks.uiuc.edu/Training/Tutorials/vmd/tutorial-html/node3.html
https://www.ks.uiuc.edu/Research/vmd/script_library/scripts/trajectory_smooth/
The actual script that they use can be found here: https://www.ks.uiuc.edu/Research/vmd/script_library/scripts/trajectory_smooth/trajectory_smooth.tcl

What the feature above does is essentially a moving average where it takes into account the nearest X frames and updates the positions to reflect that (so it keeps all the frames but makes them dependent on the neighboring ones). I found it useful for eliminating noise in my simulations. I installed 3.0.0 and tried to use the `Interpolate Trajectory` modifier that is there and also changed the animation settings to be 5/1 and also 5/5. However, it didn't seem to make the rendering as smooth as the VMD version of the software. Did I use the `Interpolate Trajectory` incorrectly? If this isn't the method to achieve it, is there a way to add this functionality into the program?

Cheers,
tabedzki