lundi 24 février 2014

Matplotlib was happy to plot contours of triangular meshes in the past. Though they were not actually triangular, they were triangulated (by OpenFOAM's sample utility) rectangular meshes. Recently I've encountered rather strange thing, all my attempts to plot isoline of a value on a triangular mesh which initially wasn't rec
ended up with
while if I try to use scipy triangulation
everything goes more or less OK.

Thought matplotlib and scipy use the same algorithm for triangulation appears I was wrong.

vendredi 21 février 2014

After I've made patches for OpenFOAM 2.3.0 to build it with clang I came upon post by Bernhard Gshaider where he decided to drop ThirdParty source packs as all necessary software can be installed with Macports. Since all software from ThirdParty package can be installed with Homebrew (except you don't need to install gcc with all the stuff Macports pull with it), I've made this patch.

Create disk image with CASE SENSITIVE file system. Guide with pictures is on OpenFOAM wiki. Usually guides suggest sparseimage format though sparsebundle format is more convenient for the systems with active backup software.

In this version CGAL library appeared which depends on boost, gmp, mpfr, and cmake. I use Homebrew as a package manager so patches assume that boost, gmp, and mpfr are installed with brew. Basically I use this package manager to get installation prefixes for the libraries.

I have multi-threaded build of boost intalled (--without-single option of the package) so build was tested with this version (i.e. libraries have -mt suffix). If you have single threaded libraries installed makeCGAL script will try to adjust build options, though this wasn't tested.

Paraview is downloaded from paraview.org and installed in /Applications

Apply patches with git apply command. I prefer using git (instead of patch) for this because git will get permissions on created files (for example addr2line4Mac.py will be created as an executable).
$ cd OpenFOAM-2.3.0
$ git apply OpenFOAM-2.3.0-2.patch
$ cd ../ThirdParty-2.3.0
$ git apply ThirdParty-2.3.0-1.patch
$ cd ../OpenFOAM-2.3.0

Edit etc/bashrc to correspond to your system and desires. Major changes that can be done are:

Change export WM_MPLIB=SYSTEMOPENMPI to export WM_MPLIB=OPENMPI if you'd like to use OpenMPI from ThirdParty source distribution (version 1.6.5). I use Homebrew installed OpenMPI 1.7.4.