CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Native ParaView Reader Bugs (https://www.cfd-online.com/Forums/paraview/61047-native-paraview-reader-bugs.html)

jam April 3, 2008 10:40

Hi Takuya, I am having troubl
 
Hi Takuya,
I am having trouble reading the foam files: I suppose the reader should appear as a list of possible readers in the pop-up list; it is not!

I compiled as per your instructions, I grep the reader in the library files, it is there.
I am using OF1.4.1-dev an Paraview3.2

Where should I look to get it to work?

jam April 3, 2008 18:08

Sorry, I should have downloade
 
Sorry, I should have downloaded Paraview3.3.? instead.

7islands April 3, 2008 19:01

Hi Alain, You can use ParaV
 
Hi Alain,

You can use ParaView 3.2.1. In that case you have to add<pre> <Reader name="OpenFOAMReader"
extensions="foam"
file_description="OpenFOAM Files">
</reader></pre> to somewhere in ParaView3.2.1/Qt/Components/Resources/XML/ParaViewReaders.xml.

Takuya

jam April 4, 2008 07:25

Thank you Takuya, All I can s
 
Thank you Takuya,
All I can say is WOW!
-Alain

kar April 12, 2008 10:07

Hello, tried compiling Para
 
Hello,

tried compiling ParaView 3.2.1 and 3.3-dev, but hit in the problems with gl* things.

For 3.2.1 one sample is this:

/home/cpp/OpenFOAM/linux64/4compile/ParaView3/VTK/GUISupport/Qt/QVTKWidget.cxx: In member function 'void QVTKWidget::x11_setup_window()':
/home/cpp/OpenFOAM/linux64/4compile/ParaView3/VTK/GUISupport/Qt/QVTKWidget.cxx:1 305: error: 'XVisualInfo' was not declared in this scope
/home/cpp/OpenFOAM/linux64/4compile/ParaView3/VTK/GUISupport/Qt/QVTKWidget.cxx:1 305: error: 'vi' was not declared in this scope
/home/cpp/OpenFOAM/linux64/4compile/ParaView3/VTK/GUISupport/Qt/QVTKWidget.cxx:1 306: error: 'Colormap' was not declared in this scope
/home/cpp/OpenFOAM/linux64/4compile/ParaView3/VTK/GUISupport/Qt/QVTKWidget.cxx:1 306: error: expected `;' before 'cmap'

For 3.3-dev I received bunch of unresolved or undefined functions whose name begin with "gl".

Relevant ccmake variables:

OPENGL_gl_LIBRARY OPENGL_gl_LIBRARY-NOTFOUND
OPENGL_glu_LIBRARY /usr/lib/libGLU.so
OPENGL_xmesa_INCLUDE_DIR /usr/include

Tried 4.2.3 for PV 3.2.1 and 4.3.? for 3.3-dev; last one was emerged with portage.
That is amd64 machine. Obviously something is wrong with gl - it cannot be found. How to fix that? Thanks!

Kārlis

7islands April 12, 2008 10:37

Hi Kārlis, Hmm I have never
 
Hi Kārlis,
Hmm I have never had such a problem... anyone else?

Guessing from your use of emerge are you a Gentoo user? I recently found a bug tracker page for ParaView-3.2.1 on Gentoo [1]. Looking through the page the ParaView package on Gentoo seems to have the 20071023 version of the native reader included, but I haven't tried by myself as I'm not a Gentoo user. You might (or might not) be able to try the package as a starting point if you are a Gentoo user.

[1] http://bugs.gentoo.org/show_bug.cgi?id=202685

Takuya

kar April 12, 2008 11:23

Hi Takuya! Sure, I tried to
 
Hi Takuya!

Sure, I tried to emerge ParaView, but since it was paraview 3.2.1 and it didn't tried to take qt 4.2.3 (4.(<3)) as a dependency, I stopped to believe it will work good. Isn't paraview3.2.1 requiring qt 4.2.3?

I tried like this too:
OPENGL_gl_LIBRARY /usr/lib/libGLw.so <--- no libGL.so present there...
OPENGL_glu_LIBRARY /usr/lib/libGLU.so

But compile gave me this 2>

/tmp/ccG1spNb.s: Assembler messages:
/tmp/ccG1spNb.s:799: Error: suffix or operands invalid for `xchg'
make[2]: *** [VTK/GUISupport/Qt/CMakeFiles/QVTKWidgetPlugin.dir/Q4VTKWidgetPlugin.o] Error 1

Also paraview on gentoo amd64 is masked, which indicates some problems. Not sure, but amd64 could be affected platform.

So, openGL is installed somehow by default; this time it has to be reinstalled, I guess...

Kārlis

kar April 12, 2008 11:31

Forgot to mention one more thi
 
Forgot to mention one more thing: there is no driver for my particular video card installed but "vesa", which doesn't support direct rendering etc. Maybe that is the problem? I'll check how PV servers are compiled with no hardware rendering (but this is ridiculous - I have Radeon X1200!).

philippose April 12, 2008 12:54

Hello Kārlis, You mentione
 
Hello Kārlis,

You mentioned that you have a Radeon X1200... have you tried installing the ATI Drivers for Linux? Normally, you should have the fglrx driver, which gives you complete hardware acceleration, and the works.

As for the open source version... Fedora comes with an open source version of the ATI drivers.. I think its called "radeon". I think the same drivers are also available for OpenSuse, and I dont see any reason why it would not be available for Gentoo also...

I am not sure if the normal "vesa" fallback vga drivers would support OpenGL...

Also, have you checked in the "/usr/lib64", if there are either the opengl libraries, or a sub-folder with the opengl libraries on your system?

Have a nice day!

Philippose

kar April 12, 2008 13:31

Hello Philippose, thanks fo
 
Hello Philippose,

thanks for advices, but the thing is: since fglrx binary failed to work with my kernel, I have to use radeonhd<- driver, which is still in testing stage (radeon is too old)...

Suppose, opengl fails to work with vesa, but it fails to compile!
Some clearance about openGL/mesa would be useful here...

amd ~ # ls /usr/lib64/libGL*so
/usr/lib64/libGL.so /usr/lib64/libGLU.so /usr/lib64/libGLw.so

/usr/include has GL folder, but
OPENGL_xmesa_INCLUDE_DIR /usr/include -- where should that be?

Well, if you have some idea...

K.

philippose April 12, 2008 14:27

Hello again, I was just loo
 
Hello again,

I was just looking through my CMake configuration list (which can be obtained by using cmake -LA [source root]), and these are the paths I got for the OpenGL related settings:

OPENGL_INCLUDE_DIR:PATH=/usr/include
OPENGL_gl_LIBRARY:FILEPATH=/usr/lib/libGL.so
OPENGL_glu_LIBRARY:FILEPATH=/usr/lib/libGLU.so
OPENGL_xmesa_INCLUDE_DIR:PATH=/usr/include

And these are the OpenGL related libraries I have (I use a 32-bit system...so...):

/usr/lib/libGLEW.so
/usr/lib/libGL.so
/usr/lib/libGLU.so

In my /usr/include folder, I have a sub-folder known as "GL"... in this sub-folder, I have the following headers:

glext.h
gl.h
gl_mangle.h
glu.h
glu_mangle.h
glxext.h
glx.h
glxint.h
glx_mangle.h
glxmd.h
glxproto.h
glxtokens.h
internal
xmesa.h
xmesa_xf86.h
xmesa_x.h

Since cmake uses "/usr/include" as the path for the OpenGL and the xmesa headers, I am assuming that it automatically appends the "GL" bit to it to get to the header files....

You need to check if you have these files in the include folder... if not, you need to install the "devel" package for mesa and glx...

I think in Gentoo, that would be something like typing "emerge mesa" as root on the command-line.

As for the ATI drivers... I am sure you have already found this website... but then... here it is anyway :-)! Maybe you can get the drivers working...:

http://gentoo-wiki.com/HOWTO_ATI_Drivers


Hope this helps :-)!

Enjoy!

Philippose

kar April 12, 2008 14:47

Ok, just successfully compiled
 
Ok, just successfully compiled ParaView-3.3dev.
At least these things where wrong:

1. needed to set

OPENGL_INCLUDE_DIR: /usr/include
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
OPENGL_glu_LIBRARY: /usr/lib64/libGLU.so
OPENGL_xmesa_INCLUDE_DIR: /usr/include

2. needed to compile with gcc 4.2, not 4.1.

Now I get errors because of GLX. But that is a videocard problem... Progress has been achieved http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Now I'll try to fight radeonhd.

Kārlis

philippose April 12, 2008 17:39

Hi Kārlis, Cool to see tha
 
Hi Kārlis,

Cool to see that you got it working :-)!

One comment though... its really weird that you had to compile Paraview with gcc 4.2, because I use gcc 4.1.2 on my system.... So it must be due to some other dependencies that it did not work with gcc 4.1, unless the minor version "4.1.2" made a difference in my case.

As for the radeon drivers.... I am sure it is not too difficult to get the hardware rendering versions up and running....

Have a nice day!

Philippose

kar April 14, 2008 15:46

Hello again, this time AVI
 
Hello again,

this time AVI video file creating problems:

ERROR: In /home/cpp/OpenFOAM/linux64/4compile/ParaView-3.3dev/VTK/IO/vtkFFMPEGWriter.cxx, line 447
vtkFFMPEGWriter (0x1241350): Error initializing video stream.

Looking at ccmake configuration I have:

FFMPEG_INCLUDE_DIR /usr/include
FFMPEG_avcodec_LIBRARY /usr/lib64/libavcodec.so
FFMPEG_avformat_LIBRARY /usr/lib64/libavformat.so
FFMPEG_avutil_LIBRARY /usr/lib64/libavutil.so
FFMPEG_dc1394_LIBRARY /usr/lib64/libdc1394_control.so
FFMPEG_dts_LIBRARY FFMPEG_dts_LIBRARY-NOTFOUND
FFMPEG_gsm_LIBRARY /usr/lib64/libgsm.so
FFMPEG_theora_LIBRARY /usr/lib64/libtheora.so
FFMPEG_vorbis_LIBRARY /usr/lib64/libvorbis.so
FFMPEG_vorbisenc_LIBRARY /usr/lib64/libvorbisenc.so

Couldn't find how to install FFMPEG_dts_LIBRARY.. Maybe that is the one making problem? Not sure, because libdts's supplicant is libdca - a free DTS Coherent Acoustics decoder.

Kārlis

philippose April 15, 2008 13:10

Hi, and a Good Evening :-)!
 
Hi, and a Good Evening :-)!

Soo... AVI Creation problems... Since I had never tried it with ParaView in Linux before, I only realised that this problem existed last evening :-)!

Anyway.... if you run ParaView from the command line, in the console you will see a couple more error messages before ParaView opens up the message window to show the "Error initializing video stream" error.

Basically, it seems to be a bug in the vtkFFMPEGWriter.cxx file... or, an inconsistency in the ffmpeg libraries.

The "real" error is... "bitrate tolerance too small for selected bitrate" or something to that effect.

This is thrown by the ffmpeg codec initialisation function, because in vtkFFMPEGWriter, no value has been set for the ffmpeg variable "bit_rate_tolerance", which is required during the initialisation.

After a little checking around online, and a little snooping around in vtkFFMPEGWriter, I was able to solve the problem by adding the following line at source-code line 161 in vtkFFMPEGWriter.cxx:

c->bit_rate_tolerance = c->bit_rate * 20;

I know.... you may be wondering why the tolerance on bit-rate variation would be 20 times the bit-rate itself :-)! Well... that seems to be the default value used by some other programs which use the FFMPEG libraries :-)!

Funnily, I tried various more "logical" values like 1% of bit-rate..... 50% of bit-rate... etc...etc.... It only started working when I set the tolerance to be equal to the bit-rate and higher.... :-)!

A recompile of Paraview after this change... and poof... it worked....

However.... I was not able to play the resulting animation with the VLC Player (I have experienced this with some AVI files in Linux before)... the writer uses the MPEG4 codec, and I dont know if there is a problem with this codec and VLC...

Enjoy :-)!

Philippose

jaswi May 12, 2008 11:18

Hi Philippose Thanks for th
 
Hi Philippose

Thanks for the information :-).
Just wanted to cross check about the modification:

I have added this line

c->bit_rate_tolerance = c->bit_rate * 20;

after the closing bracket of this switch

switch (this->Writer->GetQuality())
{
case_0:
c->bit_rate = 3*1024*1024;
break;
case_1:
c->bit_rate = 6*1024*1024;
break;
default:
c->bit_rate = 12*1024*1024;
break;
}

Regards
Jaswi

philippose May 12, 2008 12:03

Hello Jaswinder, That shoul
 
Hello Jaswinder,

That should be about right...

But then.... I found that though this works, as I mentioned in the post, I was not able to play any of the animations created by Paraview in Linux.

What I do now, is to save the images as a sequence of JPGs, and then use "mencoder" to convert the sequence into an AVI.

This method comes up with really nice looking high resolution animations, and you have much better control over the frame-rates, etc....

Have a nice day!

Philippose

jaswi May 12, 2008 12:30

Hi Philippose Thanks for th
 
Hi Philippose

Thanks for the confirmation.

There is one more thing troubling me. I have installed SUSE 10.3 and it comes with Qt 4.3.1. While processing CMakeList.txt for the paraview compilation, the cmake says it doesn't supports Qt 4.3.1 and suggests to use Qt 4.2

For the time being, I have ignored that error and the compilation is in process.

Do you think that will be a problem later ?.

Regards
Jaswi

kar May 12, 2008 12:31

Philippose, I wanted to say t
 
Philippose,
I wanted to say thank you for your responsiveness and optimism!
That is probably the best idea to use jpg->avi with some other soft., because this far ParaView is not very handy for avi-s. Actually there are quite many little, incomplete parts and some doesn't work at all, but that's another thing... (however, as long as encoders are used externally, process is much longer and sometimes redundant)

k.

7islands May 12, 2008 19:05

Hi Jaswinder, I'm afraid it w
 
Hi Jaswinder,
I'm afraid it will (as far as I tested on openSUSE 10.3 x86_64+stock Qt 4.3.1). After you click the VCR Play button the VCR control buttons will all be grayed out and can't stop the animation until all frames are drawn. As far as I know the simple solutions are to compile Qt-4.2 by yourself or use the 3.3-CVS version of ParaView. Backporting the fix in 3.3-CVS to 3.2.1 may be possible but I have never tried it.

If you go to the PV3.2.1+Qt4.2 way I recommend setting CMAKE_USE_RPATH to on and run the binary in-place (without doing make install) so that the correct Qt version is bound.

Takuya

7islands May 16, 2008 20:11

Hi, I just noticed on 3.3-CVS
 
Hi,
I just noticed on 3.3-CVS newer than 12th May it is now possible to run the Surface Flow filter after running the Merge Blocks filter over the reader output (Merge Blocks works as a converter from the reader output data type to the data type Surface Flow accepts). However the calculated value of Surface Flow should be taken only as a rough indication. Using calcMassFlow is recommended for accuracy.

Takuya

mgz1985 July 19, 2008 17:30

hi takuya.. in response to
 
hi takuya..

in response to one of your post

You can use ParaView 3.2.1. In that case you have to add

<Reader name="OpenFOAMReader"
extensions="foam"
file_description="OpenFOAM Files">
</reader>
to somewhere in ParaView3.2.1/Qt/Components/Resources/XML/ParaViewReaders.xml.

I would like to ask an alternative to the above solutionas. i cant locate this directory or file in my version of paraview which is 3.2.1. i had downloaded a diskimage and have it installed on m Mac OSX. everything works with openfoam but when it comes to paraFoam command i get an error for the paraview command not found.

I have tried a lot to debug it by whatever i have on the internet, it does not seem to be working. could you please help me

podallaire July 21, 2008 21:02

Hey Takuya, I wanted to kno
 
Hey Takuya,

I wanted to know if the new PV3FoamReader libs (in OF-1.5) are derived from your patch... ?

I'm still using your patch with the latest cvs version and I find it very good, really stable (good work Takuya) ! However, I tried the new PV3FoamReader but it crashes really easily, not sure what is the problem.

Best regards,

PO

7islands July 22, 2008 05:41

Hi Pierre-Olivier, I'm so g
 
Hi Pierre-Olivier,

I'm so glad you noticed the stability of the native reader. Indeed the fact that PVFoamReader (for ParaView2 at that time) was basically made to crash even with a minor error was one of the good reasons I decided to go to the "native" way. And please don't overlook the contributions of the community, most notably a great amount of help I got from Philippose in testing the reader in its early development stage.

As to your question, the native reader and PV3FoamReader are quite different in philosophy and implementation so I guess (just a guess, have no clue) there was almost nothing they could derive from the native reader.

Takuya

olwi July 22, 2008 07:02

Hi, Question for Takuya: Is
 
Hi,

Question for Takuya: Is your native reader part of the official paraview cvs, or will the manual patching still be necessary?

Congratulations on your good work.

Best regards,

Ola

deepblue17 July 22, 2008 12:45

Hello, I've patched the Par
 
Hello,

I've patched the ParaView-3.3_pre20080514 package from gentoo Linux with the vtkOpenFOAMReader-20080324.tar.bz2. Compilation was fine. But when I tried to open the cavity case, which was computed with OpenFOAM-1.5, I got the following error message:

ERROR: In /var/tmp/portage/sci-cae/paraview-3.3_pre20080514/work/ParaView3/VTK/IO/vtkOpenF OAMReader.cxx, line 3851
vtkOpenFOAMReader (0x136e6e0): Numbers of faces in owner and neighbor don't match

When I compared the cavity/constant/polyMesh/neighbour file between OF-1.4.1 and OF-1.5, then there are some major differences. It seems to me, that the blockMesh utility has had some changes between the versions.

When I'm trying the native Openfoam Reader in ParaView, then the Paraview GUI gets frozen, without any error messages.

Can somebody repoduce this?

Best regards,
Oliver Borm

podallaire July 22, 2008 13:10

Yes, I confirm, I have the sam
 
Yes, I confirm, I have the same here.

PO

7islands July 22, 2008 20:23

That's a known issue. I'm work
 
That's a known issue. I'm working on this (plus some other new extensions introduced in OF 1.5) and will post a new version soon.

@Ola: you still have to do patching, but making the reader to be included into the official paraview cvs is getting higher priority in my to-do list.

Takuya

podallaire July 23, 2008 00:01

Thanks Takuya - that's a good
 
Thanks Takuya - that's a good news !

Furthermore, I realized today that, for some reasons, volume rendering is not available in the Paraview version provided in ThirdParty. I really prefer to download fresh cvs versions and to apply your patch + commenting some lines starting at # 3651 in vtkOpenFOAMreader.cxx.

Best regards,

PO

gschaider July 23, 2008 04:34

Hi PO! I beg to differ: Vol
 
Hi PO!

I beg to differ: Volume rendering works both on my Mac and my Linux-machines AND it is the first version of paraview where Volume-rendering does not crash paraview on a regular basis (for me)

Bernhard

podallaire July 23, 2008 06:48

That's strange - I compiled ye
 
That's strange - I compiled yesterday the Paraview3.3-cvs version with PV3FoamReader on both Mac and Linux and could not have the volume rendering option. After seeing that, I download the latest CVS version, applied the native reader patch and recompiled again on both architecture; volume rendering was there.

PO

gschaider July 23, 2008 07:50

It's a bit strange: if I selec
 
It's a bit strange: if I select ONLY the "Internal Mesh" during the initial "Apply" I can do volume rendering. If I select patches as well I can't. Selecting patches afterwards leaves the rendering capability intact. In some very weird way this makes sense

Bernhard

7islands July 28, 2008 10:31

Hi all, Sorry to have kept yo
 
Hi all,
Sorry to have kept you all long - here's a new version of the reader.

This time the main focus of the update was directed to supporting the new extended OF 1.5 file format, resolving cell-to-point filter issues in several corner cases and small usability improvements. Although they may sound rather unimpressive and almost unnoticeable from userland, with increasing number of real productive users I gave them the highest priority.

The reader can coexist with PV3FoamReader side by side. But as usual, please have a careful look through http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif ReleaseNotes and proceed if you think it's worth trying.

This time the packages comes in two flavors, but the reader codes themselves are identical. One is for manual installation procedure as has been used from previous versions http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif vtkOpenFOAMReader-20080728.tar.bz2 and another comes with an automated pre-installation script contributed by Mark Olesen. http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif vtkOpenFOAMReader-scriptedPreInstall-20080728.tar.bz2 as far as I tried, the script works at least for the ThirdParty 3.3-CVS version of ParaView installed under default settings, but not so extensively tested. If it works for you as well, the installation procedure is as simple as
<pre> ./preInstall.sh; buildParaView3.3-cvs 1</pre>and would take only a minute or two if you have built your own binary of the ThirdParty ParaView.

My thanks go to Mark Olesen and Pierre-Olivier Dallaire for helping me a lot with testings and so on.

Hope this is useful to you,
Takuya

podallaire July 28, 2008 11:47

You'll see - this reader is re
 
You'll see - this reader is really fast and robust.
Thanks Takuya, it's a very important contribution.

Best regards,

PO

johannes July 30, 2008 04:12

Hi, thank you very much for
 
Hi,

thank you very much for the new version of the reader. I was using the former version till now and was very pleased with it.

As I'm currently postprocessing multi region meshes, I've a few questions regarding a quick 'hack' to load a second mesh region until the reader supports this feature itself in a future release.

The solver I'm working with is placing all the files of the second mesh region in a subdirectory within the main case, e.g. &hellip;/system/secondMesh/controlDict instead of &hellip;/system/controlDict, the same for the time and mesh directories.

What I'm thinking about is a duplicate of the original OpenFOAMReader which reads this subdirectory. Ideally, the name of the subdirectory could be changed without the need to recompile the reader.

Unfortunately I even did not succeed in getting a second unmodified OpenFOAMReader to work as ParaView 3.3.0 crashes when trying to open a case with it.
I created copies of ../Paraview3/VTK/IO/vtkOpenFOAMReader.cxx and *.h, renamed them and modified /ParaView3/Servers/ServerManager/Resources/readers.xml and /ParaView3/Qt/Components/Resources/XML/ParaViewReaders.xml accordingly. Recompilation showed no errors. Which parts of the ParaView source do I else have do modify?

Thanks in advance,

Johannes

7islands July 30, 2008 05:31

Hi Johannes, I guess the only
 
Hi Johannes,
I guess the only missing piece is to add your renamed reader to ParaView3/VTK/IO/CMakeLists.txt. And you may have to start over from running CMake.

Takuya

johannes August 1, 2008 03:05

Hi Takuya, thanks for your
 
Hi Takuya,

thanks for your hint, this entry in CMakeLists was missing indeed.
Unfortunately I'm now getting compilation errors caused by the renamed reader. I'll post them here if can't get them sortetd out soon.

Best regards,
Johannes

richard August 5, 2008 03:03

Hi, I've been having some p
 
Hi,

I've been having some problems with ParaView - after getting Qt4.3.4 and recompiling as in the readme I can now open paraView and it wont crash.
However it's not displaying anything when I try to load case data. It uses cpu time as if it's loading data and the time directories are shown in the top right scroll bar but the window remains black and the display tab empty..
Help? I'm a pretty well stuck atm..

Thanks,
Richard.

7islands August 5, 2008 08:47

Hi Richard, Assuming you are
 
Hi Richard,
Assuming you are using PV3FoamReader, did you select at least one mesh region in the reader panel?

Takuya

richard August 5, 2008 20:52

Hi Takuya, Yes, PV3FoamRead
 
Hi Takuya,

Yes, PV3FoamReader and I tried loading in all mesh regions.. I'm using Ubuntu 8.04 on that machine, and I've since tried on suse 10.2 and after the same procedures it worked fine (I can see it's worth the effort, it's fantastic and really fast!).

I still want it to work on Ubuntu, could I be missing a graphics package or something..?


All times are GMT -4. The time now is 05:57.