Skip to main content

Python package and API wrapper for the ParOSol micro-FE solver

Project description

parosol-py

parosol-py is the Python package and runtime wrapper for the ParOSol micro-FE solver. It provides Python helpers for creating solver inputs, running the bundled native executable, reading outputs, and mapping label or density images to material stiffness.

The bundled native ParOSol solver was written by Cyril Flaig and is distributed under the GNU General Public License, version 2 or later. The Python package is therefore distributed as GPL-2.0-or-later.

Install

Prebuilt wheels include the native ParOSol executable and the platform MPI runtime needed to launch multi-process solves:

python -m pip install parosol-py

For local development:

python -m pip install -e .[dev]

Source installs require CMake, an MPI C++ compiler/runtime, HDF5 C++ libraries, and Eigen headers. Release wheels are built for Python 3.11, 3.12, and 3.13. macOS wheels currently target macOS 15 or newer.

Bundled MPI runtimes remain under their own upstream licenses and notices. Windows wheels bundle Microsoft MPI runtime files under Microsoft/MIT terms. macOS and Linux wheels bundle OpenMPI runtime files under OpenMPI's BSD-style terms. These MPI runtime files are not relicensed as GPL by parosol-py.

Local Check

Before relying on GitHub Actions, run the local verification gate from an environment that has the native build tools:

python scripts/local_check.py

Add --smoke-install to install the built wheel into a temporary virtual environment and import it.

Python API

import numpy as np

from parosol_py import solve

material = np.ones((10, 10, 10), dtype=np.float32) * 1000.0

result = solve(
    material=material,
    spacing=(0.061, 0.061, 0.061),
    material_unit="MPa",
    test="axial",
    test_axis="z",
    strain=-0.01,
    outputs=("sed",),
    export_dir="outputs/example",
)

print(result.summary)
print(result.exported)

Use dry_run=True to write the ParOSol HDF5 input and command without launching the solver:

result = solve(
    material=material,
    spacing=(0.061, 0.061, 0.061),
    material_unit="MPa",
    test="axial",
    test_axis="z",
    strain=-0.01,
    dry_run=True,
    export_dir="outputs/dry_run",
)

Material Mapping

Label images can be mapped through an explicit material table:

import numpy as np

from parosol_py import LinearIsotropicMaterials, labels_to_material_map

labels = np.array([[[100, 127]]], dtype=np.uint16)
table = LinearIsotropicMaterials(
    youngs_modulus_mpa={100: 8748.0, 127: 8748.0},
    poisson_ratio={100: 0.3, 127: 0.3},
)

mapped = labels_to_material_map(labels, table)

Continuous density images can be converted with one of the supported equations:

from parosol_py import density_to_material_map

mapped = density_to_material_map(
    density_image,
    equation="power",
    coefficient=10000.0,
    exponent=1.7,
    reference_density=1000.0,
    poisson_ratio=0.3,
)

The Mulder grayscale BMD law is available as mulder2007:

mapped = density_to_material_map(
    density_image,
    equation="mulder2007",
    active_mask=outer_contour,
    floor_e_mpa=2.0,
    poisson_ratio=0.3,
)

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

parosol_py-0.1.11.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

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

parosol_py-0.1.11-cp313-cp313-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.11-cp313-cp313-manylinux_2_28_x86_64.whl (17.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

parosol_py-0.1.11-cp313-cp313-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

parosol_py-0.1.11-cp313-cp313-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

parosol_py-0.1.11-cp312-cp312-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.11-cp312-cp312-manylinux_2_28_x86_64.whl (17.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

parosol_py-0.1.11-cp312-cp312-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

parosol_py-0.1.11-cp312-cp312-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

parosol_py-0.1.11-cp311-cp311-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.11-cp311-cp311-manylinux_2_28_x86_64.whl (17.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

parosol_py-0.1.11-cp311-cp311-macosx_15_0_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

parosol_py-0.1.11-cp311-cp311-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file parosol_py-0.1.11.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.11.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parosol_py-0.1.11.tar.gz
Algorithm Hash digest
SHA256 4291545e24b4ac0905e5e06de8e4e9bc8927828c6196b11a14edc0383311d7b1
MD5 b5b508d07762ccef08b34362bdac7a79
BLAKE2b-256 cec5a6fa6bd66373be1f046b7febfd1cdd7fb593bb602cc7eb2f3a92416a8450

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11.tar.gz:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d1a06889ba4ac4a96d5cc75b95468b0173022b353f6cf32d78990c5aadb38eca
MD5 9d66a9f7e022d7bdb343a3e01a642557
BLAKE2b-256 c53f5bdb633d801f641409f3926730d8c3a21eab63ddadf388a03f1f9b573490

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea586cf46f0905c07c4384cbd1f347d93842fc579850ceb56f86cc8a2bf0e7ee
MD5 67816fad348913c7d7ccf2837a28b310
BLAKE2b-256 da441b80c02295e12ca0b35c6dd16e781ee4097a695bb6587a75cd8720bc07f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 ee42722ba36f1a2de09bb9bc8ddde98b1b9df2f3588da4c70e1bfab566485235
MD5 6b6f8de49ec101884f3b42777bf06a08
BLAKE2b-256 4122b69ca2236b39bc328d3af54e9049594a34d5b6db8a39ef6621f304527d99

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp313-cp313-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b1f642e672f5e5f160925a5667cb67bcef5f488e473065453a745b509f07fd91
MD5 e935b24cc166c6f2fdb49114e4091b57
BLAKE2b-256 431a18d3ff0ca23f4e23ae8d15ce8ae9abb67543399edef0d5c26a44675699aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp313-cp313-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 204d5dd48548f0b1438af4bfc00c3b166c349e5ba7d00a6062c7c88e5ba51465
MD5 fa8f6b2b9cbd155879cd8dc843bac15b
BLAKE2b-256 edf059d2bf3f814ba73173a77f219d5076c659871af3dca2180541813d257feb

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ede4b967d3839cae179210b23b821163443e44bbe5c28ecfae71ac8429e0ad70
MD5 ce2d19bcc1c5a276434aefc8885cd303
BLAKE2b-256 77a2bca8bef5b86018b2a43bf30be1c3c273bcba631e82b09ab7ab9e5e108003

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 41aa5ac62b7ec13a5e2adcd8f6654053034f00107a3e555ed4f5e4f430a3c7c6
MD5 0e034bf6333bfc2fce7ca4b911da63f4
BLAKE2b-256 851367d2a23f27fd2a52a82a01fd47a6fbe0fa0de4f0709ff491cf43aecb875a

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp312-cp312-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 798929d1af8295bbe6ec6742c9d183ed72bafeff705a3d473e49d3d9b46aab99
MD5 a82cd1a708fc5feead86986b7e2fe1e3
BLAKE2b-256 6db6a188fe751cd6f6046edc01b9ec716e54b5ee2c2825cad08d340afa153ada

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 da1f32d1ccedc4394407dd7026a87dcd115397bb9b0769cc5f12ec7ab35fb36d
MD5 7b31035b71b068193ac60c3919ef371a
BLAKE2b-256 fd9ca0a304307c8d79af56283bb918cecb9b904daf10ee62e71b4ae7d658d3f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b49d49857b8bc6291665b6808bf65ef716f268840ee0cecb8c2b411ae11506cf
MD5 ccd0da4df01164b19ab7bd48272f396f
BLAKE2b-256 40d55b64debcc55aa50b39c15761c20052276f4dc8a32712e6b1c2eea5803415

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 8f5328dc5d4892007b573b7a5e1741be68c40a981b640ba087bf364e58749f0f
MD5 494a80dc8284e21bf427273b2cd66492
BLAKE2b-256 1081cefd61e509681627d547b41d5ccd44b1667934b0117be8d8689dd7e8e535

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp311-cp311-macosx_15_0_x86_64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

File details

Details for the file parosol_py-0.1.11-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.11-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5d93f32b49f562c89b500de9ef784eaee879f01dd833e28ed77b9714741b565a
MD5 d18d4ad27900ebbca8b13648fb38f492
BLAKE2b-256 c62652586be737401445b602151134f5de66665dc7868aef3f8e2df5524b5f70

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.11-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: build-wheels.yml on wallematthias/parosol-py

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

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