pymech documentation#

This is the documentation for pymech, a Python suite of routines for Nek5000 and SIMSON.


eX-Mech Developers (see here)



Pymech can be used for reading, editing and writing Nek5000 and SIMSON meshes and output files. For a detailed tutorial refer to usage.

The data structure is defined by the pymech.core.HexaData class. The functions for manipulating Nek5000 files are in pymech.neksuite, while the functions for SIMSON are, of course, in pymech.simsonsuite.


Pymech requires Python version 3.9 and above. For most purposes, we recommend creating a virtual environment and then running:

pip install pymech

Optional dependencies can be installed as follows:

pip install "pymech[full]"


Specifying [full] would also install optional dependencies, namely:

opt = [
vtk = [
    "pygments >= 2.16.1",
full = [

Install using conda / mamba#

In certain cases, typically:

  • in an OS where at least Python version 3.9 is unavailable, or

  • to install mayavi to make use of pymech.vtksuite, or

  • to use PyPy instead of CPython,

a simple pip install pymech may not cut it. Then, it is recommended to use conda (or mamba) to set up the Python environment first. To install Pymech with a Python interpreter of your choice:

conda create -n my-env -c conda-forge pypy pip xarray
conda activate my-env
pypy -m pip install pymech
conda create -n my-env -c conda-forge python pip
conda activate my-env
python -m pip install pymech