Skip to main content

pyxel

python library for experimental mechanics using finite elements

pyxel is an open-source Finite Element (FE) Digital Image/Volume Correlation (DIC/DVC) library for experimental mechanics applications. It is freely available for research and teaching.

pyxel logo

In its present form, it is restricted to 2D-DIC and 3D-DVC. Stereo-DIC (SDIC) will be added later.

The gray level conservation problem is written in the physical space. It relies on camera models (which must be calibrated) and on a dedicated quadrature rule in the FE mesh space. For front-parallel camera settings, the implemented camera model is a simplified pinhole model, with 4 parameters in 2D (2 translations, 1 rotation and the focal length) and 7 parameters in 3D (focal length, 3 rotations and 3 translations). More complex camera models (including distortions) could easily be implemented within this framework (next update?).

The library natively includes linear and quadratic triangles, quadrilaterals, tetrahedra and hexahedra. Results can be exported in different formats, so that the measurements can be post-processed either with Matplotlib or with Paraview.

pyxel example results

0. Installation

  • Install it from PyPI. The package is named pyxel-dic, but it is imported as pyxel:

    pip install pyxel-dic
    
    import pyxel as px
    
  • Alternatively, clone the git repository and install it in editable mode:

    git clone https://github.com/jcpassieux/pyxel.git
    cd pyxel
    pip install -e .
    
  • Dependencies (numpy, scipy, matplotlib, opencv-python, scikit-image, meshio, gmsh) are installed automatically by pip. Python 3 is required.

1. Script files

  • pyxel is a library: for each test case, a script file must be written.
  • A set of tutorials is provided in the ./tests folder to illustrate the main functionalities of the library.

2. About meshes

A Finite Element mesh is required for the displacement measurement. In pyxel, a mesh is entirely defined by two variables:

  1. A Python dictionary for the elements. The key is the element type label (gmsh numbering) and the value is a numpy array of size NE * NN, where NN is the number of nodes of this element type and NE the number of elements. Example:

    e = dict()
    e[3] = np.array([[n0, n1, n2, n3]])
    
  2. A numpy array n for the node coordinates. Example:

    n = np.array([[x0, y0], [x1, y1], ...])
    

Notes:

  • pyxel is able to read and write all the mesh types supported by meshio.

3. Minimal sample code

To run a simple 2D-DIC analysis:

import numpy as np
import pyxel as px

f = px.Image('img-0.tif').Load()
g = px.Image('img-1.tif').Load()
roi = np.array([[100, 100], [500, 500]])
m, cam = px.MeshFromROI(roi, 50, typel=3)
U, res = px.Correlate(f, g, m, cam)

4. Output files

Results can be post-processed directly with Matplotlib:

m.PlotContourDispl(U, s=30)

A more convenient way (especially in DVC) is to use Paraview:

m.VTKSol('vtufile', U)

5. Terms of use

This program is free software: you can redistribute it and/or modify it. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.

pyxel is distributed under the terms of the CeCILL license, a French free software license agreement in the spirit of the GNU GPL.

6. Dependencies

numpy, scipy, matplotlib, opencv-python, scikit-image, meshio, gmsh

References

Jean-Charles Passieux, Robin Bouclier. Classic and Inverse Compositional Gauss-Newton in Global DIC. International Journal for Numerical Methods in Engineering, 119(6), p. 453-468, 2019.

Jean-Charles Passieux. pyxel, an open-source FE-DIC library. Zenodo. doi:10.5281/zenodo.4654018

How to cite

@article{passieux2019classic,
  author  = {Passieux, Jean-Charles and Bouclier, Robin},
  title   = {Classic and Inverse Compositional Gauss-Newton in Global DIC},
  journal = {International Journal for Numerical Methods in Engineering},
  volume  = {119},
  number  = {6},
  pages   = {453--468},
  year    = {2019}
}

@software{passieux_pyxel,
  author = {Passieux, Jean-Charles},
  title  = {pyxel, an open-source FE-DIC library},
  doi    = {10.5281/zenodo.4654018},
  publisher = {Zenodo}
}

Metadata

Release files for pyxel-dic 2026.11.30

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

Source distribution (sdist)

Source distribution for pyxel-dic 2026.11.30
File Size Uploaded Provenance Actions
pyxel_dic-2026.11.30.tar.gz 115.6 kB Without provenance Details for pyxel_dic-2026.11.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyxel-dic 2026.11.30
File Interpreter ABI Platform Actions
pyxel_dic-2026.11.30-py3-none-any.whl Python 3 none any Details for pyxel_dic-2026.11.30-py3-none-any.whl

Total release size: 234.1 kB

Release files / pyxel_dic-2026.11.30.tar.gz

Download URL pyxel_dic-2026.11.30.tar.gz
Size 115.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a4b05f51a7cb908a576d9f746f3895d1a0b2d8053f46097d83c3381044748aa9
BLAKE2b-256 checksum
How to use checksums
69b4bb9cdb2be6c9a32d6b09dd0595dfaa6e68b4916ec4757866f9e9898d2c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / pyxel_dic-2026.11.30-py3-none-any.whl

Download URL pyxel_dic-2026.11.30-py3-none-any.whl
Size 118.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4220a245dbae9276e704499e58b37edb5b951791abb03fd576478576a1ce20f7
BLAKE2b-256 checksum
How to use checksums
c570cdb3f7088df41b9ef34741dd7c53b19a5a745f00de0e4312a935543dde1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Security for pyxel-dic 2026.11.30

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.

Release history Release notifications | RSS feed

This release

2026.11.30 This release

2 release files No provenance

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