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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

File metadata

  • Download URL: parosol_py-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 5a936e4a8148551485eb5d858c921a0c30b0e56a36b00878dac6d4d9fde0ec3d
MD5 6b70d1f1b782f8049ef8e2b61805ed21
BLAKE2b-256 a83a361ed9e1c97779747b732c5e4e01e22613d182168ebf53c1063a937d9517

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9092b8b01b956841843f9582b82cb76515409c962c824b7f8883aad77c94fe2c
MD5 70ac2e359e42665d69e8e51485ac5b9f
BLAKE2b-256 6aca086f63f37e37caf9c4f1ac5376a9b35340000811d2fc43d127269057384a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bbb25b5ad4e069dabbc125a19cc062e582d184f196d2045c50220750d633bb78
MD5 30dce3a69049ba2c898376b17e0b57c5
BLAKE2b-256 55909c61b75374c121aff7905a583fc0289e181d572b05d9ae7ef39eaea3b1af

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e0ff0902e9620c66f4928cf1f5de088eafcf469716570ce5ed6aa7da37150a92
MD5 c82fb711777f607246bd530cc9c2ac95
BLAKE2b-256 ef0597b4107d21ba675e935d337e9eeea696f647b1df129f04e61429b89398a8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d41c75981c30cb67a4f7509a4358d5bc41c42ed2ce2e22298e24743b31446148
MD5 05586355c48facdc5ec472a880bd4787
BLAKE2b-256 f23549fe06d2308be59d31d127b9ba52da7a445e1cd487e950240aded8d1a4ea

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 87e072dc558c8c9cbe581a18fe4e75fb6109c0ab8a42c415b6f1bb11d0aeac90
MD5 9cba190badfedb98ebc3f77e127ac711
BLAKE2b-256 aa10aa3e72b0e72ab0c2672b5c0436191b2673f91e11f29408b5774445b61538

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a389c4593ea02ca0542456908e839cdddedb2c343b3ae64b9ad25a0939243bf0
MD5 5bc43b6b96d2bb0da9b89ec5ebf86bab
BLAKE2b-256 7aa52be60e0deb7e5627764b83b4c448d6bcb09422adbf780b00ecbd5b27ff4e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6ff4ef31ee688c8c2e9ffdabeb9bba4edde211708c093571668bf09ecf3201dc
MD5 6dd478ee247612a5ccf044227d58d065
BLAKE2b-256 0251b20922ea5d26e47a8bf5395419c8e22f4d365881b190fcc22ebb3ff800f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f83535e3ea040cfc16601a587282cf79b5565852875a84cd41f6a2db69cac115
MD5 78e996f47d5ecf8ea9d877a7e3b32f87
BLAKE2b-256 217e47d41d3824ad0c42cca6704a92df8b174399b96f6878ce5a5b5b110de299

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.7-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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 586b9f15364b8f6729a11c02ad1b1dc5e5730e2627212a7b3312af950a86e53b
MD5 62e6c8f3acdb71f87a25b9e89212a568
BLAKE2b-256 c8d25f38250bf51740bdc87c52268568edebc30c93d07a6f7ee86adedaa2e9cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2773029c0d5e7f702f8364f4e24693999642b85a391a1b37cf08ea47f1926bd
MD5 a8e31e914a7e44d6a6899beb488d26f8
BLAKE2b-256 1165a4c64a40bff910168be48cb8f77e6e13de2390d899c29d36a527af07abd3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 3cdc551d15dc2fd35c6c950e457527bf4a06c130139beb28cf02e702bc05848e
MD5 45051382488e99bcff3d3adba042f318
BLAKE2b-256 212c351b57085d43fa915fd1c89235cf92ed87243bdcc2a5f0b79c161d32bbad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.7-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2bc36dbb42cbc360b1afa6a9f6252490f19be97fdba614b1cb200322c8c95f3d
MD5 7dc100a89167b19cdc833fc1159fbadc
BLAKE2b-256 792b801cdaa3f42511b6a5895657eca730dc98ed026d34a7cbf214c7df424847

See more details on using hashes here.

Provenance

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