scikit-fem
Simple finite element assemblers
What it is and what it does
scikit-fem is a pure Python library that converts mathematical finite element forms into sparse matrices and vectors suitable for numerical solving. It handles the core assembly task in finite element analysis—taking weak formulations of PDEs and producing the linear systems that solvers need. The library supports a wide range of element types (linear and higher-order, including specialized elements like Raviart-Thomas and Nédélec) and works with 1D, 2D, and 3D meshes.
The package is designed for researchers and engineers solving PDEs via the finite element method. It has minimal dependencies (only numpy and scipy for core functionality), contains no compiled code, and integrates with scipy's sparse solvers. Optional dependencies add mesh I/O and visualization. Assembly performance is competitive for many problem sizes, with benchmark data showing assembly times scale predictably up to large degree-of-freedom counts.
Use it for:
- Solve Poisson, Laplace, and other elliptic PDEs on unstructured meshes using Python.
- Assemble stiffness and mass matrices for structural mechanics or heat transfer problems.
- Prototype finite element formulations with custom bilinear and linear forms before optimization.
- Work with specialized elements for mixed or vector-valued problems in electromagnetics or fluid dynamics.
- Load and process meshes from external formats and solve coupled multiphysics problems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Transforms bilinear and linear forms into sparse matrices and vectors for finite element assembly, supporting 1D, triangular, quadrilateral, tetrahedral, and hexahedral elements plus specialized element types.
Yes. Active maintenance, permissive 3-clause BSD license, low install friction, and no known vulnerabilities make it a solid choice. The pure-Python design trades some speed for accessibility and ease of modification. Install if you need finite element assembly in Python and can accept that linear solve performance will dominate for large problems—the library excels at the assembly step itself.
Install
scikit-fem on PyPI
pip
pip install scikit-femuv
uv add scikit-fempoetry
poetry add scikit-femInstalling scikit-fem
Before you install
Low friction install with only numpy and scipy as core dependencies; pure Python with no compiled code. Active maintenance with latest release 70 days ago and steady repository activity.
License in practice
Licensed under 3-clause BSD (permissive), allowing commercial and private use with minimal restrictions; no copyleft obligations.
Quickstart
pip install scikit-fem
from scikit_fem import *
from scikit_fem.helpers import dot, grad
mesh = MeshTri().refined(4)
basis = Basis(mesh, ElementTriP1())
@BilinearForm
def laplace(u, v, _):
return dot(grad(u), grad(v))
A = laplace.assemble(basis)
Requires Python 3.10 or later.
Verify before relying
- Performance scaling characteristics for very large problems beyond 1M degrees-of-freedom.
- Availability and maturity of optional autodiff and supermeshing submodules requiring jax and shapely.
- Memory usage and solver performance characteristics for problems at the largest scales shown in benchmark.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, scipy |
| Maintenance | actively maintained — 70 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 288,590/month — #8,019 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scikit_fem-12.0.2-py3-none-any.whl
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
PyNiteFEAPyNiteFEA performs 3D elastic structural finite…
permissive · top 15,000 on PyPI
anastructAnalyzes 2D frames and trusses to compute…
copyleft · top 15,000 on PyPI
tetgentetgen wraps the TetGen C++ library to generate…
permissive · top 15,000 on PyPI
gmshGmsh is a three-dimensional finite element mesh…
copyleft · top 15,000 on PyPI
cytriangleCyTriangle wraps Jonathan Shewchuk's Triangle…
copyleft · top 15,000 on PyPI
linear-operatorLinearOperator abstracts structured matrix…
permissive · top 5,000 on PyPI
pygmshpygmsh provides a Python interface to Gmsh, a…
copyleft · top 15,000 on PyPI
spglmFits Gaussian, Poisson, QuasiPoisson, and…
permissive · top 15,000 on PyPI
meshioReads and writes mesh files in dozens of…
permissive · top 5,000 on PyPI
tabmatProvides efficient matrix classes for tabular…
unclear · top 15,000 on PyPI