[Paraview-developers] time-dependent output in programmable source
Favre Jean
jfavre at cscs.ch
Wed Jul 27 05:41:16 EDT 2016
hi there
I have a time-dependent python programmable source. Once run, the Information view tab shows the two-column output with indices and values. The first problem I see, is that I give exact values, and the GUI gives me floating point values that are not exact: for example:
timesteps = (0.,0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35)
outInfo.Remove(executive.TIME_STEPS())
for timestep in timesteps:
outInfo.Append(executive.TIME_STEPS(), timestep)
outInfo.Remove(executive.TIME_RANGE())
outInfo.Append(executive.TIME_RANGE(), timesteps[0])
outInfo.Append(executive.TIME_RANGE(), timesteps[-1])
and the GUI shows the following Values:
0
0.05000
0.010000...1
0.149999999
0.200000...1
0.25
0.29999999
0.34999999
the next problem is the VCR Controls; if I mouse-over the Last Frame button, it correctly shows "0.35", but the Time display shows "0.349999". That's annoying.
the real problem is that using the Play button, the executive does not iterate through the timesteps values I have advertized, but rather, it iterates through the following values:
ts = 0.0388888888889
ts = 0.0777777777778
ts = 0.116666666667
ts = 0.155555555556
ts = 0.194444444444
ts = 0.233333333333
ts = 0.272222222222
ts = 0.311111111111
ts = 0.35
My understanding is that the VCR controls uses a fixed number of timesteps, and does an interpolation from the minimum time value to the maximum time values.
Indeed, if I now augment the number of timestes my programmable source is capable of producing, for example:
timesteps = (0.,0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55)
for timestep in timesteps:
outInfo.Append(executive.TIME_STEPS(), timestep)
When using the Play button of the VCR controls, it requests the following times:
ts = 0.0611111111111
ts = 0.122222222222
ts = 0.183333333333
ts = 0.244444444444
ts = 0.305555555556
ts = 0.366666666667
ts = 0.427777777778
ts = 0.488888888889
ts = 0.55
so, it seems like it always produces 9 timestep requests, instead of what the reader advertizes. Playing with a different set of timesteps values, it seems like the VCR always calculates (maxTime - minTime)/(10-1) for the time increment.
I don't feel like this should be the accepted behaviour for the VCR controls. Am I missing some python code? I have followed Chapter 13 of the User Guide.
I have attached the full python code. This is version 5.1.2.
Jean/CSCS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TS.0.py
Type: application/x-download
Size: 2126 bytes
Desc: TS.0.py
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160727/40d2313b/attachment.bin>
More information about the Paraview-developers
mailing list