Skip to main content

pyOFM: Python wrapper for OpenFOAM meshes

Project description

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_orion

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.

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

pyofm_orion-1.2.4.tar.gz (13.8 kB view details)

Uploaded Source

File details

Details for the file pyofm_orion-1.2.4.tar.gz.

File metadata

  • Download URL: pyofm_orion-1.2.4.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyofm_orion-1.2.4.tar.gz
Algorithm Hash digest
SHA256 2126289a9235495a43645d574a2ee5fdeeaf49a7e5930cd279453bf4499404c8
MD5 8b395bb1699a6e4498f02af8c785a5df
BLAKE2b-256 5345aa13c693255446e9ba6e714cf8b225a9f5f2ac97e00da104587cc9bcfcb1

See more details on using hashes here.

Supported by

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