Skip to main content

pyOFM

pyOFM

pyOFM is a Python wrapper for OpenFOAM meshes that provides a simple mesh reading class to parse OpenFOAM polyMesh directories and store mesh data in Python for user interaction.

Features

  • Automatic Build System: Modern pyproject.toml-based build system with automatic Cython extension compilation
  • Flexible Installation: Works with or without OpenFOAM environment (falls back to pure Python)
  • OpenFOAM Integration: Direct reading of OpenFOAM polyMesh format
  • Python 3.8+ Support: Compatible with Python 3.8 through 3.12
  • MPI Support: Includes MPI capabilities via mpi4py

Requirements

  • Python 3.8 or higher
  • NumPy >= 1.16.4
  • mpi4py >= 3.0.0
  • OpenFOAM environment (optional, for Cython extensions)
  • Cython >= 0.29.0 (for building from source)

Installation

Quick Installation (Recommended)

For most users, simply install via pip:

pip install -e .

The build system will automatically:

  • Detect if OpenFOAM environment is available
  • Build Cython extensions if OpenFOAM is present
  • Fall back to pure Python package if OpenFOAM is not available

Building from Source Distribution

When installing from a source distribution (e.g., from PyPI):

pip install pyofm

The package will automatically handle compilation during installation.

Build System

The package uses a modern build system with:

  • pyproject.toml: Modern Python packaging configuration
  • Automatic Extension Building: Cython extensions are built automatically during pip install
  • Environment Detection: Automatically detects OpenFOAM availability
  • Fallback Support: Works as pure Python package when OpenFOAM is unavailable
  • Cross-Platform: Supports Linux environments with proper OpenFOAM setup

License

This project is licensed under the GNU General Public License v3.0. See LICENSE.md for details.

Metadata

Release files for pyofm 1.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyofm 1.2.4
File Size Uploaded
pyofm-1.2.4.tar.gz 2.0 MB Details

Release files / pyofm-1.2.4.tar.gz

Download URL pyofm-1.2.4.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
58913dad607df677b380bee71c217c9f01b86e5ec1c44627c0819f0bc306b9b4
BLAKE2b-256 checksum
How to use checksums
7fdbea5bbc36cf8c1632f7bf352dc4b5c1676a2f03ec3b225089f970ea589e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.2.4 This release

1 release file

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