Hello,
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:
pvbatch paraview_test.py
Traceback (most recent call last):
File “paraview_test.py”, line 67, in
SaveData(“sample.csv”,IntegrateVariables12)
NameError: name ‘SaveData’ is not defined
The script looks more or less like this:
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
Fault_Reactivation_pvd = PVDReader( FileName=’…’)
Threshold12 = Threshold()
Threshold12.Scalars = [‘POINTS’, ‘phase [ ]’]
Threshold12.ThresholdRange = [2.0, 2.0]
IntegrateVariables12 = IntegrateVariables()
SaveData(“sample.csv”,IntegrateVariables12)
Best,
Lukas