Skip to main content

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

Download files

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

Source Distribution

pylibmeshb-0.1.6.tar.gz (31.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pylibmeshb-0.1.6-py3-none-win_amd64.whl (189.9 kB view details)

Uploaded Python 3Windows x86-64

pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (71.8 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl (50.3 kB view details)

Uploaded Python 3macOS 10.13+ universal2 (ARM64, x86-64)

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

Hashes for pylibmeshb-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ef1c87668d868ea731244992292960f9258bb04a3de31aae65f3c93ffaa76a2d
MD5 a4d9baa42d52cef2720aea7c6bb9d71c
BLAKE2b-256 9e23ca2c176bbd72db54bad43e61258f58f5970c5e0587fbaf4d4e1c5d015537

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylibmeshb-0.1.6.tar.gz:

Publisher: build-wheels.yml on vtpasquale/pyLibMeshb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pylibmeshb-0.1.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3f3e07db9861381022630d691a33dcb546732e22d7919723f17fe04bcf4ed80b
MD5 47536fd2778c9c3691d697b05f6a081c
BLAKE2b-256 07d7426b1695af637839a48faacd1169e095e63e9c8e3d8c4dca7b1fee3b836e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylibmeshb-0.1.6-py3-none-win_amd64.whl:

Publisher: build-wheels.yml on vtpasquale/pyLibMeshb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for pylibmeshb-0.1.6-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 858244dd3b757516380423f5d8d44a642dc6171d4189c6897db4c3f0adab2d33
MD5 1a3062e93493c8be29a790223528c51c
BLAKE2b-256 ded1edc4efa27a2eae64d16d0f1265464e7b180348672f88701353e39ba7d2b6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for pylibmeshb-0.1.6-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 9d142901e7e4e711b8939381eb222954c84f2593428832810fab6c9ba1a4cf99
MD5 a8376637787731d13748fe6d9fe72b34
BLAKE2b-256 b1d83187f6fc359837e2be81c58339693d0ca22ce98de97e640db87676e999bd

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.10

4 files

0.1.9

4 files

This release

0.1.6 This release

4 files

0.1.3

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page