pymech documentation#

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

Authors

eX-Mech Developers (see here)

Version

1.5.1.dev123+g5cab18a.editable

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.

Installation#

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]"

Note

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

opt = [
    "dask",
    "rich",
]
vtk = [
    "mayavi",
    "pygments >= 2.16.1",
]
full = [
    "pymech[opt,vtk]"
]

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