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

[General] query point data with python

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2015, 04:45
Default query point data with python
  #1
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
I'm trying to query values integrated on a point to return as a float.

I can integrate over an object, for example

Code:
MyObject= GetActiveSource()

Slice1 = Slice(SliceType="Plane")

Slice1 = GetActiveSource()

Int = IntegrateVariables()
giving the integrated values in the gui, but if I then want to return the area, for example from the Int object as a float in python, I'm coming up blank, been looking all afternoon through the documentation for a solution, so far nothing, can someone please point me in the right direction?
seanread is offline   Reply With Quote

Old   October 12, 2015, 07:28
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
Hello,

You can get the area (cell data) and velocity (point data) with following code:
Code:
from paraview import numpy_support as ns
intData = servermanager.Fetch(Int)
Area = ns.vtk_to_numpy(intData.GetCellData().GetArray('Area'))[0]
U = ns.vtk_to_numpy(intData.GetPointData().GetArray('U'))[0]
Regards,
Mikko
Flowkersma is offline   Reply With Quote

Old   October 13, 2015, 00:06
Default
  #3
Member
 
sean read
Join Date: Sep 2014
Location: Melbourne, Australia
Posts: 41
Rep Power: 11
seanread is on a distinguished road
Thanks Mikko, that did the trick
seanread is offline   Reply With Quote

Reply

Tags
python script


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] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 21:00
sample a 3D sub-domain with boundary point data yongxiang OpenFOAM Post-Processing 0 August 22, 2016 07:00
[General] How to extract time series data at a specific point location using paraview script Jack001 ParaView 0 April 7, 2016 10:05
water velocities (point data) are all zero sophie_l OpenFOAM Post-Processing 2 April 20, 2013 06:08
Fieldview 11.1 + Python to extract 3D core of data Rebecca FieldView 0 April 13, 2011 13:06


All times are GMT -4. The time now is 21:37.