SfePy: Simple Finite Elements in Python

SfePy is a software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 1D, 2D and 3D. It can be viewed both as black-box PDE solver, and as a Python package which can be used for building custom applications. The word “simple” means that complex FEM problems can be coded very easily and rapidly.

SfePy can use many terms to build the PDEs to be solved, see Term Overview. SfePy comes also with a number of examples that can get you started, check Gallery, Examples and Tutorial. Some more advanced features are discussed in Primer. Examples of scientific results obtained with the help of SfePy are listed in Example Applications. See also Useful Code Snippets and FAQ.

SfePy can be used in parallel (work in progress), see Solving Problems in Parallel. There is also a preliminary support for the isogeometric analysis, outlined in Isogeometric Analysis.

The easiest way to install SfePy is to use Anaconda or pip, see Installation.

License: BSD


If you would like to cite the SfePy package in a paper or presentation, the following references can be used:

  • General article:

    • Plain text:

      Cimrman, R., Lukeš, V., Rohan, E., 2019. Multiscale finite element calculations in Python using SfePy. Advances in Computational Mathematics 45, 1897-1921. https://doi.org/10.1007/s10444-019-09666-0

      (preprint: https://arxiv.org/abs/1810.00674)

    • BibTeX:

        title =        {Multiscale finite element calculations in Python using SfePy},
        author =       {Cimrman, Robert and Lukeš, Vladimír and Rohan, Eduard},
        issn =         {1572-9044},
        doi =          {10.1007/s10444-019-09666-0},
        journal =      {Advances in Computational Mathematics},
        year =         2019,
  • Performance related data for version 2021.1 and a description of the multi-linear terms implementation are given in:

    • Plain text:

      Cimrman, R., 2021. Fast evaluation of finite element weak forms using python tensor contraction packages. Advances in Engineering Software 159, 103033. https://doi.org/10.1016/j.advengsoft.2021.103033

      (preprint: https://arxiv.org/abs/2107.04121)

    • BibTeX:

        title =        {Fast Evaluation of Finite Element Weak Forms Using Python Tensor Contraction Packages},
        author =       {Cimrman, Robert},
        issn =         {0965-9978},
        doi =          {10.1016/j.advengsoft.2021.103033},
        journal =      {Advances in Engineering Software},
        volume =       159,
        year =         2021,
  • Example Applications have links to related scientific articles.

  • Other references:

    • R. Cimrman. SfePy - write your own FE application. In P. de Buyl and N. Varoquaux, editors, Proceedings of the 6th European Conference on Python in Science (EuroSciPy 2013), pages 65–70, 2014. http://arxiv.org/abs/1404.6391.

    • R. Cimrman. Enhancing SfePy with isogeometric analysis. In P. de Buyl and N. Varoquaux, editors, Proceedings of the 7th European Conference on Python in Science (EuroSciPy 2014), pages 65–72, 2014. http://arxiv.org/abs/1412.6407.


Work on SfePy is partially supported by the following ongoing projects:

  • project GA24-12291S (Multiscale modelling of acoustics-driven fluid suspensions flows in adaptive porous structures) of the Czech Science Foundation, since 2024

  • project GA23-06220S (Flexoelectric periodic structures for fluid transport and energy harvesting) of the Czech Science Foundation, since 2023

  • project GF22-00863K (Controllable metamaterials and smart structures: Nonlinear problems, modelling and experiments) of the Czech Science Foundation (LEAD Agency), since 2022

See also Past Support.

Manual in PDF

PDF version of the documentation: sfepy_manual.pdf

Indices and tables