CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Paraview data modification from vtkmultiblockdataset

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 9
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


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
UDF value to large for defined data type Anna73 Fluent UDF and Scheme Programming 9 September 30, 2018 23:18
[OpenFOAM] Where are the data located to access via paraview? Schurl ParaView 2 December 29, 2017 09:22
Animation of Fluent data with paraview Lilly FLUENT 1 June 26, 2016 17:07
[OpenFOAM] Paraview doesn't seem to be picking up data generated by icofoam MikeHersee ParaView 2 January 6, 2015 09:27
[General] paraview - plotting difference to reference data joewe ParaView 0 August 30, 2010 19:01


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