Contrib gmshFoam

From OpenFOAMWiki
Revision as of 10:43, 11 April 2007 by 7islands (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(The documentation work is still underway - more to come in the following days!)

Valid versions: OF version 13.png

1 Short description

A conceptual implementation of a total Gmsh pre/mid/post-processing environment for OpenFOAM.

2 Installation

2.1 Prerequisites

  • The gmshFoam-20070411 package: Download from the Download section below.
  • gmsh-2.0.7-source.tgz: You need the source distribution of Gmsh.
  • The autoconf utility that comes with your linux distribution.

2.2 Installation procedure

In the following procedure, as an example the home directory is assumed to be the author's own home directory:

  • The home directory: /home/ohshima

The gmshFoam and Gmsh packages are assumed to be downloaded into:

  • The gmshFoam package: /home/ohshima/OpenFOAM/ohshima-1.3/applications/utilities
  • The Gmsh source package: /home/ohshima/OpenFOAM/linuxAMD64

1. Setup the OpenFOAM environment.

$ source ~/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/bashrc

2. Build the libraries and standalone utilities.

$ cd ~/OpenFOAM/ohshima-1.3/applications/utilities
$ tar -zxf gmshFoam-20070411.tar.gz
$ cd gmshFoam-20070411
$ ./Allwmake

3. Apply the patch included in the gmshFoam package to Gmsh sources, and build/install Gmsh.

$ cd ~/OpenFOAM/linuxAMD64
$ tar -zxf gmsh-2.0.7-source.tgz
$ mv gmsh-2.0.7 gmsh-2.0.7-src
$ cd gmsh-2.0.7-src
$ patch -p1 < ~/OpenFOAM/ohshima-1.3/applications/utilities/gmshFoam-20070411/gmsh-2.0.7-foam-20070410.diff
$ autoconf
$ ./configure --prefix=/home/ohshima/OpenFOAM/linuxAMD64/gmsh-2.0.7 \
  --with-foam-prefix=/home/ohshima/OpenFOAM/ohshima-1.3/applications/utilities/gmshFoam-20070411
...
checking for main in -lhdf5... no
checking for main in -lgmshMessageStream... yes    <<--- This line shows the detection of OpenFOAM libraries!
checking for grep that handles long lines and -e... /usr/bin/grep
...
$ make
$ make install
$ cd ..; rm -rf gmsh-2.0.7-src

Please make sure proper OpenFOAM environment variables are set up before building Gmsh because the configure script uses the environment variables to detect the gmshFoam and OpenFOAM libraries. Also, don't forget to run autoconf before running configure.

Note that the options given to configure in the example above are the minimal ones to build Gmsh with OpenFOAM support. You need to give extra appropriate options to build Gmsh with other packages such as Tetgen, Triangle or OpenCASCADE.

4. Add the path to Gmsh in one of the setup scripts. For example add the following line to the last of ~/OpenFOAM/OpenFOAM-1.3/.bashrc.

export PATH="$WM_PROJECT_INST_DIR/$WM_ARCH/gmsh-2.0.7/bin:$PATH"

3 Usage

3.1 gmsh2ToFoam

3.2 foamToGmsh

3.3 Gmsh

3.4 gmshFoam

4 Download

gmshFoam-20070411.tar.gz: The gmshFoam package

You also need to download gmsh-2.0.7-source.tgz from the Gmsh website.

5 History

7islands 12:43, 11 Apr 2007 (CEST):

  • Initial upload.