pyLibMeshb
Python module to read/write mesh and solution files in Gamma Mesh Format
(.mesh/.meshb/.sol/.solb). Implemented by compiling the vendored
libMeshb source
(libmeshb8.c / libmeshb8.h) directly and binding via Python ctypes.
Getting Started
Install
pip install pyLibMeshb
Read and write mesh data
Import pyLibMeshb
import pyLibMeshb.libMeshb as lm
Check mesh information.
lm.mesh_info("naca0012.meshb")
File : naca0012.meshb
Version : 2
Dimension : 2
Type Kind Count Details
----------------------------------------------------------------------
vertices vertex 4796
edges element 192
triangles element 9400
Read a mesh.
mesh = lm.read("naca0012.meshb")
Mesh data is stored in a dictionary with keys for each data type.
print(mesh.keys())
dict_keys(['version', 'dim', 'vertices', 'edges', 'triangles'])
Write the mesh back out.
lm.write("roundtrip.meshb",mesh)
Verify consistency.
import numpy as np
check = lm.read("roundtrip.meshb", types=["vertices"])
print("Round-trip vertices match:", np.allclose(mesh["vertices"], check["vertices"]))
Round-trip vertices match: True
Read and write solution data
Solution demo: 3 synthetic scalar fields (e.g. density, pressure, Mach).
n = mesh["vertices"].shape[0]
demo_values = np.column_stack([
np.linspace(1.0, 2.0, n),
np.linspace(101325.0, 90000.0, n),
np.linspace(0.1, 3.5, n),
])
lm.write("naca0012.solb", {"sol_at_vertices": {"values": demo_values}}, version=3, dim=2)
Check solution file information.
lm.mesh_info("naca0012.solb")
File : naca0012.solb
Version : 3
Dimension : 2
Type Kind Count Details
----------------------------------------------------------------------
sol_at_vertices solution 4796 sol_size=3, field_types=[1, 1, 1]
Solution data can be read using lm.read(). The mesh and solution can be visualized with Vizir4.
Query data types
Get lists of types in this mesh file.
mesh_types = lm.list_types("naca0012.meshb")
print(mesh_types)
['edges', 'triangles', 'vertices']
Get lists of types in this solution file.
solution_types = lm.list_types("naca0012.solb")
print(solution_types)
['sol_at_vertices']
Get list of all types supported by pyLibMeshb.
all_types = lm.list_types()
print(all_types)
['corners', 'dsol_at_vertices', 'edges', 'hexahedra', 'isol_at_edges', 'isol_at_hexahedra', 'isol_at_prisms', 'isol_at_quadrilaterals', 'isol_at_tetrahedra', 'isol_at_triangles', 'isol_at_vertices', 'prisms', 'pyramids', 'quadrilaterals', 'ridges', 'sol_at_edges', 'sol_at_hexahedra', 'sol_at_prisms', 'sol_at_quadrilaterals', 'sol_at_tetrahedra', 'sol_at_triangles', 'sol_at_vertices', 'tetrahedra', 'triangles', 'vertices']
Credits
- LibMeshb — Loïc Maréchal, INRIA
- LibMeshb license — /csrc/libMeshb/LICENSE.txt
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylibmeshb-0.1.6.tar.gz.
File metadata
- Download URL: pylibmeshb-0.1.6.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef1c87668d868ea731244992292960f9258bb04a3de31aae65f3c93ffaa76a2d
|
|
| MD5 |
a4d9baa42d52cef2720aea7c6bb9d71c
|
|
| BLAKE2b-256 |
9e23ca2c176bbd72db54bad43e61258f58f5970c5e0587fbaf4d4e1c5d015537
|
Provenance
The following attestation bundles were made for pylibmeshb-0.1.6.tar.gz:
Publisher:
build-wheels.yml on vtpasquale/pyLibMeshb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibmeshb-0.1.6.tar.gz -
Subject digest:
ef1c87668d868ea731244992292960f9258bb04a3de31aae65f3c93ffaa76a2d - Sigstore transparency entry: 2407887570
- Sigstore integration time:
-
Permalink:
vtpasquale/pyLibMeshb@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/vtpasquale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylibmeshb-0.1.6-py3-none-win_amd64.whl.
File metadata
- Download URL: pylibmeshb-0.1.6-py3-none-win_amd64.whl
- Upload date:
- Size: 189.9 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f3e07db9861381022630d691a33dcb546732e22d7919723f17fe04bcf4ed80b
|
|
| MD5 |
47536fd2778c9c3691d697b05f6a081c
|
|
| BLAKE2b-256 |
07d7426b1695af637839a48faacd1169e095e63e9c8e3d8c4dca7b1fee3b836e
|
Provenance
The following attestation bundles were made for pylibmeshb-0.1.6-py3-none-win_amd64.whl:
Publisher:
build-wheels.yml on vtpasquale/pyLibMeshb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibmeshb-0.1.6-py3-none-win_amd64.whl -
Subject digest:
3f3e07db9861381022630d691a33dcb546732e22d7919723f17fe04bcf4ed80b - Sigstore transparency entry: 2407887805
- Sigstore integration time:
-
Permalink:
vtpasquale/pyLibMeshb@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/vtpasquale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 71.8 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
858244dd3b757516380423f5d8d44a642dc6171d4189c6897db4c3f0adab2d33
|
|
| MD5 |
1a3062e93493c8be29a790223528c51c
|
|
| BLAKE2b-256 |
ded1edc4efa27a2eae64d16d0f1265464e7b180348672f88701353e39ba7d2b6
|
Provenance
The following attestation bundles were made for pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
build-wheels.yml on vtpasquale/pyLibMeshb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
858244dd3b757516380423f5d8d44a642dc6171d4189c6897db4c3f0adab2d33 - Sigstore transparency entry: 2407887702
- Sigstore integration time:
-
Permalink:
vtpasquale/pyLibMeshb@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/vtpasquale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl.
File metadata
- Download URL: pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d142901e7e4e711b8939381eb222954c84f2593428832810fab6c9ba1a4cf99
|
|
| MD5 |
a8376637787731d13748fe6d9fe72b34
|
|
| BLAKE2b-256 |
b1d83187f6fc359837e2be81c58339693d0ca22ce98de97e640db87676e999bd
|
Provenance
The following attestation bundles were made for pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl:
Publisher:
build-wheels.yml on vtpasquale/pyLibMeshb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl -
Subject digest:
9d142901e7e4e711b8939381eb222954c84f2593428832810fab6c9ba1a4cf99 - Sigstore transparency entry: 2407887648
- Sigstore integration time:
-
Permalink:
vtpasquale/pyLibMeshb@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/vtpasquale
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@ede7d2ece9f2a0b6ba4abb5777d380d511c144be -
Trigger Event:
push
-
Statement type: