Skip to main content

gemseo-petsc

PyPI - License PyPI - Python Version PyPI Codecov branch

Overview

PETSc GEMSEO interface.

This plugin provides an interface to the PETSc linear solvers and Ordinary Differential Equations (ODE) solvers. Linear solvers can be used for direct and adjoint linear system resolution in GEMSEO. The ODE solver provides the computation of the adjoints with respect to the initial conditions of the ODE and with respect to the design variables.

Installation

gemseo-petsc relies on petsc4py, the Python bindings for PETSc. PETSc and petsc4py are available on pypi, but no wheel are available. Hence, depending on the initial situation, here are our recommendations:

Linux environment

Using Conda

PETSc and petsc4py are available on the conda-forge repository. If you start from scratch of if you want to install the plugin in a pre-existing conda environment, you can use the following command in your current conda environment before installing gemseo-petsc:

conda install -c conda-forge petsc4py

Using pip

PETSc and petsc4py can be build from their sources by using pip. To do so, use the following commands in your Python environment.

pip install petsc petsc4py

By building PETSc and petsc4py from sources

It is also possible to build PETSc and petsc4py from the PETSc sources. To do so, please follow the information provided in the PETSc installation manual, and do not forget to enable the compilation of petsc4py.

Although it has not be tested, it is possible to build PETSc and petsc4py under a Windows environment, and hence to have the gemseo-petsc plugin working. A description of the procedure to build these dependencies can be found here

Bugs and questions

Please use the gitlab issue tracker to submit bugs or questions.

Contributing

See the contributing section of GEMSEO.

Contributors

  • François Gallard
  • Jean-Christophe Giret
  • Antoine Dechaume

Building petsc4py

From the container registry.gitlab.com/gemseo/dev/gemseo-petsc/multi-python-petsc, get the sources of petsc4py corresponding to the version of petsc currently installed in the system (currently 3.20.5).

Install the following dependencies with dnf:

  • redhat-rpm-config
  • python3.13-devel
  • hdf5-devel

then export NUMPY_INCLUDE=<path to numpy includes> then PETSC_DIR=$(pwd)/petsc-includes uv build --wheel -p python3.13 . where petsc-includes contains the symbolic links to:

  • include -> /usr/include/petsc/
  • lib -> lib64/
  • lib64 -> /usr/lib64/

Metadata

Release files for gemseo-petsc 4.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemseo-petsc 4.1.2
File Size Uploaded Provenance Actions
gemseo_petsc-4.1.2.tar.gz 2.2 MB Without provenance Details for gemseo_petsc-4.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gemseo-petsc 4.1.2
File Interpreter ABI Platform Actions
gemseo_petsc-4.1.2-py3-none-any.whl Python 3 none any Details for gemseo_petsc-4.1.2-py3-none-any.whl

Total release size: 2.2 MB

Release files / gemseo_petsc-4.1.2.tar.gz

Download URL gemseo_petsc-4.1.2.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
46e7793c07637266c9c15d926b9cd3e8ad6cf00f10d1ebbc7532435ecd0e2549
BLAKE2b-256 checksum
How to use checksums
d9bf86581382f607743fc51d4eb37e227b933eebc40f1d058b911c67e0a160e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / gemseo_petsc-4.1.2-py3-none-any.whl

Download URL gemseo_petsc-4.1.2-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c42a337da67daa60ecc66cf5e7fdd3f8877951c47e88601a7134d894c1eece00
BLAKE2b-256 checksum
How to use checksums
ec38bce3e97f375e085fa6538672b75e0af321f67a1c511ff2f9517dae76606d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Security for gemseo-petsc 4.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page