CALFEM for Python
Documentation
https://calfem-for-python.readthedocs.io/en/latest/
Manuals
Updated manual: https://calfem-python-manual.readthedocs.io/en/latest/
Original manual: manual.pdf
Manual for with improved mesh: manual-mesh-module.pdf
Background
The computer program CALFEM is written for the software MATLAB and is an interactive tool for learning the finite element method. CALFEM is an abbreviation of ”Computer Aided Learning of the Finite Element Method” and been developed by the Division of Structural Mechanics at Lund University since the late 70’s.
Why CALFEM for Python?
While both the MATLAB and Python versions of CALFEM are open-source (MIT Licensed), the key difference lies in the environments they operate in. MATLAB is not open-source and requires expensive licenses (for commercial use), which can be a barrier for many users. In contrast, Python is a free, open-source programming language, making CALFEM for Python more accessible and cost-effective for a broader audience, including those in academic, personal, or commercial settings.
CALFEM for Python is released under the MIT license, which enables its use in open-source as well as commercial projects.
Installation
Install CALFEM for Python using
pip install calfem-python
This also installs the required dependencies NumPy, SciPy, Matplotlib, tabulate and the Gmsh Python module used for mesh generation. No separate Gmsh installation is needed.
Visualisation
calfem.vis (an alias for calfem.vis_mpl) draws geometries, meshes and results using Matplotlib. calfem.vis_plotly provides the same functions as interactive plotly figures. The former visvis based module is available as calfem.vis_visvis, but is deprecated.
Optional dependencies
Some modules need additional packages, which can be installed as extras:
| Extra | Installs | Needed for |
|---|---|---|
plotly |
plotly | Interactive plots with calfem.vis_plotly |
io |
meshio | Mesh import/export with calfem.io |
vedo |
vedo | 3D visualisation with calfem.vis_vedo |
vtk |
vtk | Visualisation with calfem.vis_vtk |
pyvtk |
pyvtk | VTK export with calfem.utils.export_vtk_stress |
qtpy |
qtpy | The geometry editor calfem.editor, using an already installed Qt binding |
pyside6 |
qtpy, PySide6 | The geometry editor calfem.editor with PySide6 |
pyqt6 |
qtpy, PyQt6 | The geometry editor calfem.editor with PyQt6 |
visvis |
visvis | The deprecated calfem.vis_visvis |
For example:
pip install calfem-python[plotly,io]
When using conda, install the Qt binding from conda-forge instead (e.g. conda install -c conda-forge pyside6) together with the qtpy extra. Mixing a pip installed Qt binding with Qt libraries from conda can fail with DLL load errors.
References
-
Forsman, K, 2017. VisCon: Ett visualiseringsverktyg för tvådimensionell konsolidering i undervisningssammanhang - http://www.byggmek.lth.se/fileadmin/byggnadsmekanik/publications/tvsm5000/web5225.pdf
-
Edholm, A., 2013. Meshing and visualisation routines in the Python version of CALFEM. - http://www.byggmek.lth.se/fileadmin/byggnadsmekanik/publications/tvsm5000/web5187.pdf
-
Ottosson, A., 2010. Implementation of CALFEM for Python - http://www.byggmek.lth.se/fileadmin/byggnadsmekanik/publications/tvsm5000/web5167.pdf
-
Eriksson, K, 2021. CALFEM Geometry Editor - An interactive geometry editor for CALFEM
-
Åmand, A, 2022. Development of visualisation functions for CALFEM for Python
Metadata
Release files for calfem-python 3.6.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| calfem_python-3.6.16.tar.gz | 259.9 kB | Without provenance | Details for calfem_python-3.6.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| calfem_python-3.6.16-py3-none-any.whl | Python 3 | none | any | Details for calfem_python-3.6.16-py3-none-any.whl |
Total release size: 492.1 kB
Release files / calfem_python-3.6.16.tar.gz
| Download URL | calfem_python-3.6.16.tar.gz |
|---|---|
| Size | 259.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98ab4d606ba1d113274be199bf2233321484349fb8a5a37b2c4cd42fe9c00fbb
|
|
BLAKE2b-256 checksum How to use checksums |
e54b864d37e47e2feff3807003239c11061ca37bae92795ee5e26e84daa130a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.29.2 CPython/3.13.5 Windows/11
|
Release files / calfem_python-3.6.16-py3-none-any.whl
| Download URL | calfem_python-3.6.16-py3-none-any.whl |
|---|---|
| Size | 232.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4849cba03b373c309ed381a6d644a17f73af1b6d9eb330bb1adc5041c6859f6
|
|
BLAKE2b-256 checksum How to use checksums |
32db2ec38b3af597c7d8d576378828dd563c82088a3c3565c634e3ac65bf15de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.29.2 CPython/3.13.5 Windows/11
|
Security for calfem-python 3.6.16
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.