Author Topic: Why my results is the same in every file  (Read 520 times)

HuanHe

  • Newbie
  • *
  • Posts: 4
Why my results is the same in every file
« on: December 18, 2017, 08:13:59 AM »
Hello,
    I am trying to calculate every frame's point defects numbers and want to know their coordination. However, when I calculate the numbers of point defects in every frame, the different frame's file contains the same result, which is the initial result in dump file. How can I solve it?
    Attach my script.
With best regards,
Huan He
   

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 512
Re: Why my results is the same in every file
« Reply #1 on: December 18, 2017, 09:13:14 AM »
Hi,

This command from your script loads just the first frame from the given LAMMPS dump file:
Code: [Select]
node = import_file("G:\ovito\plugins\python\ovito\io\dump.final")
So the script will process only a single simulation frame.

If your dump file contains a sequence of frames, then you need to use the multiple_frames option with the import_file() function:
Code: [Select]
node = import_file("G:\ovito\plugins\python\ovito\io\dump.final", multiple_frames = True)
print("Number of loaded frames: ", node.source.num_frames)

If you have multiple dump files instead, one for each frame, the you need to use a filename pattern instead:
Code: [Select]
node = import_file("G:\ovito\plugins\python\ovito\io\dump.final.*")
print("Number of loaded frames: ", node.source.num_frames)

-Alex

HuanHe

  • Newbie
  • *
  • Posts: 4
Re: Why my results is the same in every file
« Reply #2 on: December 18, 2017, 10:31:14 AM »
With your help, I have solved my problems.
Thanks for your answer!
With best regards! :D