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

Contour plot: celldata2pointdata

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 28, 2014, 15:03
Default Contour plot: celldata2pointdata
  #1
New Member
 
Join Date: Nov 2012
Posts: 26
Rep Power: 4
dmaz is on a distinguished road
Hi to everyone, I have to do some contours plot from a file with Paraview using the python scripting.
The following script shows you the contents of my file:

from paraview.simple import *
reader = ExodusIIReader(FileName = "/home/.. file.case")
SliceFile = Slice(reader)
DataSliceFile = paraview.servermanager.Fetch(SliceFile)
print(DataSliceFile)

vtkMultiBlockDataSet (0x4e91180)
Debug: Off
Modified Time: 127260
Reference Count: 1
Registered Events: (none)
Information: 0x3e4a8d0
Data Released: False
Global Release Data: Off
UpdateTime: 0
Field Data:
Debug: Off
Modified Time: 127252
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 0
Number Of Components: 0
Number Of Tuples: 0
Number Of Children: 1
Child 0: vtkPolyData
Debug: Off
Modified Time: 126789
Reference Count: 1
Registered Events: (none)
Information: 0x3e4cdd0
Data Released: False
Global Release Data: Off
UpdateTime: 0
Field Data:
Debug: Off
Modified Time: 126759
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 0
Number Of Components: 0
Number Of Tuples: 0
Number Of Points: 0
Number Of Cells: 0
Cell Data:
Debug: Off
Modified Time: 126787
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 17
Array 0 name = Pressure
Array 1 name = Velocity
Array 2 name = Scalar00
Array 3 name = Density
Array 4 name = TimeStep
Array 5 name = Courant
Array 6 name = GradP
Array 7 name = GradU
Array 8 name = GradV
Array 9 name = GradW
Array 10 name = GrdScl00
Array 11 name = Pprime
Array 12 name = Uprime
Array 13 name = Divergence
Array 14 name = Div-SIMPLE
Array 15 name = DD-SIMPLE
Array 16 name = Vorticity
Number Of Components: 33
Number Of Tuples: 0
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
Scalars:
Debug: Off
Modified Time: 126392
Reference Count: 4
Registered Events: (none)
Name: Pressure
Data type: float
Size: 0
MaxId: -1
NumberOfComponents: 1
Information: 0
Name: Pressure
Number Of Components: 1
Number Of Tuples: 0
Size: 0
MaxId: -1
LookupTable: (none)
Array: (null)
Vectors:
Debug: Off
Modified Time: 126398
Reference Count: 4
Registered Events: (none)
Name: Velocity
Data type: float
Size: 0
MaxId: -1
NumberOfComponents: 3
Information: 0
Name: Velocity
Number Of Components: 3
Number Of Tuples: 0
Size: 0
MaxId: -1
LookupTable: (none)
Array: (null)
Normals: (none)
TCoords: (none)
Tensors: (none)
GlobalIds: (none)
PedigreeIds: (none)
EdgeFlag: (none)
Point Data:
Debug: Off
Modified Time: 126789
Reference Count: 1
Registered Events: (none)
Number Of Arrays: 0
Number Of Components: 0
Number Of Tuples: 0
Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )
Interpolate Flags: ( 1 1 1 1 1 0 0 1 )
Pass Through Flags: ( 1 1 1 1 1 1 1 1 )
Scalars: (none)
Vectors: (none)
Normals: (none)
TCoords: (none)
Tensors: (none)
GlobalIds: (none)
PedigreeIds: (none)
EdgeFlag: (none)
Bounds:
Xmin,Xmax: (1, -1)
Ymin,Ymax: (1, -1)
Zmin,Zmax: (1, -1)
Compute Time: 127407
Number Of Points: 0
Point Coordinates: 0x3caab40
Locator: 0
Number Of Vertices: 0
Number Of Lines: 0
Number Of Polygons: 0
Number Of Triangle Strips: 0
Number Of Pieces: 1
Piece: -1
Ghost Level: 0


If I try to do the contour plot using:
contourFilter = Contour(reader)
contourFilter.PointData[:]

Nothings happens because I haven't point data..
How could I transform the Arrays inside my cell data in point data?
I read about the celldata2pointdata filter but I don't know how to use it..
Can you help me?
dmaz is offline   Reply With Quote

Old   April 28, 2014, 16:05
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings dmaz,

ParaView has a feature for recording most of the operations made, such as opening files, applying filters and changing the camera view. The feature is the Python Trace, accessible from the menu Tools:
  • Start Trace
  • Stop Trace
With these you can easily create scripts that perform most of the operations you want. An article briefly explaining this feature can be found here: http://www.kitware.com/media/html/PythonTrace.html

The tracing feature should help you figure out how to do many of the configurations your looking for, as it will show you how the options used in the GUI translate to Python code.

After you've played around with this feature, along with trying to modify the resulting scripts, have a look into the threads already existing on this forum: http://www.cfd-online.com/Forums/paraview/

Best regards,
Bruno
wyldckat 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
How to Contour plot for omega_z ?? snehal OpenFOAM 2 November 26, 2012 18:04
How to describe streamline plot and contour plot? fruitkiwi Main CFD Forum 0 March 15, 2012 21:51
Unable to view contour plot on a plane azurespirit ANSYS 0 May 23, 2011 08:35
Contour Plot with Paraview jet OpenFOAM Paraview & paraFoam 0 August 26, 2010 10:30
contour plot help jesse@uconn FLUENT 0 February 15, 2010 20:05


All times are GMT -4. The time now is 06:55.