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

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

parosol_py-0.1.5-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

parosol_py-0.1.5-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

parosol_py-0.1.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 c663bd620b8cb26c7008ca275da4b8c6806d8d02ee9db29673977e5d984486c9
MD5 3d6b23d80bf6886ddd2adbee88fbd71e
BLAKE2b-256 65cb64ba79adf4c7f6f6e8b52741429b8708f9f89df3bb54fedb683e004e7ac6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 247cd253877c5d2d51f827c0df06f1b6693a75db35efbfb3e636c26047fb9f8e
MD5 4a54d42404274b4df673835c6ac25482
BLAKE2b-256 449f892bb45c4ba57f28bc3e4c6412dae3dc990fa59ed81b56b9fcaf80e5e697

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 288c4de9ca9b9b288c5271892336f87c093788f5df01efc0b70b128a1e452ba1
MD5 a1a205e73d4b5491ca35baf3d3055c13
BLAKE2b-256 a217eaa3f269a6b9a30f0a80a931108c5bd11b5ec1828579208282c0c1020dd2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 3c8642b956d32d8a81ddb717bb4f25adef71374f065bfc18d5b4b1a5789f59d7
MD5 6372537d7bb2ae4976ee987043e4b7f2
BLAKE2b-256 8ad94085b1f8cf42e7726ac4eaba0d2b9c8d2dfb114640ed59646e3a8f17a63a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7db2dc9d41d1391ee6025f929c2b6885d7c489096d571aac5eb6e9f06f64f851
MD5 fc6990d3caf35008f2627ad19d190676
BLAKE2b-256 8c651ab8431516ab0a9e520ec98a668dc367553a6dfffb880e15fda3dc1abe03

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a4c659cacd4ef71f375ffdcb9340b56b7be465ef1231258670f8393a495397b4
MD5 6a85f7c4cc5acd262e1dfd878ee06567
BLAKE2b-256 4d683b2a22135d003036c8ac39058a921a123dce5b1b60709da39ec8a69d98c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7e8c584edbf591101f0b2fd108c8a8702a2047c17a90bf7441d9caa1558f0f8
MD5 980e4a6adde886e8d9c2f8033a50d5e9
BLAKE2b-256 ffdab2d52e6c11d942d2d76b430b4e2aa31daff24af9d022ee0681067622efab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a79ceba28e2cead4be22305386b64b72eb1a1124b845c76f9a9409527fc7901f
MD5 0562a3dc8d8af203acdfc38ee5991700
BLAKE2b-256 ba40bb654e26617d5719a6d0708c359024a6ce13bf7e0cbfdeb0002dae37bd21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 31c5057f698a1e56b372608df0409b12c84fcac4c339a00990e1cfeea948f35b
MD5 58693fe50ea3da85d876d66188cfa1fd
BLAKE2b-256 c5692c1084a85a55e8da321d3ee32dceee7bd8d2145580b34391833ebb3d5a8e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f1fa64316fc8aa5aebd8f273913b475765a44c28985e69c63f8df984d3baccb1
MD5 3ce10fa19cce22246e6ac74134fc5718
BLAKE2b-256 cb5742be63b742607958b8447366fa2a62896d5d7a64217e5e9163f6f44f8f5a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fdf469dbeb4b19ea86186e68b0bf9d18d62dde860e330036a77f199042bd06d1
MD5 e3aca74ade3a2123821e2903b617d416
BLAKE2b-256 14c0894d1ac69af1348d566201dd7b986c5f87fca0a2d534d6b9d3c1ad828851

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 966cc11d0f97bbf934e886cca03faaccbd7bd4a8a8e9b9c862cf5a4cacedf1f3
MD5 9254879e10c835d748e1c715033c62af
BLAKE2b-256 0765ae1eaaf036bfbb9fde704283554938a85252e85d2dff3d251be4175653b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.5-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bc2c5fa12760c868b7419b29e7f963efb81a90b277395147aa17ff1a9cc25da0
MD5 6b8a3ad080f914d0f5920368f23a37b2
BLAKE2b-256 b5a6e7a49c89b3b262760b6f7500f889161047d955d59fae7bdd7996de38e10f

See more details on using hashes here.

Provenance

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