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:

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 because the bundled native solver depends on Homebrew HDF5/OpenMPI libraries built for that target.

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.3.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.3-cp313-cp313-win_amd64.whl (252.5 kB view details)

Uploaded CPython 3.13Windows x86-64

parosol_py-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

parosol_py-0.1.3-cp313-cp313-macosx_15_0_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

parosol_py-0.1.3-cp313-cp313-macosx_15_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

parosol_py-0.1.3-cp312-cp312-win_amd64.whl (252.5 kB view details)

Uploaded CPython 3.12Windows x86-64

parosol_py-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

parosol_py-0.1.3-cp312-cp312-macosx_15_0_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 15.0+ x86-64

parosol_py-0.1.3-cp312-cp312-macosx_15_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

parosol_py-0.1.3-cp311-cp311-win_amd64.whl (252.5 kB view details)

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

parosol_py-0.1.3-cp311-cp311-macosx_15_0_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.11macOS 15.0+ x86-64

parosol_py-0.1.3-cp311-cp311-macosx_15_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: parosol_py-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7c757282046c34dc52a1c1e1383f57c7a779f614551417931b86fdc273f71ee9
MD5 db3b4d78a0dbc1b8802ad8288b9d24dd
BLAKE2b-256 0b15b1dee5a6c86730f966e9f5dee87c8648a141d90b1be3ab81ae62881bf2a8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 252.5 kB
  • 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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9ddb935d4876f08419a220b3fd6957118c84e3072370f2b408a78ac810d07bfb
MD5 3cfab3eced1ce97ed6bd505c6ea47f43
BLAKE2b-256 6d0298716651531b5842ed84ff0e140f0b3a42d43376eb3e06f3c73d24ad1e28

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b522bf0e5cd42afdeb1036862c3ba1b26ab99fbbbde56aceb7a2f9120e348e9e
MD5 59417cfbf18b3c44990ffdf7c23050e1
BLAKE2b-256 75b400d3f564f41847bb5fc652a38ca9e633f5e24284b26de90e5fd23dff09bf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6e50f7abbd2b22b56fe03ad50fb0aae843d961537862c7eb6f777ecba0ae65b4
MD5 a5a8e633261a48f2ddaf2b6aab57d159
BLAKE2b-256 6d10c413964b8323f8f8d9983c6dec2a95a683b85d10b71f377f3da4b2dfc738

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 87e822a296f2f69866d7ecf382deb56c55584a0e77a422c0d4c7e7b00f722dbf
MD5 67d11245db4f34d4f286dced928252b6
BLAKE2b-256 d17f52dd925b4ea48e23388fb98a1f0edc70652ab6181980ba12d79e09e8262e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 252.5 kB
  • 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cb94ab26fe2618f8f9d097aa4c5bf710fadc3fdf6aa8d0a0d82215a5f2d496f0
MD5 19054fd247b6b5f9eca832112a30ef80
BLAKE2b-256 8007bbfa97dac21f624d027c378a153b620caab50253ee4447e0a2063577a1c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 334d0693a78fbb247e483bd1346e8fdb99194d4bcf9817c4d1315ff466db8ac7
MD5 0f9ef4cbbb153e95ac8dfe08afb9be6c
BLAKE2b-256 4d15a91861f36d3338507ec283a2d2130ca7e1114a09db699bbceae70fcf704f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 8bd442b73deadbe2b769d88f9d2603ea0742dabb1db75db3c82a80a728495400
MD5 c184ced9a90de271c56b5b83187a8e1a
BLAKE2b-256 4fd03ecc414aeec936ee3c3bb1f19e3042c474b03502a64d132d95dd39bf0e19

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 aa8a8c23a3f6d249e21fbd5d7b284c74fb9940c5b1e09e8cfc9930231f8f6c13
MD5 f4008e505d87e58fe297198d180dba7a
BLAKE2b-256 43f09038d989233cc0ed0c3de3646af87ce90949ffcdec6283a280b03431424f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: parosol_py-0.1.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 252.5 kB
  • 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9879b7b27cfb343123cdf8ec96a8d47360f77105ac346356085fb1ce88915d0c
MD5 49ec7d108c4329c56a00e5a43022113c
BLAKE2b-256 b3d764a1dfa26ea840160472c2ca166565085507181df34848d577ce8354e50e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d3a05b05aba664dc5c780630b8f4357a30906eeed2794a0dfdf61eab6c2e26da
MD5 60b1b4f45cf806a77d9b6d61010bb835
BLAKE2b-256 2160d01070a90c28cee02131aef9f14485a090811705d7b2e27dce123ba2831b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 c2e7b20c349bee66e7c5df58e3907ec83de4ce66d10895d3667138338a6cf0d7
MD5 27ac6d1118a49db5a0f541dcdb563f9c
BLAKE2b-256 2c3011e0898af8ec0fc6d71524ba243cba2a0f12899183c90374e472d9f2447b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ec1136b0cc9bcb59a55d410f7c5890fd004e80760b63a6cd775d83abb94489f1
MD5 e7aa281d8fcc11debafa2917b214191c
BLAKE2b-256 08ece8385b13c2153bf80224a76d1ebc136228b5a37a15e9e2ffbd0e8a951abf

See more details on using hashes here.

Provenance

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