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

[General] Probe location in a script

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Flowkersma

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2015, 08:35
Default Probe location in a script
  #1
New Member
 
John Vandijk
Join Date: Jul 2015
Posts: 1
Rep Power: 0
Mc Fly is on a distinguished road
Hi everybody,

I am a new Paraview user. I am trying to extract points from a bunch of vtu files. It is pretty easily done with "probe location". But since I have a lot of files, I would like to automatize the process (with a macro or a python script).

Could someone maybe show me how it's done?

Thanks a lot.
Mc Fly is offline   Reply With Quote

Old   September 15, 2015, 03:11
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13
Flowkersma is on a distinguished road
Hi John,

Here is a example script which opens a vtu files, applies probe filter and saves the result to an array:

Code:
from paraview import numpy_support as ns
from paraview.simple import *

probeResults = []
variable = 'U' # name of the array
files = ['file1.vtu','file2.vtu','file3.vtu']

#Pipeline
reader = OpenDataFile(files[0])
probe = ProbeLocation(reader, ProbeType = "Fixed Radius Point Source")
probe.ProbeType.Center = [0,0,0]  # probe location [x,y,z]

# Loop through the files
for file in files:
   reader.FileNames = file
   probe.UpdatePipeline()
   data = servermanager.Fetch(probe)
   probeResults.append(ns.vtk_to_numpy(data.GetPointData().GetArray(variable)))
print probeResults
Let me know if it does/doesn't work for you.

-Mikko
wyldckat likes this.

Last edited by Flowkersma; September 17, 2015 at 08:04. Reason: Tested and corrected the script
Flowkersma 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
Probe Warning, Probe Does Not Work guilha OpenFOAM Pre-Processing 13 September 19, 2017 06:13
[General] How to extract time series data at a specific point location using paraview script Jack001 ParaView 0 April 7, 2016 11:05
[ICEM] Reply script in ICEM CFD location use location of geometry point karamski ANSYS Meshing & Geometry 2 August 13, 2014 12:08
[General] Problems with Plot over line ans Probe location the_cat ParaView 0 March 4, 2014 07:13
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30


All times are GMT -4. The time now is 22:14.