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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

File metadata

  • Download URL: parosol_py-0.1.10.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.10.tar.gz
Algorithm Hash digest
SHA256 d6763076b04aa206a8d7718a3d83d889d6915e09bb0c9ae29bcd4d20ff02389b
MD5 07bf3485e25e0a37311ad71d80ee382d
BLAKE2b-256 5174e2a7f9d5403c53046c1be91dfc6e511839008f1800a98e7f6542d848d82a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 877ca2ce991a5fe0e61006812e1beb9639c2cffd0cdfb1d5c158f5dd16452806
MD5 32b1057db08839830e0fbe1cadf82346
BLAKE2b-256 948b7cdd7daeaa3215eab2fc1d9d19bda4f174e371ac0a1c8afb6094f34aafe7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bcb8337e01b332bbd95b3f25e14bed85a3f5f6b07ab92f557a59ba8ac9104b04
MD5 b5d3293ce2a6a62cd2a8eb956be8b979
BLAKE2b-256 890d13ae083f3f5e97163b848eeea4bce5147ba64604e9623d97eb5896faac96

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d3b8d590ae70e21431a344fb70170993414bfd0c1c74c689d9ad41260acf79fa
MD5 749f2754e31aa711dfe5f889b8e10687
BLAKE2b-256 0244b21a10b3298efd9de34617951dfe49ba6f9efb8131c5fd76c73af9776eb5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0273697a53f63d2c1e90e4ec56d4a6ca1d394ec5f642d5fde73c82abcea58ba6
MD5 409591f00e109ea79b4b6225db69a69b
BLAKE2b-256 b5e8637a965d6e8bbfee0e96dc5fe4676e20a9d8a25465595bb0d251e6ba398c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2cdfc8f0b1d9fe03476f6c2c6692e1fa95ba88ac1aab8ce5cf9230a5234f5120
MD5 412de6b517ae2cf93f36fb38865b3eab
BLAKE2b-256 b0c99656fae555d85da73b90d0b1e4d07375e3f91fc5d7a14d824a563c9255b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0557266c960627922d98f9b75738898ff6745dde930d559c79383fc1a6d23669
MD5 f4723c06830280d4f3ff2e63ad19d397
BLAKE2b-256 f17950c2326c7776dbb45cae88dcd1a09ff329f6ecb0f6c3a5c5a46ffc1f3548

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 85e1d875f44580ff9dc28aebcf219113d8cb1dade9b7c523491583698a6813bf
MD5 0be6a38d1655938994dbae5c992bb798
BLAKE2b-256 bb090e54862567437a6b6f61aa9ee86f2fd400b56493a6232d79dec9196430ee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 682eb89e941bbe3f3ef499f641b6a4edc95638d07f27629d29307d10d744b5eb
MD5 db6a94fe647ea4522e82d67596a1c894
BLAKE2b-256 404050d6877603e4dbee1e755ed482d75864f8a8b7c383a9d302c93f370f594d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 aab16ee16e156b0a1d7646a94e7292b46a6066a2579c2c447ec32aafc07a63dc
MD5 3c04f7f17e4114877eef03bc6e0337a1
BLAKE2b-256 8cf60fc3599bfe69e00c26d40c717ad3e62acb23960dc8389cde33d136a0d536

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 21a1051da4e40921b4e6427143c38ab8e18099366491de6255174f3db9122039
MD5 88e86a739d66ef0509e42c4a8d10976a
BLAKE2b-256 c4f8b334e58ba363a62105ce624a7e9e71acc0fcca12775cfe8311a1cbd9ec78

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 6644d0dbf1eaad7cadcb3218f56e2c764dd0b3b73281a69b5faf3d178ab69bd8
MD5 7bf0c9d860a3c09c0d0a87ad0bd7eda6
BLAKE2b-256 62545f84d4b25a7712f0d13be08a82e2ff9fe1102d9ffbafde7f13801f11461e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.10-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b28f723fc364411d879f2c96f13ded9f3c27f071b14e003703bb58707068596c
MD5 a428dbb127d3e5bf56e27b3901350bb2
BLAKE2b-256 9140624034418ddabf2bb259fb5134dcbaf8eda1a9025b986c38838196ed4043

See more details on using hashes here.

Provenance

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