CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[PyFoam] Problem with pyFoamPVSnapshot

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2017, 09:19
Default Problem with pyFoamPVSnapshot
  #1
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
Hello everyone,

I started working with OpenFOAM not so long ago, but I already know a little about PyFoam.
Generally, I used 'pyFoamRunParameterVariation' utility and all was fine. But then I tried to use 'pyFoamPVSnapshot' utility and faced a problem, that I can't solve myself.

Here is some configuration info:
OS: Ubuntu 16.04.3 LTS
OpenFOAM-2.4.0
ParaView 4.1.0
PyFoam version: 0.6.7 (installed with pip)

I used the utility in the following way:
Code:
pyFoamPVSnapshot.py --latest-time --state-file=default.pvsm damBreak
The 'default.pvsm' file was prepared earlier through ParaView.

And here is what I got:
Code:
Executing PVSnapshot with pvpython trough a proxy-script
Warning in /tmp/pyFoamPVSnapshot_8h6vxh3u.py : Setting decomposed type to auto : Decomposed/Reconstruced correctly set. Nothing changed
PyFoam WARNING on line 110 of file /usr/local/lib/python3.5/dist-packages/PyFoam/Paraview/ServermanagerWrapper.py : Can't find expected plugin 'libPOpenFOAMReaderPlugin' assuming that correct reader is compiled in. Wish me luck Traceback (most recent call last):
  File "/tmp/pyFoamPVSnapshot_8h6vxh3u.py", line 4, in <module>
    PVSnapshot()
  File "/usr/local/lib/python3.5/dist-packages/PyFoam/Applications/PVSnapshot.py", line 51, in __init__
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 436, in __init__
    result=self.run()
  File "/usr/local/lib/python3.5/dist-packages/PyFoam/Applications/PVSnapshot.py", line 493, in run
    views=pvs.GetViews()
AttributeError: 'module' object has no attribute 'GetViews'
Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion `map->l_init_called' failed!
Error: Return code  127 executing /tmp/pyFoamPVSnapshot_8h6vxh3u.py
I tried to investigate these 'warnings' and came to the conclusion, that they are not critical (cause I've seen them in some presentations).
The line starting with "Inconsistency detected by ld.so.." also doesn't important. I ran 'pyFoamPVSnapshot' utility on another virtual machine with Ubuntu 14.04 (OF2.4.0, PV4.1.0, PyFoam 0.6.8.1) and got almost the same error except this line. But the error "AttributeError: 'module' object has no attribute 'GetViews'" still exist.

Any help would be appreciated.


Regards, Pavel
Pavel Rodin is offline   Reply With Quote

Old   September 22, 2017, 07:46
Default
  #2
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
<slowpoke mode deactivated>

Okay.. 'PVSnapshot.py' contains these lines:
Quote:
import paraview.simple as pvs
...
views=pvs.GetViews()
but module 'simple.py' located in "~/OpenFOAM/ThirdParty-2.4.0/ParaView-4.1.0/Wrapping/Python/paraview/simple.py" really doesn't have 'GetViews' method. And I'm getting this AttributeError.

So the problem is ParaView version? And there is nothing I can do about it?
Pavel Rodin is offline   Reply With Quote

Old   September 22, 2017, 09:18
Default
  #3
New Member
 
Join Date: Apr 2016
Posts: 21
Rep Power: 10
robob is on a distinguished road
Have you set a Text source with the content %(casename)s ?
robob is offline   Reply With Quote

Old   September 22, 2017, 10:13
Default
  #4
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
Quote:
Originally Posted by robob View Post
Have you set a Text source with the content %(casename)s ?
Don't quite understand what is about. I did not perform any additional actions after installation of PyFoam. Just played a bit with PYTHONPATH and set it following way:
Code:
export PYTHONPATH=$ParaView_DIR/lib/paraview-4.1/
But looks like it doesn't helped (and did anything at all).
Pavel Rodin is offline   Reply With Quote

Old   September 23, 2017, 11:49
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Pavel Rodin View Post
<slowpoke mode deactivated>

Okay.. 'PVSnapshot.py' contains these lines:

but module 'simple.py' located in "~/OpenFOAM/ThirdParty-2.4.0/ParaView-4.1.0/Wrapping/Python/paraview/simple.py" really doesn't have 'GetViews' method. And I'm getting this AttributeError.

So the problem is ParaView version? And there is nothing I can do about it?
Problem is that the API of Paraview was constantly changing. Especially before going to 5.0. I checked: the .GetViews()-line was written in March 2015. The latest Paraview version at the time was 4.3.1. So it might be possible that I worked with that or 4.2 but not with 4.1. I will have a look in the office whether I still have a 4.1 to see if that is a problem.

But since it was written that line works for me (currently use 5.4) so upgrading paraview to a more recent version might fix your problem (and you won't have to rely on me having time to look at that)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   September 25, 2017, 01:55
Default
  #6
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Problem is that the API of Paraview was constantly changing. Especially before going to 5.0. I checked: the .GetViews()-line was written in March 2015. The latest Paraview version at the time was 4.3.1. So it might be possible that I worked with that or 4.2 but not with 4.1. I will have a look in the office whether I still have a 4.1 to see if that is a problem.

But since it was written that line works for me (currently use 5.4) so upgrading paraview to a more recent version might fix your problem (and you won't have to rely on me having time to look at that)
Thanks for info, Bernhard.
Actually I was thinking about it too. I'll try another version of ParaView.
Pavel Rodin is offline   Reply With Quote

Old   September 26, 2017, 08:03
Default
  #7
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
So.. I tried to run 'PVSnapshot.py' utility with another version of ParaView (4.3.1) and here is what I got:
Code:
Executing PVSnapshot with pvpython trough a proxy-script
/home/prodin/Distrib/ParaView-4.3.1/lib/paraview-4.3/pvpython: error while loading shared libraries: libvtkPVServerManagerApplication-pv4.3.so.1: cannot open shared object file: No such file or directory
Error: Return code  127 executing /tmp/pyFoamPVSnapshot_pvtj9dn9.py
But the file named 'libvtkPVServerManagerApplication-pv4.3.so.1' definitely exists.
Is this some kind of permissions issue?

Last edited by Pavel Rodin; September 26, 2017 at 10:13. Reason: Found the answer to the question, but there is another question.
Pavel Rodin is offline   Reply With Quote

Old   September 27, 2017, 06:30
Default
  #8
New Member
 
Pavel Rodin
Join Date: Jun 2017
Posts: 8
Rep Power: 8
Pavel Rodin is on a distinguished road
I'm getting the same error with ParaView's version 5.2.0.
Seems I can't use ParaView as a portable program in that way (i.e. just changing the PATH variable).
But if I install Paraview using apt-get (currently of version 5.0.1), then I can make a screenshot through PVSnapshot utility.
Now I'm curious how to run the utility on a few case variations (e.g. after 'pyFoamRunParameterVariation.py' script execution).
Pavel Rodin is offline   Reply With Quote

Reply


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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 12:35.