← Back to team overview

yade-users team mailing list archive

[Question #680784]: Export plot data issues

 

New question #680784 on Yade:
https://answers.launchpad.net/yade/+question/680784

I am running a simple script that generates a ball and drops it on a plane, while tracking position and kinetic energy.
I have problems exporting the simulation data, stored using plot.addData. The issue is that only a small portion of the data is saved. I have tried alternative ways to export the data (numpy), to no avail. 

I have run the example files that utilize plot.saveDataTxt and they behave as expected (i.e. https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/02-gravity-deposition.py), however mine does not and I would rather solve this issue before moving onto more complex simulations.

It is not a problem caused by plot.addData as the plot.data dictionary contains the correct number of entries (9999) and plot.plot() displays the correct data. https://i.imgur.com/8IcBu46.png

This is the script I am using: https://pastebin.com/QmM9AyG0

Using plot.saveDataTxt, the output contains 232 timesteps. 
Using numpy.savetxt for lists, the output contains 272 timesteps.
Using numpy.savetxt for arrays, the output contains 246 timesteps.
Using python's write, the output contains 303 timesteps.


I believe the problem is due to yade-python interactions during runtime, as typing str(len(myDict["t"]))) into the console or using 
np.savetxt('test.txt',myDict["t"]) provides the correct number of timesteps (9999).

Is this a bug or am I doing something wrong? 


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.