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.8.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.8-cp313-cp313-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.8-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.8-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.8-cp313-cp313-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.8-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.8-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.8-cp312-cp312-macosx_15_0_arm64.whl (9.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.8-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.8-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.8-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.8.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 36eee503515300c3d0cf1368e48f8cb4fabeca89c17247ff3dcaa8b30ce9b0d5
MD5 1e31e03264626d68ed437291e36453fb
BLAKE2b-256 cce925f7f85451218a807d57425bc70f14180d3f9bb290b83e883423d1e52197

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8.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.8-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: parosol_py-0.1.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parosol_py-0.1.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0164fcdc06a7a8ec587ce0724741008ceb27e46ec58daea2d352ae7d7dac259d
MD5 4fb58463056bce8211701ddf7db01edb
BLAKE2b-256 945196c1ee146aedbf0fb4f4558eac34d305b64fd4daf88854db14bd9de76986

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 974a2688b29ff5c418df295dc74965d775d1c12c25cef3964a56d8f2b7491a38
MD5 29dff0f384f484c1a09b861cebcae367
BLAKE2b-256 0e6b223ed194634212961a85a721a44fdfd45dde644bd596bdf9e90a37d5955c

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 3332238859efe155b54e2174f9309613371c709889d308a2ee4a67719874f4cb
MD5 07bfedcb1d3f9672e8104e4b110fd8f0
BLAKE2b-256 9eb8ae4694eed9ba2ad86bf8edeacf8e332866cb4d8552004f5ca975947f6fa0

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ae048c372ec20f56ef75978c3168f19493466603d39332b7639a46aecadbb797
MD5 a047e33ecbcad4808e29eb79e985d009
BLAKE2b-256 0e5ca92344bf6ff0f31c12cef2571a44bea3ae6a531c7901fdcaa1d4857df7db

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: parosol_py-0.1.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parosol_py-0.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 76dfe8a1bc9e84a1aec229ca10c5fd8589d303854ce413840dbb65354aa0a7dc
MD5 6cbf76e732707fcf22617566301d0ac6
BLAKE2b-256 b30da72ef145294fe9e2027699df631d2089467cf11a032f79de7feae100db27

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea452506d57965b1c3f0d674528de292d5efb2987692b875e2a6c3c196826332
MD5 71dc3f31f2dc78df31831cf6ae88cae9
BLAKE2b-256 f8257c2b52f8e03adb5f8430563a0770bad5120b40937e796b7d3e572fe8ae0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp312-cp312-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 817574d3a71dad0e88096d3b22f3a4325dcdd8a0947fe16642ecf439a9756c69
MD5 718d5516b4367c09243cde018296c63a
BLAKE2b-256 9d47580a82c237e33ee03765ce4be82ffca417fdf1a7f421e99d8f7a8e2c4f38

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1bfb3c9a47b92c7f6f926b4eba9c9941557e1d2ccd0233403c4e890c2a365aad
MD5 96c2941438627bcdc7c82c8f816df9b4
BLAKE2b-256 bf986f463b576969a28ab5ad622acbf9849025102579f9804b94b443a49a31eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: parosol_py-0.1.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for parosol_py-0.1.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a43c44d3f32defb60755157d85d97830a12d4fcdc514309803be0b732efa49f1
MD5 0e41aa0586a8919071975c492644d3c0
BLAKE2b-256 a869c53848f1a3767e809e75a17a7dd97cf8bc395925db95f6bce861cd57cabd

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e23af65c1726f46af1beda0d38bd25022459ed0a9439205d49c56cb4a82614bc
MD5 c40b9228c6af19e173cf344e6304177b
BLAKE2b-256 c3d0fff09012140950c8afaa3af0709d728d1d56dc82c494307166a52671072d

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp311-cp311-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 3f430c294c65ed9d2e581e9284fb4e72c88b10f117eebfe7d4b5bcb80b4012d5
MD5 685eb5d2faed0c0c4d812b254a3c1ad3
BLAKE2b-256 a2f83b89d739851aaddc4b40f70c7b80871c1440104369b2ec97a6f2a1744063

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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.8-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for parosol_py-0.1.8-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f681b62be9a27d8b603bc72bd1e66f9136e861a8169aace4d56f79e5a199f60a
MD5 a72fd1da61633233d42f385bf83e8bae
BLAKE2b-256 07b052eb4b449098ea7a9e911acb9510b2da8e61d998e6613c40aa7f3f739ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for parosol_py-0.1.8-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