Building with Metis support

SWAN 41.45A+ can be compiled with support for Metis to partition an unstructured mesh so that simulations can be carried out on distributed-memory machines3.1. For this, an MPI implementation is still required; see Section 3.2.4. The actual mesh partitioning implemented in SWAN is the multilevel k-way method. For details see the Metis manual.


For a proper building, the Metis software package must be installed first on your machine. Installation details can be found at https://github.com/KarypisLab/METIS. Make sure that both C++ constants IDXTYPEWIDTH and REALTYPEWIDTH in header file metis.h) have been set to 32. Note that you also need to install the GKlib library. It is recommended to install the lastest version of Metis; high-resolution simulations with the unstructured mesh version of SWAN have been tested with Metis 5.2.1.


Carry out the following steps.

  1. Define the variable METISROOT in file macros.inc to refer to the Metis root directory (e.g. METISROOT=/opt/metis in case of Linux/macOS or METISROOT=BINARY_DIR in case of Windows).
  2. Build SWAN as usual (e.g. make mpi); see Section 3.2.2.



The SWAN team 2024-03-19