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

Graphical viewer for blockMeshDict

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2009, 06:42
Default Dear All, I have created an
  #1
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
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).



Feel free to make use of it!

Gavin
Sune, jferrari, skeptik and 5 others like this.
grtabor is offline   Reply With Quote

Old   January 31, 2009, 14:55
Default Hi Gavin, I am not able to
  #2
New Member
 
Sayantan Datta Gupta
Join Date: Mar 2009
Location: Chennai, Tamilnadu, India
Posts: 16
Rep Power: 17
rishi123 is on a distinguished road
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
__________________
Rishi
rishi123 is offline   Reply With Quote

Old   January 31, 2009, 14:55
Default Hi Gavin, I am not able to
  #3
New Member
 
Sayantan Datta Gupta
Join Date: Mar 2009
Location: Chennai, Tamilnadu, India
Posts: 16
Rep Power: 17
rishi123 is on a distinguished road
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
__________________
Rishi
rishi123 is offline   Reply With Quote

Old   January 31, 2009, 19:50
Default Dear Rishi, Point your brow
  #4
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
Dear Rishi,

Point your browser at

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

Gavin
grtabor is offline   Reply With Quote

Old   February 1, 2009, 13:00
Default Hi Gavin, I have tried your
  #5
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
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 is offline   Reply With Quote

Old   February 1, 2009, 13:21
Default Hi, Also, I had to set the
  #6
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
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.
hani is offline   Reply With Quote

Old   February 2, 2009, 09:43
Default Hi Hakan, Thanks for the fe
  #7
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
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
grtabor is offline   Reply With Quote

Old   February 7, 2009, 10:12
Default Hi, nice work Gavin! May I
  #8
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
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
braennstroem is offline   Reply With Quote

Old   February 7, 2009, 19:55
Default Hi Fabian, I don't know tha
  #9
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
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
grtabor is offline   Reply With Quote

Old   February 7, 2009, 20:32
Default Hi Fabian, Gavin, First of al
  #10
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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 is offline   Reply With Quote

Old   February 7, 2009, 20:44
Default Woops, I didn't realize Gavin'
  #11
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   February 8, 2009, 05:17
Default Hi to both, yes, I forgot S
  #12
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
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
braennstroem is offline   Reply With Quote

Old   March 9, 2009, 01:18
Default Hi, I am building a virtual
  #13
egp
Senior Member
 
egp's Avatar
 
Eric Paterson
Join Date: Mar 2009
Location: Blacksburg, VA
Posts: 197
Blog Entries: 1
Rep Power: 18
egp is on a distinguished road
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?
egp is offline   Reply With Quote

Old   March 25, 2009, 09:36
Default
  #14
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Quote:
Originally Posted by egp View Post
...
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
dmoroian is offline   Reply With Quote

Old   April 2, 2009, 14:15
Default
  #15
New Member
 
Philip Kunz
Join Date: Mar 2009
Posts: 4
Rep Power: 17
Gamil is on a distinguished road
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!

Last edited by Gamil; April 2, 2009 at 14:19. Reason: fixed problem
Gamil is offline   Reply With Quote

Old   February 23, 2012, 06:09
Default
  #16
New Member
 
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14
Ivooo is on a distinguished road
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:i to constant::mathematical:i
[3] -I/usr/include/fox-1.6/ \
Ivooo is offline   Reply With Quote

Old   February 23, 2012, 06:44
Default
  #17
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 Ivooo View Post
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:i to constant::mathematical:i
[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?
gschaider is offline   Reply With Quote

Old   February 23, 2012, 07:20
Default
  #18
New Member
 
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14
Ivooo is on a distinguished road
Quote:
Originally Posted by gschaider View Post
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).
Ivooo is offline   Reply With Quote

Old   February 23, 2012, 09:18
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   February 23, 2012, 09:48
Default
  #20
New Member
 
Ivo
Join Date: Feb 2012
Posts: 26
Rep Power: 14
Ivooo is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
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.
Ivooo 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
[blockMesh] MergePatchPairs in blockMeshDict lord_kossity OpenFOAM Meshing & Mesh Conversion 0 April 15, 2008 03:28
[blockMesh] BlockMeshDict keywords msrinath80 OpenFOAM Meshing & Mesh Conversion 2 September 20, 2007 10:14
Graphical error hesam FLUENT 0 February 10, 2007 05:15
[blockMesh] Trouble with my first blockMeshDict file osimonsimon OpenFOAM Meshing & Mesh Conversion 1 October 13, 2006 15:32
Graphical technics indd Main CFD Forum 2 October 21, 2004 09:19


All times are GMT -4. The time now is 18:02.