Getting Surface LIC representation through python script

Hi, I am postprocessing an OpenFOAM CFD simulation in ParaView using python script and paraview tracer. I want to obtain slices with total pressure coefficient plots (managed to get this working ok) and velocity LIC. Unfortunately I am struggling to change slice representation to Surface LIC - all the plots I am getting from this script use “Surface” representation.

Scroll to line 274 to see how exactly I am trying to switch to LIC.

If you have any ideas on how to troubleshoot this I’d really appreciate help!
Regards!

postProZ_v1.py (8.2 KB)

I tried a simpler script that seems to work perfectly on paraview master.test.py (5.5 KB)

Hi Mathieu,

Thanks for getting back to me!

  1. When I try to just run your script I get a message

Traceback (most recent call last):
File “test_LIC.py”, line 36, in
wavelet1Display.GaussianRadius = 0.1
File “/usr/lib/paraview/site-packages/paraview/servermanager.py”, line 453, in setattr
“to add this attribute.”)
AttributeError: Attribute GaussianRadius does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.

  1. I tried following your advice though and modifying my original script to use

slice1Display.SelectInputVectors = [‘POINTS’, ‘U’]

slice definition, however this also results in the following error:

Traceback (most recent call last):
File “postProZ_v1lic.py”, line 237, in
slice1Display.SelectInputVectors = [‘POINTS’, ‘U’]
File “/usr/lib/paraview/site-packages/paraview/servermanager.py”, line 453, in setattr
“to add this attribute.”)
AttributeError: Attribute SelectInputVectors does not exist. This class does not allow addition of new attributes to avoid mistakes due to typos. Use add_attribute() if you really want to add this attribute.

Any ideas how to troubleshoot this?

Thanks,
OlekpostProZ_v1lic.py (7.8 KB)

I’m sorry, I always forget that generated python script are not retro compatible.
With which version of ParaView are you working ?

Hi Mathieu

I have 5.4.1 64bit, running on Ubuntu

Olek

Here is a working python script for ParaView 5.4.1
test.py (3.0 KB)

1 Like

Thanks, managed to get it working now :slight_smile: