Skip to main content

GPU-accelerated Poisson solver for pressure from PIV

Project description

OSMODI is a GPU-accelerated Poisson solver for pressure reconstruction from Particle Image Velocimetry (PIV) data. It provides a CUDA implementation for NVIDIA GPUs with a reliable CPU fallback.

Github Repository

Link

Features

  • CUDA GPU solver (NVIDIA GPUs)
  • CPU-only fallback (always available)
  • 2D and 3D structured grids
  • Float32 and Float64 support
  • Designed for pressure-from-PIV workflows

Installation

pip install osmodi-solver

Quick Start

import osmodi
import numpy as np

print("GPU available:", osmodi.GPU_AVAILABLE)
print("CPU available:", osmodi.CPU_AVAILABLE)

# Create sample velocity gradients
Sx = np.random.randn(64, 64, 64).astype(np.float32)
Sy = np.random.randn(64, 64, 64).astype(np.float32)
Sz = np.random.randn(64, 64, 64).astype(np.float32)

delta = np.array([1.0])

if osmodi.GPU_AVAILABLE:
    P, progress = osmodi.solve_gpu(Sx, Sy, Sz, delta)
else:
    P, progress = osmodi.solve_cpu(Sx, Sy, Sz, delta)

print("Output shape:", P.shape)

API Overview

solve_cpu(Sx, Sy, Sz, delta, options=None) Runs the CPU-based Poisson solver.

solve_gpu(Sx, Sy, Sz, delta, options=None) Runs the CUDA GPU-based Poisson solver.

Parameters

Sx, Sy, Sz: NumPy arrays (2D or 3D) of velocity gradients

delta: grid spacing NumPy array

options: optional dictionary for solver configuration

Returns

P: pressure field (same shape as input)

progress: convergence history (NumPy array)

Solver Options

options = {
    "Verbose": True,               # Print solver progress
    "SolverToleranceRel": 1e-4,   # Relative tolerance
    "SolverToleranceAbs": 1e-6,   # Absolute tolerance
    "Kernel": "face-crossing",     # or 'cell-centered'
}

Supported Hardware

CPU: x86-64, any modern processor

GPU (optional): NVIDIA Pascal or newer

RAM: 4 GB minimum, 16+ GB recommended for large grids


Citation

If you use this solver in your work, please cite:

Zigunov, F., & Charonko, J. J. (2024). One-shot omnidirectional pressure integration through matrix-free multiscale methods. Measurement Science and Technology.


License

GNU General Public License v3.0 (GPL-3.0)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

osmodi_solver-0.1.1-cp313-cp313-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.13Windows x86-64

osmodi_solver-0.1.1-cp312-cp312-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.12Windows x86-64

osmodi_solver-0.1.1-cp311-cp311-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.11Windows x86-64

osmodi_solver-0.1.1-cp310-cp310-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file osmodi_solver-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for osmodi_solver-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6d8c5982428a716a220bb11896c8ea7b7922b0290d965432aff060cdbd4b46e3
MD5 a274d7ec5b42cfadb8049b666813f5e6
BLAKE2b-256 42a0b1bbc5924d1c27e1aa4c7e5b6c1c5a0c6c7bdd53508b647c3aa7f59e8544

See more details on using hashes here.

File details

Details for the file osmodi_solver-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for osmodi_solver-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ee8b9f20056c52133a824746cc960ccabcbb4f1af3bb95ef44ae9fee2e8edd73
MD5 db6e9f39daa5f7fed816de82a37ca4c5
BLAKE2b-256 a5c0b809f34d3c588568d1b4ff3533064f990cd027fc2edf94fe67ce80568745

See more details on using hashes here.

File details

Details for the file osmodi_solver-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for osmodi_solver-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 457b52eda567c29c00add500510a73bee71de35736d55df5623b9e7e5d84515e
MD5 1d809ac93f114d6929006ed915234882
BLAKE2b-256 1587a704f759606ca3d88fbcdafbae04c4348b0ac88c426b838fff2edd15411b

See more details on using hashes here.

File details

Details for the file osmodi_solver-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for osmodi_solver-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b0078d26c8d23f68664e412e029df5d9fb218ff99ac2a4a4d274405dd1566c04
MD5 50acd0571ac89dd05640d721b33d696b
BLAKE2b-256 1f4d29f9b561e3330d746deae99ce7d03b4511dc39543d51f66adfe5baaa6032

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