CFD Online Discussion Forums

CFD Online Discussion Forums (
-   ParaView (
-   -   [OpenFOAM] Problem with the cylindrical coordinates on Paraview (

maxlec94 July 17, 2020 09:40

Problem with the cylindrical coordinates on Paraview
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.SetTransform(transform.GetInverse( ))


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.

Flowkersma July 17, 2020 17:31

Hi Maxime,

The script should be used in Programmable Filter.

Best, Mikko

maxlec94 July 21, 2020 10:37

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



All times are GMT -4. The time now is 13:04.