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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyofm-1.2.4.tar.gz
(2.0 MB
view details)
File details
Details for the file pyofm-1.2.4.tar.gz.
File metadata
- Download URL: pyofm-1.2.4.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58913dad607df677b380bee71c217c9f01b86e5ec1c44627c0819f0bc306b9b4
|
|
| MD5 |
e5179723578ddeca810ce99485a898c9
|
|
| BLAKE2b-256 |
7fdbea5bbc36cf8c1632f7bf352dc4b5c1676a2f03ec3b225089f970ea589e0f
|