Script not working : AttributeError


I’m working with OpenFoam for simulations and using paraView to postprocess them.

What we do is extracting 3 csv data files and as we test a lot of different simulations in the same time, we worked on automatize them.

So I used the Trace method to build the python script.

The point is that when I use the Python Shell or even Pvpython/PbBatch (in order to postprocess from the command tab), I have the following error :

/home/calculopenfoam/OpenFOAM/ThirdParty-4.1/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0/site-packages/paraview/", line 302, in __setattr__
"to add this attribute.")
AttributeError: Attribute PartArrayStatus 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.

I searched a lot but did not found any answers.

I let you my script. Note that when I # the not working lines on my scripts, it works with the Python Shell but I got a proxy error using pvpython/pybatch.
My final goal is to use only pvpython

What should I do ?
Thanks a lot (9.1 KB)

Are you using the LSDyna reader ? What is the active source in your script ?

Hello Mathieu,
No I’m not using LSDyna reader.
The active source I’m using is a pipeline with meshing that has been used in OpenFoam to simulate a biphasic (water+air) is going through.

Which version of ParaView are you using ?

I’m using paraview 5.0.1 with python 2.7

On ParaView 5.0.1, PartArrayStatus is not a property of the OpenFOAM reader.

How did you generate this script ? Can you just remove the line ?

I generated the script using the Trace.
If I’m using Python shell in paraView with the line removed, it works.
But if I’m using pvbatch from the command tab, it’s not working, I have this error :

Traceback (most recent call last):
File “/home/calculopenfoam/Bureau/”, line 16, in
simuOpenFOAM.MeshParts = [‘inlet - patch’, ‘outlet_Air - patch’, ‘outlet_Water - patch’]
AttributeError: ‘NoneType’ object has no attribute ‘MeshParts’
Inconsistency detected by dl-close.c: 811: _dl_close: Assertion `map->l_init_called’ failed!

If I remove this line also, I have the same error for “VolumeFields” too.
If i remove it also, I have finally this error :

Traceback (most recent call last):
File “/home/calculopenfoam/Bureau/”, line 26, in
simuOpenFOAMDisplay = Show(simuOpenFOAM, renderView1)
File “/home/calculopenfoam/OpenFOAM/ThirdParty-4.1/platforms/linux64Gcc/ParaView-5.0.1/lib/paraview-5.0/site-packages/paraview/”, line 397, in Show
raise RuntimeError, “Show() needs a proxy argument or that an active source is set.”
RuntimeError: Show() needs a proxy argument or that an active source is set.
Inconsistency detected by dl-close.c: 811: _dl_close: Assertion `map->l_init_called’ failed!

That bothers me as I want to work with the command tab, without opening manually paraview/working with the python shell.

with pvbatch, you should not use GetActiveSource but create your OpenFOAMReader yourself.
Start the trace before opening the file.

Thanks a lot Mathieu. I solved my problem using PVFoamReader instead of using GetActiveSource

1 Like