October 12, 2016, 03:08
|
Integrate Variables using ParaView Python Shell
|
#1
|
Member
Join Date: Jul 2013
Posts: 39
Rep Power: 11
|
Hello everyone. I want to access the result of U after applying integrate variables filter. This is easy and can be done manually but I want to do this using Python Shell for my further calculations.
For this, I open Paraview and select my mesh regions and cell arrays and after that, I run Python Shell and run my script. However, I get error as
Code:
Traceback (most recent call last):
File "<string>", line 16, in <module>
AttributeError: 'NoneType' object has no attribute 'GetValue'
The following is my Python script:
Code:
import paraview.simple as pvs
data = pvs.Wavelet()
my_slice = pvs.Slice(Input=data)
my_slice.SliceType = 'Plane'
my_slice.SliceType.Origin = [0.0, 0.0, 0.0]
my_slice.SliceType.Normal = [0.0, 1.0, 0.0]
my_slice.SliceType.Offset = 0.0
my_slice.Crinkleslice = 0
my_slice.Triangulatetheslice = 0
my_slice.SliceOffsetValues = [0.0]
iv = IntegrateVariables(Input=my_slice)
iv.UpdatePipeline()
data = servermanager.Fetch(iv)
numPoints=data.GetNumberOfCells()
print numPoints
U10=data.GetCellData().GetArray("U1").GetValue(1) # This is the line no. 16
print U10
I am doing something wrong. I checked the forum and Google but I couldn't find my mistake. Can you help me to correct this?
|
|
|