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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

File metadata

  • Download URL: parosol_py-0.1.12.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.12.tar.gz
Algorithm Hash digest
SHA256 d8eae3f9c39a2bbf258df0096f625c117b9d631666e0f90fd22bdca960fe8f65
MD5 1e366df69718d9b2f0c533ecf3f8aa20
BLAKE2b-256 aa723a3fe838f5224f7afcb1ddfe588ef2889491a4e89749bf5facd195884039

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1784bb32e4b98b974e34841537a5e80656656082f2ab8b0c56d3bcd35928d250
MD5 31168f4687f0d90b9b877074a7f3e324
BLAKE2b-256 543e72b9810d37d174d2f1c8d3faac9cff0af2fabb2c95d235fdc2718500909c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c9f8de812573659f62c154915b98a40c654bc96f01a6affe944887f3b94577e
MD5 97f5976c334887c8bb44cca32e762237
BLAKE2b-256 bdae8e058b416f0a3e86c2c87ce3b5c08cf1d6ea9133a2ae3177f6f73803643c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 621076fffba13a5aad6f5e2f20f4bd380485e1631e065a5b4a19eb1e1a730b9f
MD5 fb40883fb26fa7470f49c1ea9d90d471
BLAKE2b-256 b26172b1d48e2998408c51299591c0ca2f793bf48f2f70f2421af58b5eba6701

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e040cb855bbf88f288e2beaa27d212e013fd48f368fc1422b6ef4c297f76947b
MD5 ebde9503f099e4a7623a331b0beb9fe0
BLAKE2b-256 dfdf9a884d55b36701650d268beadfeea0608008f13a2edeb88fe6b4dd195ebf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ebffa103e412b7d804a65d14ce32ed27f1ae23182d1498be75c1051268443230
MD5 575b4967cfb76fc6bb95ba36ca4667dd
BLAKE2b-256 be22d9ddbe121456324b6e906bc9192b4088982cd7e64ce779e0146fb5ef6284

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22bb38c30f301f519317038729b2c995bb2b43af3378bd1e7f9499e2e271ad57
MD5 b8f65cc75cab75dec8faf77dc1af071d
BLAKE2b-256 7975e4514e55fbbaa0fea5dc8d4c47977543ad445f0384b870acf00c5d277b68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 8de4a0994a6b3c4738ae7fc18f9436dd21c30f0bea58bc557abf9b25464fa320
MD5 74aefc0075c7b9b0c4a02a92d9130b6f
BLAKE2b-256 899674be27b9f45226fd92f200a692fd5a176027400757d54a20bd7ef115a021

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 77b097cc985b03c63b0e411c36f18278abf8dc0c4c65f97d41b23af21e38b9f8
MD5 696517472acd87f14e6e3af812f3d7d5
BLAKE2b-256 7917e63ef06cc3af4dfd834096bb29a1407dcb3a2e37b704bf1e6a9303e7bbd6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9fb988899089e09203d407701d72096dc9ea2511c37eb76b87463e8b540b3584
MD5 015d9a26b561fae4aef3a4fbb761d62b
BLAKE2b-256 43ebf8faa2a7a8b0f63ca76f2ea26e61d88f85c509949244515f0093b9088e4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66f0588a000ac07ac6bb3b91ada6f51e6aee07338c7c3282cf197f02c6398c0e
MD5 716cd2d5cd23c234cd2891a20dc02a8d
BLAKE2b-256 0b6463b2078427122e9c3aab6966220efdb3f6e807c9adde1b48143ed7d0fc23

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e17fcc4b9ac07cf63df0685e5b5ce6d00c1d064704b108678a00a05fc54a8b58
MD5 47e7e6206f5bf108a128c89cc2613ebf
BLAKE2b-256 d655c1daa10d10ffcd23e225bbfa2034439f60b8e59581e2e40891512c82b56c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.12-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b62f40d8d2dc50c4e98d1319d43ddbe2ab965dc72d21ed6ec19f1b7596c9f454
MD5 e15e38f8ebb313619f6942630c1712b4
BLAKE2b-256 7d95a546bd5caf1ea414eab903aa7578e0fcb8069a08f567e800345a026240f4

See more details on using hashes here.

Provenance

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