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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

parosol_py-0.1.13-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.13-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.13-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.13.tar.gz.

File metadata

  • Download URL: parosol_py-0.1.13.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.13.tar.gz
Algorithm Hash digest
SHA256 70ace182535266b5157ab19cc54971dae8d9ca46c06fc0f8ab956dae4aa9c18f
MD5 09ef6c54d2ab19333c10e9d329ee99e9
BLAKE2b-256 62a2231b7636e3fc54b5a29e43759b2dbe2c6c1baede783df173242ad2c5d6eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1caf1f565568d25762d9d97e2ce2e502c45acf52afcaa7fce25f5606d1cd068f
MD5 4ce8ba688162ef0aa3878e45844358e5
BLAKE2b-256 484f931de40566b87fe565d91ebe681a0d18f059e82b03f79e03ca8b1e586e1b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6c17285e7b93dab810534684b1b1a3088adc9a62d322fd5cd4dd57101586b3db
MD5 a117a2a9636fb867110a0b85a7a4e88a
BLAKE2b-256 cd223c4829d536783273de43b4c1de3f42d21ae726c84aa9e49affe939b8a624

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 57b6f462ab85907499df8ec518d1e75a6e6b50fb4f96ccc777dd14727f399a09
MD5 0671dd0ef8d0b79ad65e1197ca458c90
BLAKE2b-256 fecab34f23d8b615ccf5a2e1d45fabe7d0de1375a0a180ae5811c6896000cd26

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8642e7577d9fb97fd547fd81726ed49a138a1be82dee8c578d40c28859793c12
MD5 71bb3ca3eeb9ae8e3d3dc45d83d9355b
BLAKE2b-256 79c43282cdc022ff09728bffb6c0fce39aa87c4d021ff5d9c712e22e4ae53d2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fec9f92c623139f49a14dadddeb876c9c58928ba70ab223053695c3c42137a40
MD5 31a3182295d561ac522beeeb78fd72a5
BLAKE2b-256 22b286fb919f9d4391a6f4e56c4e0f037ae079a1992392d4c227a0f20a8fd4c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8edb8e76401c6f7355c8c734e1875e6a50dd3d463cdfc5bf654267fc17045812
MD5 031bbc79c5f0c0494957c9fa9c61d4ff
BLAKE2b-256 44e85e4a54c0eee5f11183a2c63a51d9b9d9e6988e783bf3f7d99de3ffa69282

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp312-cp312-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 1cb2c38eb560bd1ba44d3bc58caf33c5c2bc4d33bcfd6d0de5e06ed9b836c36e
MD5 47af745def86f2c3d4b010095166da82
BLAKE2b-256 9e7f18d4bb5d05d6b88a9b2a629fcc1bebfbb8a21e48e8aea5daadaa9f0fea14

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d37d40af01cdc709d8c6e8d3aa39062488ce1e5fa9bdf2c56e6b1f1496a2fbc0
MD5 83b2f39963b34bea018c68d812654ca0
BLAKE2b-256 00200aebd5d6096799f691bbcfb1dc5f2996862e1f9962e90fe1bd743bc70f34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 404fabc10889e7fd41fec40419ea1e3dd9c3f60984fd97333bedf0b973f3d82e
MD5 3637c4022f923d16cdd45e799df66a51
BLAKE2b-256 6e95bc5cd2293c41d677d4a7b99e35879e5c28fd3248d8d283d2b22fa6b7d007

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 314dcaebd7ec72d1b1667f4209212b8525e8cead967e6c44c624913be6a35a06
MD5 0aa344a7c47ee4d466f3e16e02105d44
BLAKE2b-256 b29264de982c7da028250d46930b2c8d2efb17961750e32989f65bf8b574b8d6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp311-cp311-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 a417b69787548879b6d08ec9cafa36a784dc681bf4e645d3c3e41f1e601569b3
MD5 9b4d174e8587a32b776c77c0f981d9ac
BLAKE2b-256 bc2e8769361931fcfe7b5afe524ebf22050685a1d04a8ba001b7c6a073e26712

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parosol_py-0.1.13-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 99890bdf38a65e595f8182f7bac24d8bcedc365cda494e11d1b616b882e1f04b
MD5 63ad8ea9cd2f133503fe26ff6f4542a1
BLAKE2b-256 5143ff7cdf125e710003ac410f4518382fe193f2cef7818989d1724f09d1b707

See more details on using hashes here.

Provenance

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