CFD Online Logo CFD Online URL
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Extract Paraview data (vtkUnstructured Grid) using pvpython

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2013, 13:02
Default Extract Paraview data (vtkUnstructured Grid) using pvpython
New Member
Join Date: Oct 2013
Posts: 1
Rep Power: 0
lu_siyah is on a distinguished road
I am working with large FE simulation data and I wish to extract information on only coordinates (at different timesteps, precisely a 3xN List of coordinates for every timestep considered or alternatively the displacements, which I know to be stored in a Point Array) and the basic connectivity of the grid into python arrays.
For now, I am working with Paraview in the pvpython-shell and vtk and struggling with finding and arranging the information. So far I used this code to get the coordinates in the beginning (data considered originates from LS-Dyna, hence 3dplot):
import numpy as np 
from paraview import simple  
reader.PartArrays = ['Part1 (Matl2000001)'] 
# reader: <paraview.servermanager.LSDynaReader object at 0x376b5d0>  
data = simple.servermanager.Fetch(reader) 
# data: (vtkMultiBlockDataSet) 
grid = data.GetBlock(0) 
# grid: (vtkUnstructuredGrid) 
npoints = grid.GetNumberOfPoints() 
coord = np.zeros((npoints,3)) 
for i in range(npoints):
  coord[i,:] = np.array(grid.GetPoint(i))
Any ideas on how to proceed from there? That is: Get a matrix of connectivities, and get acess to the data saved in the Point Arrays OR the coordinates at different time steps??
Any help will be appreciated as I am fairly new to this sort of programming.
lu_siyah is offline   Reply With Quote

Old   November 3, 2013, 06:10
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings lu_siyah and welcome to the forum!

Sorry, I'm a bit confused with your description. Is what you're trying to do similar to what's described on this thread:

Because if I understand you correctly, you want to resample/probe the simulation volume you have from the FE simulation, with an array of point/probe locations.
The part that I don't understand is: why do you need a connectivity matrix?

Best regards,
wyldckat is offline   Reply With Quote


pvpython, python, vtk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Run OpenFoam in 2 nodes of a cluster WhiteW OpenFOAM Running, Solving & CFD 16 December 20, 2016 00:51
Animation of Fluent data with paraview Lilly FLUENT 1 June 26, 2016 16:07
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
studying a valve case mina.basta OpenFOAM 33 August 30, 2013 04:46
Grid Independent Solution Chuck Leakeas Main CFD Forum 2 May 26, 2000 11:18

All times are GMT -4. The time now is 19:20.