|
[Sponsors] |
[General] python view + matplotlib: SetAttributeArrayStatus(…) for an array in vtkMultiBlockDa |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 26, 2017, 12:23 |
python view + matplotlib: SetAttributeArrayStatus(…) for an array in vtkMultiBlockDa
|
#1 |
Member
Arvind Jay
Join Date: Sep 2012
Posts: 96
Rep Power: 14 |
Dear All,
Based on the feature metiond in the paraview blog, I am trying to use the matplotlib library to plot the data filtered through "PlotOverLine" filter. I believe this is of type vtkMultiBlockDataSet with 1 child (vtkPolyData) I am having issues with SetAttributeArrayStatus(…) for an array in vtkMultiBlockDataSet. Here is the script, I used: Code:
def setup_data(view): from paraview.numpy_support import vtk_to_numpy for i in xrange(view.GetNumberOfVisibleDataObjects()): dataObject = view.GetVisibleDataObjectForSetup(i).GetBlock(0) #Accessing the point data pressure = dataObject.GetPointData().GetArray("p") print vtk_to_numpy(pressure) # prints the pressure array view.DisableAllAttributeArrays() view.SetAttributeArrayStatus(i, vtkDataObject.POINT, "p", 1) # code breaks here! Could not pass the vtkDataObject.POINT array def render(view, width, height): from paraview.numpy_support import vtk_to_numpy from paraview import python_view figure = python_view.matplotlib_figure(width, height) for i in xrange(view.GetNumberOfVisibleDataObjects()): dataObject = view.GetVisibleDataObjectForRendering(i) .GetBlock(0) pressure = dataObject.GetPointData().GetArray("p") print vtk_to_numpy(pressure) Thanks, Jay |
|
Tags |
paraview matplotlib |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to build current blower fan model in Flotherm | eric0722 | FloEFD, FloWorks & FloTHERM | 3 | January 2, 2021 02:36 |
Trouble modelling a jet fan | josee | OpenFOAM Pre-Processing | 0 | September 23, 2016 13:06 |
[OpenFOAM] Python to show row data in spreadsheet view | JensD | ParaView | 0 | August 18, 2016 03:40 |
Constant Power Fan Model using General Momentum Source | Dano62 | CFX | 0 | April 14, 2016 13:09 |
fan driven flow, Fan BC validation (getting lost) | soonic | OpenFOAM Running, Solving & CFD | 0 | July 7, 2013 19:16 |