CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Graphical viewer for blockMeshDict (https://www.cfd-online.com/Forums/openfoam-pre-processing/61983-graphical-viewer-blockmeshdict.html)

grtabor January 30, 2009 05:42

Dear All, I have created an
 
Dear All,

I have created an application to view the block structure of blockMeshDicts graphically. Its a modified version of blockMesh which reads in the block structure in blockMeshDict and uses OpenGL and the FOX GUI toolkit to display this. It is fairly robust in that it will display what is actually written in the blockMeshDict (including errors) and I find it quite useful for correcting mistakes there. Its called simpleViewer, and I've uploaded it to /trunk/Breeder_1.5/utilities/preProcessing/simpleViewer on the SourceForge openfoam-extend project for distribution. (Or at least I think I've done this correctly; this is the first time I've done this. I can forsee a busy weekend, possibly).

http://www.cfd-online.com/OpenFOAM_D...es/1/10897.gif

Feel free to make use of it!

Gavin

rishi123 January 31, 2009 13:55

Hi Gavin, I am not able to
 
Hi Gavin,

I am not able to find the "simpleviewer" in the specified path, rather i am not able find the path. Could you pl. help me out in experiencing your unique package.

Thank you
Rishi

rishi123 January 31, 2009 13:55

Hi Gavin, I am not able to
 
Hi Gavin,

I am not able to find the "simpleviewer" in the specified path, rather i am not able find the path. Could you pl. help me out in experiencing your unique package?

Thank you
Rishi

grtabor January 31, 2009 18:50

Dear Rishi, Point your brow
 
Dear Rishi,

Point your browser at

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Breeder_ 1.5/utilities/preProcessing/simpleViewer/

Gavin

hani February 1, 2009 12:00

Hi Gavin, I have tried your
 
Hi Gavin,

I have tried your nice tool. Thank you for sharing it! I agree on how this could be developed in the future. Fox seems to have some nice functionality for creating GUIs. With this I can generate simple tailored GUIs for teaching with OpenfOAM as a black-box in the background.

I would like to propose to modify the following information:

In the README file:
Change:
./configure -prefix ~/OpenFOAM/ThirdParty/fox-1.6.34
to:
./configure --prefix $WM_THIRD_PARTY_DIR/fox-1.6.34
(The use of environment variables i really great! Note that I use two dashes: --prefix, but perhaps it is sufficient with one)
Then: Should EXE_LIBS really point at the src directory of the Fox installation? I had to make it point at the lib directory instead. The *.so files are in the lib directory.

In the Make/options file:
Change:
curvedEdges = ../blockMesh/curvedEdges
to:
curvedEdges = $(FOAM_UTILITIES)/mesh/generation/blockMesh/curvedEdges
Remove:
-I$(LIB_SRC)/foam/lnInclude
(there is no src/foam directory)
Change:
-I/opt/foam/OpenFOAM/ThirdParty/fox-1.6.34/include
to:
-I$(WM_THIRD_PARTY_DIR)/fox-1.6.34/include
Change:
-L/opt/foam/OpenFOAM/ThirdParty/fox-1.6.34/src
to:
-L$(WM_THIRD_PARTY_DIR)/fox-1.6.34/lib
(NOTE here that I had to use lib instead of src!!!)
In my case, my Linux installation does not have /usr/X11R6/include and lib, but I could just remove those. What are those needed for, since I could just remove them?
Are all those libraries that you are linking to really needed, or would it be possible to remove some of them?
It seems like you should remove one of the two times you specify:
-DHAVE_GL_H=1 -DHAVE_GLU_H=1
The following do not seem to be needed:
-L$(WM_PROJECT_USER_LIB)
-L/usr/local/lib
-DFULLDEBUG -g -O0

I have some graphical problems, but I think that has to do with my hardware. Your functionality works, but I have some distortion at start-up.

I will probably have a further look at this utility and future possibilities in the future.

Thanks again!
Håkan.

hani February 1, 2009 12:21

Hi, Also, I had to set the
 
Hi,

Also, I had to set the following i etc/bashrc:

export LD_LIBRARY_PATH=$WM_THIRD_PARTY_DIR/fox-1.6.34/lib:$LD_LIBRARY_PATH

Håkan.

grtabor February 2, 2009 08:43

Hi Hakan, Thanks for the fe
 
Hi Hakan,

Thanks for the feedback; I will try and make the suggested changes to the Makefiles (and some suggested by Bernhard Gschaider) in the next day or so. As for the additional libraries; I'm afraid that once something is working I very often stop fiddling with it; so I may have some redundancies cluttering up the Makefiles. Again; I'll have a look.

FOX is one of the nicest GUI toolkits available, IMHO. (FLTK is a good one as well from what I have seen). If you do want to put some sort of a GUI around OpenFOAM it would be a good choice.

Gavin

braennstroem February 7, 2009 09:12

Hi, nice work Gavin! May I
 
Hi,

nice work Gavin!
May I add, that there exist a quite nice fltk 'gui' for openfoam based on gmsh:
http://openfoamwiki.net/index.php/Contrib_gmshFoam

The definition of boundary conditions, models and solvers is still missing; otherwise it is a great tool might be a good base, if one does not use blockMesh.

Another option, maybe more enhanced than gmsh, could be some add-on for paraview or visit. The functionality for displaying the mesh, checking the quality is already there (at least in visit). As for gmsh one still needs a'small' plugin to set the boundary conditions, models and solvers...

The next, which comes to my mind, is to build something around engrid!? Though, it should be a tool which could prepare all openfoam conform meshes for the actual calculation. Does anyone know, if there is an import function in engrid for openfoam mesh?

Fabian

grtabor February 7, 2009 18:55

Hi Fabian, I don't know tha
 
Hi Fabian,

I don't know that an addon for paraview would be a good idea. From what I have seen, mesh generation is almost as complex a task as Cfd itself; to cover the geometry manipulation (either through built-in solid modelling or through import of eg. STL) and meshing would be a huge task, rather more than just an add-on! That being so, any features that paraview might bring would be relatively minor - you would be better off starting further back with VTK or even OpenGL. Same goes I think for VisIt. Personally, I am looking seriously at Cubit, about which I have heard good things, and OpenSALOME. With Cubit, unfortunately you don't get the source code, so either you have to rely on translation from the existing output formats, or someone needs to twist an arm at Sandia to write an OpenFOAM output. OpenSALOME looks better for this; it is opensource, so it would presumably be possible to write a native OpenFOAM export module.

Gavin

7islands February 7, 2009 19:32

Hi Fabian, Gavin, First of al
 
Hi Fabian, Gavin,
First of all, impressive work, Gavin. Said that, I'd like to agree to Fabian's opinion in every sense.

What I really wanted to show with gmsFoam was that what could be achieved by adding a small piece of code to existing software, rather than writing a GUI application from scratch. Along this line, an idea that hit me when I saw the blockMeshDict viewer was to add gmshFoam a functionality to import blockMeshDict as internal data structure of Gmsh geometry (represented as .geo files in human-readable form). With this approach a user can not only view the blockMeshDict geometry but also utilize all the Gmsh functionalities while being kept away from being enforced to learn how to use another software.

And the same can be said with regard to Fabian's opinion about ParaView and VisIt... My baseline thought is that opensourse softwares require more tight mutual integration to exploit a synergy effect.

Takuya

7islands February 7, 2009 19:44

Woops, I didn't realize Gavin'
 
Woops, I didn't realize Gavin's post until I pressed the post button... As to the meshing, you don't have to write all the mesing algorithm as there are Netgen and Gmsh meshers encapsuled to libraries. Salome's export module would be a nice idea as well.

Takuya

braennstroem February 8, 2009 04:17

Hi to both, yes, I forgot S
 
Hi to both,

yes, I forgot Salome. Somehow, I had the feeling, that it was a bit slow, but this was a quite old version and I did not use it long enough...

Greetings!
Fabian

egp March 9, 2009 00:18

Hi, I am building a virtual
 
Hi,

I am building a virtual machine based on opensuse 11.1 for training and for summer interns (who are given a windows box).

Anyway, I've built 1.5-dev, and simpleViewer compiles just fine. However, when I try to use it, a window is opened, but I get the following error:

[01:03:18][foamuser@linux:cavity]769$ simpleViewer
addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5-dev |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
Exec : simpleViewer
Date : Mar 09 2009
Time : 01:03:22
Host : linux-jei4
PID : 18825
Case : /home/foamuser/OpenFOAM/foamuser-1.5-dev/tutorials/icoFoam/cavity
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Reading block mesh description dictionary

Creating vertices

Creating curved edges

Creating blocks
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
glXUseXftFont: unable to render glyph.
Xft: locking error Attempt to close locked file


Any ideas where to look?

dmoroian March 25, 2009 08:36

Quote:

Originally Posted by egp (Post 180972)
...
glXUseXftFont: unable to render glyph.
Xft: locking error Attempt to close locked file

Hi Eric,
Are you running this over a nfs file system?
I rembemer some similar nfs related locking problems for many java applications (OpenOffice, Netbeans, ModeFrontier). One of the solutions was to run on a local file system the problematic application, whereas a more general solution was to upgrade the nfs server.

Dragos

Gamil April 2, 2009 13:15

I followed the instructions in the readme and it seemed to install and compile right, but when I try to use simpleViewer to open the icoFoam cavity tutorial it fail giving me this error

Code:

addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
addIstreamConstructorToTable
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.5                                  |
|  \\  /    A nd          | Web:      http://www.OpenFOAM.org              |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Exec  : simpleViewer
Date  : Apr 02 2009
Time  : 13:10:07
Host  : gamil-laptop-linux
PID    : 6602
Case  : /home/gamil/OpenFOAM/gamil-1.5/run/tutorials/icoFoam/cavity
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Reading block mesh description dictionary

Creating vertices

Creating curved edges

Creating blocks
#0  Foam::error::printStack(Foam::Ostream&) in "/home/gamil/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1  Foam::sigSegv::sigSegvHandler(int) in "/home/gamil/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2  Uninterpreted: [0xb7f5e420]
#3  ?? in "/usr/lib/libXft.so.2"
#4  XftLockFace in "/usr/lib/libXft.so.2"
#5  FX::glUseFXFont(FX::FXFont*, int, int, int) in "/usr/lib/libFOX-1.6.so.0"
#6  FX::FXGLGroup::draw(FX::FXGLViewer*) in "/usr/lib/libFOX-1.6.so.0"
Segmentation fault
gamil@gamil-laptop-linux:~/OpenFOAM/gamil-1.5/run/tutorials/icoFoam/cavity$
gamil@gamil-laptop-linux:~/OpenFOAM/gamil-1.5/run/tutorials/icoFoam/cavity$
gamil@gamil-laptop-linux:~/OpenFOAM/gamil-1.5/run/tutorials/icoFoam/cavity$


EDIT: I fixed the problem. i just had to the edit that Hani left out of the first list of fixes Hani, you're a life saver!

Ivooo February 23, 2012 05:09

Hi,

From the screenshots provided it looks like a really useful tool to me. After making some changes (see below), I can compile the program with OF2.1.0. Running the program on the cavity tutorial reads the blockmesh files and creates the window, but nothing is actually shown in the window + the program continues to consume more and more memory (needed to kill it before it started swapping). I guess that's because it's built upon the structure of blockMesh and related of V2.1, which of course has been changed since v1.5...

(how I made it compile)
Some minor changes required; I grabbed the updated version from here [1], updated references to some mathematical constants [2] and installed libfox-1.6-dev from ubuntu repositories (Ubuntu 11.10). Adding the include path to the Make/options file [3] makes sure you can find the header files, and the program compiles with wmake.

If someone updated this program I'll be happy to know about it :)

[1] http://openfoam-extend.svn.sourcefor...pleViewer_1.6/
[2] Change mathematicalConstant::pi to constant::mathematical::pi
[3] -I/usr/include/fox-1.6/ \

gschaider February 23, 2012 05:44

Quote:

Originally Posted by Ivooo (Post 345880)
Hi,

From the screenshots provided it looks like a really useful tool to me. After making some changes (see below), I can compile the program with OF2.1.0. Running the program on the cavity tutorial reads the blockmesh files and creates the window, but nothing is actually shown in the window + the program continues to consume more and more memory (needed to kill it before it started swapping). I guess that's because it's built upon the structure of blockMesh and related of V2.1, which of course has been changed since v1.5...

(how I made it compile)
Some minor changes required; I grabbed the updated version from here [1], updated references to some mathematical constants [2] and installed libfox-1.6-dev from ubuntu repositories (Ubuntu 11.10). Adding the include path to the Make/options file [3] makes sure you can find the header files, and the program compiles with wmake.

If someone updated this program I'll be happy to know about it :)

[1] http://openfoam-extend.svn.sourcefor...pleViewer_1.6/
[2] Change mathematicalConstant::pi to constant::mathematical::pi
[3] -I/usr/include/fox-1.6/ \

Just two pointers: since 2.0 OF has a Paraview-Reader that can display blockMesh. Haven't looked at that one too closely as I use http://openfoamwiki.net/index.php/Co...ayBlockMesh.py if I have to blockMesh

About the program you're referring to: I think it would be best to contact Gavin Tabor whether he is actively updating the program or whether he knows of any efforts. If there are no such efforts and you want to update the program then we can set you up with write access to the SVN

BTW: the problem you are experiencing probably has to do with the change of format. Have you tried it with a blockMesh from a 1.x-version?

Ivooo February 23, 2012 06:20

Quote:

Originally Posted by gschaider (Post 345887)
Just two pointers: since 2.0 OF has a Paraview-Reader that can display blockMesh. Haven't looked at that one too closely as I use http://openfoamwiki.net/index.php/Co...ayBlockMesh.py if I have to blockMesh

About the program you're referring to: I think it would be best to contact Gavin Tabor whether he is actively updating the program or whether he knows of any efforts. If there are no such efforts and you want to update the program then we can set you up with write access to the SVN

BTW: the problem you are experiencing probably has to do with the change of format. Have you tried it with a blockMesh from a 1.x-version?

Thanks for your reply. Actually, I was looking for that program you mention (I saw it a while ago, but I couldn't remember the name). So thanks for the link, I'll try that one too.

Besides, on OpenFOAM wiki I've found that running blockMesh with argument -blockTopology creates an .obj file that can be converted to .vtk and viewed in Paraview so you can view the blockMesh point locations+numbers, which is basically what I was looking for. It's funny how you will find a solution built into OpenFOAM itself 10 minutes after posting about it on the forum :)

I first need to get acquinted with OpenFOAM programming in general, so I guess I won't start with this program, especially since it involves the additional GL library.

Concerning your final point, yes, I tried to set up OF1.6 and compile but eventually I ran into some linking problems and I gave up (in retrospect, I should have tried V1.5 anyway).

wyldckat February 23, 2012 08:18

Greetings to all!

@Ivo: you can open ".obj" files directly on ParaView, without having to convert to ".vtk".
But better than that and as Bernhard implied, starting with OpenFOAM 2.0.0 we can run paraFoam with an additional option:
Code:

paraFoam -block
Best regards,
Bruno

Ivooo February 23, 2012 08:48

Quote:

Originally Posted by wyldckat (Post 345916)
Greetings to all!

@Ivo: you can open ".obj" files directly on ParaView, without having to convert to ".vtk".
But better than that and as Bernhard implied, starting with OpenFOAM 2.0.0 we can run paraFoam with an additional option:
Code:

paraFoam -block
Best regards,
Bruno

Thanks, that's really useful! The python script also shows patches, but it's nice to have these different options available to help with mesh generation.

vmsandip2011 March 10, 2013 07:42

simpleViewer
 
Hi

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Breeder_ 1.5/utilities/preProcessing/simpleViewer/

I am not able to open the above mentioned link , can somebody repost it again , I just want to see how it works .

with regards

GerhardHolzinger March 12, 2013 11:05

Quote:

Originally Posted by wyldckat (Post 345916)
Greetings to all!

But better than that and as Bernhard implied, starting with OpenFOAM 2.0.0 we can run paraFoam with an additional option:
Code:

paraFoam -block
Best regards,
Bruno

In my experience calling
Code:

paraFoam -block
works only when there are no errors in the blockMeshDict.
However, if you mess it up, and blockMesh aborts and reports a topological error, paraFoam won't work either, because there is no mesh to read.

But, you can always read blockMeshDict with pyFoamDisplayBlockMesh.py to display all nodes, patches and cells.

This really speeds finding the error up.


In the picture below (sorry for the huge image), a topological error prevents blockMesh from creating a mesh. Viewing the output of pyFoamDisplayBlockMesh.py indicates the root of the error.


http://openfoamwiki.net/images/1/1d/...yBlockMesh.png
http://openfoamwiki.net/index.php/Fi...yBlockMesh.png

vmsandip2011 March 14, 2013 03:05

simpleviewer
 
Hi
Gerhard .
Thanks for the reply .
I will try this one to visualize blockMesh .But my intention was to see the code , how simpleViewer is reading the blockMesh .with regards


All times are GMT -4. The time now is 00:50.