|October 28, 2013, 14:02||
Extract Paraview data (vtkUnstructured Grid) using pvpython
Join Date: Oct 2013
Posts: 1Rep Power: 0
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=simple.OpenDataFile('/home/data/d3plot') reader.PartArrays = ['Part1 (Matl2000001)'] reader.UpdatePipeline() # 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 help will be appreciated as I am fairly new to this sort of programming.
|November 3, 2013, 07:10||
Join Date: Mar 2009
Location: Lisbon, Portugal
Blog Entries: 39Rep Power: 106
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: http://www.cfd-online.com/Forums/par...-paraview.html
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?
|pvpython, python, vtk|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Extracting ParaView Data into Python Arrays||Jeffzda||ParaView||12||January 17, 2017 12:30|
|Animating unsteady data from Fluent in Paraview..||frodooon||ParaView||10||May 9, 2014 10:39|
|structured and unstructured grids||user||Main CFD Forum||6||November 25, 2010 02:14|
|PARAVIEW Grid visualization||simone Marras||ParaView||2||January 23, 2007 09:05|
|Grid Independent Solution||Chuck Leakeas||Main CFD Forum||2||May 26, 2000 11:18|