|
[Sponsors] |
[OpenFOAM] Integrate Variables using ParaView Python Shell |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 12, 2016, 04:08 |
Integrate Variables using ParaView Python Shell
|
#1 |
Member
Join Date: Jul 2013
Posts: 39
Rep Power: 13 |
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' 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? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Loading .stl file with python shell in paraview | New-to-CFD | ParaView | 2 | May 23, 2017 13:31 |
[General] Determining number of cores and/or paraview executable via python | aerogt3 | ParaView | 0 | December 9, 2014 06:54 |
[General] VTK API: Working with values inside the python shell | Thoma | ParaView | 4 | January 10, 2013 15:35 |
[OpenFOAM] 'integrate variables' filter on a polyhedral mesh gives wrong results... | jbf | ParaView | 0 | September 4, 2009 05:08 |
[OpenFOAM] Integrate Variables using PAraFoam | nandiganavishal | ParaView | 2 | April 17, 2009 13:38 |