Skip to main content

PETSc GEMSEO interface.

Project description

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/

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

gemseo_petsc-4.1.2.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemseo_petsc-4.1.2-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file gemseo_petsc-4.1.2.tar.gz.

File metadata

  • Download URL: gemseo_petsc-4.1.2.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for gemseo_petsc-4.1.2.tar.gz
Algorithm Hash digest
SHA256 46e7793c07637266c9c15d926b9cd3e8ad6cf00f10d1ebbc7532435ecd0e2549
MD5 3ef12241421013aaac159e5d4034977b
BLAKE2b-256 d9bf86581382f607743fc51d4eb37e227b933eebc40f1d058b911c67e0a160e1

See more details on using hashes here.

File details

Details for the file gemseo_petsc-4.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gemseo_petsc-4.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c42a337da67daa60ecc66cf5e7fdd3f8877951c47e88601a7134d894c1eece00
MD5 36d49bdd14e4f639e91e5c304d79b411
BLAKE2b-256 ec38bce3e97f375e085fa6538672b75e0af321f67a1c511ff2f9517dae76606d

See more details on using hashes here.

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