Author Topic: How to see the trajectory of the atoms after a relaxation  (Read 3401 times)

0 Members and 1 Guest are viewing this topic.

Offline juan pedro

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: es
  • Reputation: 0
    • View Profile
I did a molecular dynamic simulation with graphene, and I would like to see the trajectory of the atoms. So I clicked the option save trajectory in Molecular Dynamics, and a file was generated (i.e. trajectory.nc) but I don’t know how to read it, to make a video or just to know the position of the atoms after the relaxation.

Offline mads.engelund

  • Heavy QuantumATK user
  • ***
  • Posts: 29
  • Reputation: 0
    • View Profile
The main window of VNL is meant for viewing the content of files. Locate the file here and drag it to the Viewer. That should show you full trajectory as a movie. It is also possible to run this little piece of code with atkpython to get the exact coordinates.
Code
traj = nlread('trajectory.nc', Trajectory)[0]
print traj.images()[-1].cartesianCoordinates()
You can look up 'nlread' and Trajectory in the manual if you need something else.

Offline juan pedro

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: es
  • Reputation: 0
    • View Profile
The trajectory file (trajectory.nc) that is generated in MolecularDynamics doesn’t work. However, the trajectory file that is generated in OptimizeGeometry works.

Attached is the generated trajectory file that I can not read.

Thanks in advance.

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
The first file graphenewithdefect.nc appears to be corrupted to me, I am unable to open it.

It is perhaps not very clear, but the MDTrajectory is a high-performance trajectory, build for holding millions of configurations, while the ordinary Trajectory
which is used in OptimizeGeometry, is more generic. Currently VNL only supports visualization of the ordinary Trajectory, but will support in the upcoming version of VNL.

I have a script that I personally use for converting MDTrajectory into ordinary ones if I want to finalize it.

Just run atkpython convert.py trajectoryfinal.nc and it will generate a file called trajectoryfinal_converted.nc, and this you can visualize in VNL.