skillfed

scikit-fem

Simple finite element assemblers

scikit-fem v12.0.2 288.6K downloads/30d#8,019 on PyPI644
Permissive license Active released

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-fem

uv

uv add scikit-fem

poetry

poetry add scikit-fem

Installing 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

Intended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

finite element assemblybilinear form to matrixFEM sparse matrixfinite element method Pythontetrahedral element basisRaviart-Thomas elementsFEA matrix assembly
finite-elementspde-solvernumerical-methods

More Mathematics packages