How to periodically output vtk files without overwriting previous results?

Asked by weijie

Dear all,

In the process of exporting the force chain, I found that the output result cannot be saved in a certain time step, and the previous result will be overwritten. What should be done so that the results of different time steps can be saved periodically?

Thanks in advance.
Jie

Here's MWE:
############
def vtkExport():
    export.VTKExporter('vtk/forcechain').exportInteractions(ids=intrs,what=dict(forceN='i.phys.normalForce.norm()'))
O.engines=O.engines+[PyRunner(iterPeriod=500, command='vtkExport()',firstIterRun=60000)]

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

Hi,

create one instance of VTKExporter (not every time a new one), it increase internal "counter" and therefore does not overwrite the existing files.
############ [1]
vtk = export.VTKExporter('vtk/forcechain')
def vtkExport():
    vtk.exportInteractions(ids=intrs,what=dict(forceN='i.phys.normalForce.norm()'))
O.engines ...
###

cheers
Jan

[1] https://yade-dem.org/doc/yade.export.html#yade.export.VTKExporter

Revision history for this message
weijie (amandajoe) said :
#2

Thanks Jan Stránský, that solved my question.