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

[General] Paraview-Python Scripting, Accessing Data Through Objects

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

Like Tree4Likes
  • 4 Post By wilandlane

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2014, 17:52
Default Paraview-Python Scripting, Accessing Data Through Objects
  #1
New Member
 
William
Join Date: Apr 2013
Posts: 11
Rep Power: 12
wilandlane is on a distinguished road
I am trying to do some post processing of simulations using Paraview through Python scripting. So far I have used Paraview's Trace function to generate the basic script but I can not seem to view/export the data:

Quote:
from paraview.simple import *

tStop = 100
dt = 0.01
files = ['%s/FT_%04d.vtu' %t for t in range(int(tStop/dt))]

FT_ = XMLUnstructuredGridReader(FileName=files)

FT_.PointArrayStatus = []
FT_.CellArrayStatus = ['EP_G', 'P_G', 'P_S', 'Gas_Velocity', 'Solids_Velocity_1', 'Gas_temperature', 'Solids_temperature_1']

Calculator2 = Calculator()
Calculator2.Function = '(Gas_temperature+Solids_temperature_1)/(2)'
Calculator2.ResultArrayName = 'Tbar'
Calculator2.AttributeMode = 'Cell Data'

IntegrateVariables2 = IntegrateVariables()

PlotSelectionOverTime1 = PlotSelectionOverTime()

selection_source_3717 = IDSelectionSource( ContainingCells=0, InsideOut=0, FieldType='CELL', IDs=[-1L, 0L] )

PlotSelectionOverTime1.Selection = selection_source_3717
The new data seems to be stored in PlotSelectionOverTime1. According to Paraview, the attribute is "Row Data"; however, the class does not contain such an attribute. Is anyone familiar with Paraview's objects/attributes in Python?

Thanks!
wilandlane is offline   Reply With Quote

Old   February 16, 2014, 13:27
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
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 William,

I believe what you're looking for is somewhat already explained here: http://www.cfd-online.com/Forums/par...tml#post456638 post #6

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 19, 2014, 12:38
Default
  #3
New Member
 
William
Join Date: Apr 2013
Posts: 11
Rep Power: 12
wilandlane is on a distinguished road
wyldckat,

You're right, that is exactly what I needed, thanks! I was actually able to get it working last week, but forgot to update my post. Here's the code I used to extract information from a "Plot Selection Over Time" filter which stores data not as Points or Cells, but as a Block.

Code:
Fetch = servermanager.Fetch(PlotSelectionOverTime1)
Block = PlotFetch.GetBlock(0)
RowData = PlotBlock.GetRowData()
Array = PlotRowData.GetArray(0)
Value = Array.GetValue(i)
wyldckat, kiddmax, Niteck and 1 others like this.
wilandlane is offline   Reply With Quote

Reply

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
[OpenFOAM] Paraview Find Data cojua8 ParaView 2 March 19, 2018 09:57
paraview - cell data or point data on plot over line bye bye my blue OpenFOAM 0 December 13, 2016 07:07
[General] Determining number of cores and/or paraview executable via python aerogt3 ParaView 0 December 9, 2014 06:54
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 15:06
[General] paraview ignores SPACING in STRUCTURED_POINTS vtk data? jaffar ParaView 0 November 27, 2012 10:36


All times are GMT -4. The time now is 02:11.