Skip to content

mnarayan/metismex

 
 

Repository files navigation

metismex

Based on the metismex.c code by Robert Bridson and using pieces of the meshpart toolkit by John Gilbert and Shanghua Teng.

This code has been modified to work with the latest version of Metis (5.0.2 as if 2012-05-22). All functions except for one (NodeBisect) currently work.

Compiling

The following instructions worked on Ubuntu Linux (10.10) and OSX 10.7.

  1. Download and extract the 5.0.2 version of metis.

     wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.0.2.tar.gz
     tar xzvf metis-5.0.2.tar.gz
     cd metis-5.0.2/
    
  2. Configure metis for 64-bit integers. This step is only required for 64-bit versions of Matlab. We need to edit include/metis.h and change #define IDXTYPEWIDTH 32 to #define IDXTYPEWIDTH 64. On my system, this change was to line 33.

  3. Make sure you have a working version of cmake installed. On OSX 10.7, I used the homebrew port. brew install cmake

  4. Compile metis.

     make config
     make all
    
  5. Download and compile metismex. It is critical that this is in a subdirectory of metis otherwise the relative paths won't work.

     # in the metis-5.0.2 directory
     git clone git://github.com/dgleich/metismex.git
     cd metismex
     matlab -nodisplay
     >> make
    
  6. Check that it works

     >> A = blkdiag(ones(5),ones(5)); A(1,10) = 1; A(10,1) = 1; A(5,6) = 1; A(6,5) = 1;
     >> [p1,p2] = metispart(sparse(A))
     
     p1 =
     
          1     2     3     4     5
     
     
     p2 =
     
          6     7     8     9    10
    

About

A mex file to use metis in Matlab

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 76.2%
  • MATLAB 20.9%
  • M 2.9%