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

[OpenFOAM] Problem with the cylindrical coordinates on Paraview

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2020, 09:40
Exclamation Problem with the cylindrical coordinates on Paraview
  #1
New Member
 
Maxime Lecomte
Join Date: Jul 2020
Posts: 2
Rep Power: 0
maxlec94 is on a distinguished road
Hello everyone,

I am a trainee in hydraulics and new to OpenFOAM and Paraview.

In my projects I have to visualize my results in Paraview using cylindrical components of the velocity.

I found on the internet this macro that permits to convert into cylindrical coordinates :

import vtk

input = self.GetInput()
output = self.GetOutput()

transform = vtk.vtkCylindricalTransform()

transformFilter = vtk.vtkTransformFilter()
transformFilter.SetInputData(input)
transformFilter.SetTransform(transform.GetInverse( ))
transformFilter.Update()

output.ShallowCopy(transformFilter.GetOutput())

When I run the macro I have this error :
File '<string>', line 3, in <module>
NameError: name 'self' is not defined

I am not an expert in Python and I don't understand the error and how to resolve it.

Anyone have a solution ?

Thank you very much and have a good day.
maxlec94 is offline   Reply With Quote

Old   July 17, 2020, 17:31
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
Hi Maxime,

The script should be used in Programmable Filter.

Best, Mikko
Flowkersma is offline   Reply With Quote

Old   July 21, 2020, 10:37
Default
  #3
New Member
 
Maxime Lecomte
Join Date: Jul 2020
Posts: 2
Rep Power: 0
maxlec94 is on a distinguished road
Hello Mikko and thank you for your reply

Is the code the same as a programmable filter ? It seems that paraview don't like the shallow copy function

Thanks

Maxime
maxlec94 is offline   Reply With Quote

Reply

Tags
cylindrical coordinates, paraview 5.0.1, python script


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
[Other] Openfoam for windows 16.02 [CFD support] -problem with paraview ditmeyer OpenFOAM Installation 3 May 15, 2017 12:04
[OpenFOAM] Problem switching from terminal to paraView Maxime Thomas ParaView 10 October 4, 2014 10:59
[OpenFOAM] Paraview display problem jiejie ParaView 4 October 13, 2013 21:29
Yet another Paraview problem gascortado OpenFOAM 5 February 21, 2010 06:39
cylindrical coordinates at thita=0 George Main CFD Forum 6 May 4, 2006 08:40


All times are GMT -4. The time now is 18:37.