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

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.4-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.4-cp313-cp313-macosx_15_0_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

parosol_py-0.1.4-cp313-cp313-macosx_15_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.4-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.4-cp312-cp312-macosx_15_0_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

parosol_py-0.1.4-cp312-cp312-macosx_15_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.4-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.4-cp311-cp311-macosx_15_0_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

parosol_py-0.1.4-cp311-cp311-macosx_15_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: parosol_py-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8bb87d3b0801d8878c1db296e74640bc4337b006eb021dc5cc0423774c3d4cc4
MD5 76827d2ec83d4a2ab6e224f0d4c1d6b6
BLAKE2b-256 badae40785b0b02cdf979dd0f8535b0bf9e816ba6d4f6592801f29add2dd50e1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4dd0342d1e0d713d3df264d69c2ad099b5f0aaba334809e8804e4ae29c07c34d
MD5 51154e6ca8470358738cde5a189e97aa
BLAKE2b-256 fde0e3ef36b6a5858a33584377461ab494e64f5e96e57920c2c0c04fc658afa5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7367411ea7018cb14f9fdb2bc15a1fa266b4fc62f88c035c98bd6f0fd85b181f
MD5 cd370ed9da7b6bcd35d63659f1112f9d
BLAKE2b-256 5c533764ce0f39f8866aa8e2f13ab41de42fe26b32d0c97f3ca37954f5cc7a15

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c2c7cab888225f99152258c72659795d34bf07c57170010bbb19aed11acb1754
MD5 edfba7d0d84565b328a5f2afc15a5d83
BLAKE2b-256 a07cfa7ca4ee441efcb2a27d4134574c30a8f7a84f68ae94014614dde1194b3b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bb3ef9629d65c67b1dd9aa7636e33d30d5cc67040df4cb89c55ea2c6a05ea41c
MD5 0b4f8ed099de37ea59d9408470e07cf5
BLAKE2b-256 e64a42aeff1ad05dd1362ac6e7113a1764d10a2a75d175b37b03e87cb74886fd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 458352617cfd9606b8b1fe2f4eb07afd2c731daa9f538003639d7543b30f7a21
MD5 b78b1acde7b45a5f3234d19e804ddcff
BLAKE2b-256 6a125819024b1cf6820b03c48a9c6148fe77f858bb8477557759955b422241f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c234530ed686047be7130d6f407018ceb2527fd277a227f9beebceb489f71d16
MD5 ea37594732a3c31ab8a890d20b610261
BLAKE2b-256 5af94b92ab6f800f80d59e7308b463f158038ab67b08a29ee7978da487747c69

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 59aa63c097cdb30e6890f222b7b4bcf2cf358a63148a17c29fabd0be2b900e9a
MD5 985dfba33f55a3d021aa7a4621d60521
BLAKE2b-256 5768965f5c93a54b889271ba01f44680c75a0b055911ed2abca70ba73dd88baf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 890a93f7c0ed89e49d28d0e92407af8a174b1004f1ad7e71c036b2ba87433e07
MD5 f1f1fd049e182d734b90ff7419dd5fef
BLAKE2b-256 05601f8c81e807df942094204df778dbcab866654c2ca0a1c485b536d17cee9a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5263d73c3688d0b0a07b5bf2a359d2836d24ef4c6fbd0366f192e5c1dcc5f731
MD5 64a8235b29a4cfcc419ce8a29ce7f4d8
BLAKE2b-256 7ff4bd9b450eaf8a7457e597551c05b53d9b6a2c2646619078ef7ac8bc16ae19

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 833da97ba907429420cbcb16309565ed8b9213ebc03b98fd4070f480618f7428
MD5 335f836b9928408b5bd995dbc859d442
BLAKE2b-256 58b7693d448e61127c97038ca55498abc9ca0a98cabecd88ec2cad0b0f0254e5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c03518319987e5cbde89f98b50c47b5d8bca83aa504d56537c37441965d31672
MD5 8fffeeece269984aa9371d4d4a17d099
BLAKE2b-256 e4e334757994076d7af91973334ee1fe07450e3e77ae1d5c743e10c5805f924f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.4-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c60a421e5a110d92291b2c67db30502655a4fb528c3e7ec4cda5f9926aa19fba
MD5 ad9263eccf0b13820950ea34b7380d3e
BLAKE2b-256 5a0a5d422fe475e9fc1ca21f559c4c25093e5370c3dd1c19de8af99ab2d9669a

See more details on using hashes here.

Provenance

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