Skip to content

PyFoam: Installation

April 11, 2011

Pre-requisites

* Make sure that OpenFOAM is installed (http://www.openfoam.com/download/ubuntu.php)

* Make sure that Python installed

* Install Boost library (

sudo apt-get install libboost-dev libboost-doc

)

Then follow the instructions below in order to build and install the “pyFoam” – Python  OpenFOAM binding.

Basic Installation

Current version (0.5.5)

  1. Untar it
  2. Go to the directory PyFoam-0.5.5
  3. Install it with the command
 
python setup.py install

Testing the installation

To test whether the installation of PyFoam is working start the interactive Python shell with

 
python

(The shell can be left with Control-D). In that shell type

 
import PyFoam
import PyFoam.FoamInformation
print PyFoam.FoamInformation.foamTutorials()

If the last command produces an output similar to

 
/home/nonroot/OpenFOAM/OpenFOAM-1.2-devel/tutorials

everything is well.

One Comment leave one →
  1. June 7, 2011 3:54 am

    I tried it and appeared an error ,for example ” bash: syntax error near unexpected token `(‘ ”
    after I complied command “print PyFoam.FoamInformation.foamTutorials() ” .
    Plz, can you help me?
    thanks !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: