|
[Sponsors] |
July 1, 2015, 08:35 |
Probe location in a script
|
#1 |
New Member
John Vandijk
Join Date: Jul 2015
Posts: 1
Rep Power: 0 |
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. |
|
September 15, 2015, 03:11 |
|
#2 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
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 -Mikko Last edited by Flowkersma; September 17, 2015 at 08:04. Reason: Tested and corrected the script |
|
|
|
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 |