Skip to main content

gmshparser is a lightweight and well-tested package that aims to reliably parse the Gmsh ascii file format (.msh). The package does not introduce any external dependencies and thus fits well with the needs of your own FEM research code.

Project description

gmshparser - parse Gmsh .msh file format

Build Status Coverate Status Documentation Status

Package author: Jukka Aho (@ahojukka5)

Gmshparser is a small Python package which aims to do only one thing: parse Gmsh mesh file format. Package does not have any external dependencies to other packages and it aims to be a simple stand-alone solution for a common problem: how to import mesh to your favourite research FEM code?

Project documentation is located at: https://gmshparser.readthedocs.io/

Installing package

Using pip:

pip install gmshparser

Usage

To read mesh into Mesh object, use command parse:

>>> import gmshparser
>>> mesh = gmshparser.parse("data/testmesh.msh")
>>> print(mesh)

Output is

Mesh name: data/testmesh.msh
Mesh version: 4.1
Number of nodes: 6
Minimum node tag: 1
Maximum node tag: 6
Number of node entities: 1
Number of elements: 2
Minimum element tag: 1
Maximum element tag: 2
Number of element entities: 1

For further information on how to access nodes, elements, physical groups etc. look the documentation.

Contributing to project

Like in other open source projects, contributions are always welcome to this too! If you have some great ideas how to make this package better, feature requests etc., you can open an issue on gmshparser's issue tracker or contact me (ahojukka5 at gmail.com) directly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmshparser-0.1.2.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

gmshparser-0.1.2-py3-none-any.whl (15.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page