I am trying to extract a mean value of a property (e.g. the viscosity) from a 3D model, ideally I would like to do it with pvpython to automate it. In the GUI it works some how, using a threshold to confine the region and then applying an integrate filter. Saving the data is a bit messy (using Save Data) but it works. I tried to produce a script with the trace option, but the saving part does not show up.
I am using Paraview 4.0.1 (which apparently uses python 2.7…). I do have the feeling, that this is a Paraview Version problem (unfortunately, I couldn’t find an answer online), but since I am using Paraview on a network and I don’t have admin rights I am a little reluctant to ask IT to update it.
Thanks in advance for the help! Highly appreciated!
When I try to use the SaveData(“sample.csv”,source) command in the script I do get the error:
Traceback (most recent call last):
File “paraview_test.py”, line 67, in
NameError: name ‘SaveData’ is not defined
The script looks more or less like this:
except: from paraview.simple import *
Fault_Reactivation_pvd = PVDReader( FileName=’…’)
Threshold12 = Threshold()
Threshold12.Scalars = [‘POINTS’, ‘phase [ ]’]
Threshold12.ThresholdRange = [2.0, 2.0]
IntegrateVariables12 = IntegrateVariables()