CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

Paraview data modification from vtkmultiblockdataset

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 10, 2017, 00:34
Default Paraview data modification from vtkmultiblockdataset
  #1
New Member
 
Andi Hartarto
Join Date: Jan 2017
Posts: 3
Rep Power: 2
andidi is on a distinguished road
Dear all,

Thank you for your discussions. I have benefited greatly.
Please help me solve this puzzle I have related to your discussion.
linnemann's solution works are looks great.
Unfortunately my work involves usage of the vtkMultiBlockDataSet and I am stuck with it.

I did

from paraview.simple import *
trial5e=ExodusIIReader(FileName=['C:\\Users\\....\\trial5.e'])
trial6= paraview.servermanager.Fetch(trial5e)

# use composite data append
print (trial6)

vtkMultiBlockDataSet ...
...
...
Number of Children:8
Child 0: vtkMultiBlockDataSet
...
Number of Children: 1
Child 0: vtk UnstructuredGrid
...
Field data:
....
Number of points : 2230
Number of cells: 29284
Cell Data:
..
Number of arrays:6
Array 1 = Tetrahedra Rank.
Array 3=ObjectId
....


My ultimate goal is to make ObjectId equal to Tetrahedra Rank.

Please help me


Quote:
Originally Posted by linnemann View Post
Hi

Try this

Code:
numCells = DataSliceFile.GetNumberOfCells()

data=[]
for x in range(numCells):
    data.append(DataSliceFile.GetCellData().GetArray('p').GetValue(x))

print data
or this

Code:
numCells = DataSliceFile.GetNumberOfCells()
new=DataSliceFile.CellData['p']

data=[]
for x in range(numCells):
    data.append(new[x])

print data
It depends on how the data is stored, if its a vtkMultiBlockDataSet or vtkDataSet. This is at least how I get my data.

if DataSliceFile is vtkMultiBlockDataSet then you might need to do some GetBlock(0) thing http://www.vtk.org/doc/nightly/html/...ckDataSet.html

This can also give some inspiration.

http://www.vtk.org/doc/nightly/html/...loatArray.html

http://www.vtk.org/Wiki/Python_Programmable_Filter

http://paraview.org/Wiki/ParaView/Python_Scripting
andidi is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animation of Fluent data with paraview Lilly FLUENT 1 June 26, 2016 16:07
Paraview doesn't seem to be picking up data generated by icofoam MikeHersee OpenFOAM Paraview & paraFoam 2 January 6, 2015 09:27
fluent data file in paraview mehran68 ParaView 1 November 21, 2014 11:55
export data from paraview lions85 OpenFOAM 4 June 2, 2011 13:33
paraview - plotting difference to reference data joewe ParaView 0 August 30, 2010 18:01


All times are GMT -4. The time now is 01:51.