CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Integrate Variables using ParaView Python Shell

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2016, 04:08
Default Integrate Variables using ParaView Python Shell
  #1
Member
 
Join Date: Jul 2013
Posts: 39
Rep Power: 13
cfdsolver1 is on a distinguished road
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?
cfdsolver1 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 18:26.