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

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.6-cp313-cp313-manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.6-cp312-cp312-manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.6-cp311-cp311-manylinux_2_28_x86_64.whl (17.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

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

File metadata

  • Download URL: parosol_py-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 1a2d201ecd37238b28347cba5d72327dd476b47eba37811b82c2b19c84d7f97a
MD5 28f3fc1c4e21e0b212d4796279225367
BLAKE2b-256 cab758b041aa198ab6fe4a62661569b06d81143adadf8d730c27b14816a9e77a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.6-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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 11f433dbea2fc62735fd047f2c87964848d0bf2eeef3e2927bd9dde5e3fd65c2
MD5 8b05e50a1389bcdab2d9ee2a944156f9
BLAKE2b-256 51059500a73f6b0ec01f5e41d4469c14ca84961ab8acf00d29de2aa82968cc51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04752b5c9dfc7ffd51f6bd264ed4b04808f44df8895c04cbab545feea7b84ce7
MD5 db0498d6fbd55da6a5865eeec6b75f22
BLAKE2b-256 8daebbcd958646a0b7676722fc9341c955a9f27cf427cf033da20e8636ccc511

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 06ebc3a1e41998978f3d7d12d51ff38d07b531cb8acf76d42e07a0247024b007
MD5 a4a37c0523477bb29910d95199239c30
BLAKE2b-256 02f78c71ac2b767f362e030ef21374562f7ef05de2b566c9ff524a9b003e0615

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ce1140382ecdb2c5067fee058a0221b48d729936eb5cd96d17d0265512987cc6
MD5 e3043562ef9583244dfcae92a0846841
BLAKE2b-256 974830f91627bf2573991d060166bc0152d1f17013af8bbe0926a90b38014183

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.6-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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 481f4483e00c456174b3523011d895ee2700d3079d3206686078ab1e4a7c87ac
MD5 ae0c7795dd24b6beac6c983a559b165a
BLAKE2b-256 9a177c421c94e809cf5d528375f264c341c898c6b6382eb34e1c87aa4b6c7ba6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c23cc84857a3634891f46664f31088bda5484ea290ff720aead7455db7fec4e
MD5 f947585e3a956735484e910cabac7c79
BLAKE2b-256 e1182607526cbadf0aaaa2112a3f7e4961c371009a5a558486e78b703b6acf27

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d0adcc63b1e56cf56bb8c06ccddbbd21e9d5a4c4f585b9f3e4bf3f3bc8a33146
MD5 9c0c13817fe1bc71fbc4e66a2db95bf2
BLAKE2b-256 a2f57c2dd1b82728306f754a41e7b05495e5e57d73efc953396a708042b3d422

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d7f04d56e39d0121468835ee6aa6694ecc380698acbbefa43bfcb8ac05e85996
MD5 16bd7552dd4ccbff1a28599f67848c4a
BLAKE2b-256 9403d74dcc7c37e16a1c654bee4cc83a407f8828c16c96118dba2ff66a01a468

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.6-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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c9a3e70ebf9f64d2d8465be401b934bbb1819af82bd7b37681b939185b514a0
MD5 005f8dc421e5e6cf7668caa2717c26bd
BLAKE2b-256 068a78efcd34bb078f057b54b597232fb13e8e2c1e3b3b4f5e1eb383937c7db8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf80585a2f9d0e76da9e74fada91c4b2c976919af7358db22f477e84af63964a
MD5 a94e462927932899a0358aebcef8b3e5
BLAKE2b-256 c0482bfdb3664626f8a4e27916becd22328c6d7fd5bdc8cb399d73ba597c27d5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 b8112570bd1268c19794b1afbcdfa2df190d7600690d201b088e6a2ae245a681
MD5 e24813d83c772d65ee648b0ec2223161
BLAKE2b-256 35f67ec1d3e8df1d03d0d3c1e66bcd3c5ce15ced88e9cdc17013096e92b0d908

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8224d8ac82a6852713d0595b411423ddd32c1d9d55b87af75c28759ed43c07b6
MD5 bd8852a85b166f6429ea31c6b6aceef4
BLAKE2b-256 e8f6ec4f5497dbd6db2107ffdaf7a769ad951c76756c3a0f7b7f0b2936e7ae03

See more details on using hashes here.

Provenance

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