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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.9-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.9-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.9-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.9.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 45094d9368f062d46ed1f15f8f01b18f64db0e24395e964161f325c30ba6190d
MD5 df36a07f8444bde8419157ebadcb426a
BLAKE2b-256 42bdcb174077c9e62b4159755b6e24087bb73afe2695327f39d182a83defa7c8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.9-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.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 acf52bc0020d8c4e9f498973bfcaef3c2350b84f7cd1a3aa1839fe540fe2ca2d
MD5 e94489ec96deb6103905c4c9e53e1fbe
BLAKE2b-256 609e281dada51ce99b49181349be68fe7335d1a3c78e87e81731e5a19c5eaaef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f3b2acb9fd9b27d48ea6a6f5ce069f38fef2d77d434ce28cb91b8f9d0c01513
MD5 e56234c414d47885dfd38eeecc7ed7a1
BLAKE2b-256 0e4ab025bb5b026a3c509594ba538d1a51c0da5319ce19e419be92992525cd3b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 aa5f599026a2d9643026febcc21c79c8a2a7d1c6eefd94891e71c5960ca1ed54
MD5 3b3b504242c72b3b709af2bff5b8edcd
BLAKE2b-256 532eccda576c26d3c3eca2f654e4fcfbfa027f5d3587d9e48eaefd78870b04f6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 617a155bbc51b9f6e06234d723b47037b50176c89ad9af7557ba7df3bf82cfa2
MD5 ae348ab596faa939fd9970b5fd1917f9
BLAKE2b-256 3083f9ee2b70fd7effe0d2d75d087085919252df41e62ed5dccd365185fc6960

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.9-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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5467dbe4862abb6bff48f4846a3aa9addc378fb471ccdb794bc7a52f2029d1d6
MD5 6adb3e2b8f8180e5503b445bf541a7f4
BLAKE2b-256 b9279536a74361744cd40ba5e9ad7bec5594e2857267b166d82ed94e6d01368f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 70f78950a0fb40a2bf9d40284ef5678cde9799a91554a67df172b8850e705d0c
MD5 db253c56116b5eb779dc4a6281951718
BLAKE2b-256 3532402584501234c03f9a1d4ecdfcd2a72cd4a93bf162abdfb53a67c010ef5c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d9226b333c7079ef57fc9a2d10fda8c7315ea3063a742ecbe46ff2e9bc7e05e7
MD5 ef37dfbe913b29a2b7c5394e371e39c1
BLAKE2b-256 43d1c50ffeb95201215175dddfaace66980d5ddb988bcc208fa1e3b0c812e213

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ec8b6d3d03613cf1f6e43baa83940cac2270b8ce85bbabe1b62ff06cb1d0a1c1
MD5 94c5c6f82bc855368d28e338cf5afce1
BLAKE2b-256 b69ca8b6f4d35f578bdafb6aec624826f50763b7799761ecce38aebc1ae7d7c2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.9-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.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60080b18d299a9f05c5e67ee6dd9f83c6496607a925280c7197bdf8f83966ffe
MD5 b9a25482b489d18fd8bda91dbe14ee43
BLAKE2b-256 1ba26ab5468e1a299aed942eb30d80a55eb9c8891fef04745e38f88e6c620aa6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8c9004cc167bfb773445fb95a473e25f3b88d121d9f5c7c44a3a0c771fba22a
MD5 a042e18bbcd11fbeaa9ef47fce87f7dd
BLAKE2b-256 6815b3de2cc05191c9601d0f772f3dfd6079c16cc18e23283ebca35f2850c09a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 94608dcc9457d0fc83eeda7360a7efab7cec406dbaf7ceb0c36b8f6511697dfd
MD5 a96572e9566f59bdb7f131b8dab27bc3
BLAKE2b-256 4a827d78e202c5df8893c02ced7fddf722ff3bec14b0dec019c35f8b12afd72c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.9-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 61bedb9534c4154f601973b2ac687013f3857e16cf982722df7dad35de4c2c5b
MD5 e64b76fe52a5982ccd5841eaf3dc544b
BLAKE2b-256 da0045b68f34fa68af94ec7a92a05a0f245d3b43bade6db165ee637119cd0c0f

See more details on using hashes here.

Provenance

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