← Back to team overview

yade-users team mailing list archive

[Question #227428]: plot multiple plots at different iterPeriods

 

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

Hi,
following examples/normalInelasticity-test.py I created multiple plots for my simulation by writing:

plot.plots={'t':('Fn', 'Fmess',), 't_xyz':('Fx', 'Fy', 'Fz',), 't_perf':('speed',)}
plot.plot(noShow=False, subPlots=True)
#...
O.run()

at the end of my script.

I'm using diffrent PyRunners to addData to the plot. These Pyrunners have different iterPeriods.
One PyRunner generates data für the plots 't':('Fn', 'Fmess',) and  't_xyz':('Fx', 'Fy', 'Fz',) and adds it via:

force=plot.addData(t=O.time,t_xyz=O.time, Fn=normalforce, Fmess=Fm, Fx=Fx,Fy=Fy,Fz=Fz)

The other one calls updatePerformancePlot() which adds performance data of the simulation (aka speed of simulation) to the third plot 't_perf':('speed',):

def updatePerformancePlot():
	"""Berechnet die Performance (Speed) zwischen zwei Ausführungen dieser Funktion und gibt sie im Plot aus.
	"""
	global start, finish
	start=finish
	#start=performancePlotter.realLast #doesn't work as supposed to
	finish=O.realtime
	#finish=time.time() #doesn't work as supposed to
	nIter=performancePlotter.iterPeriod
	speed=round(nIter/(finish-start),1)
	plot.addData(t_perf=O.time, speed=speed) 

In my simulation performance recording (shown in the third subpot) begins at first iteration wheras force recording (shown in the first two subplots) starts at a later point.
The plots behave as they are supposed as long as only one plot.addData(...) function is called.
But as soon as force recording should start, data in the plots wont be updated anymore.

In the Inelsticity example this wasnt of any interesest, because all data was plotted in the same pyrunner that is at same iterPeriod with ONE plot.addData(...) function.
How can I realize multiple plot.addData calls from diffrent pyrunners at diffrent "periodicity" (iterPeriods)?

Thank you guys again for your help and effort

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.