# FiPy: a finite volume PDE solver you can read and extend

> FiPy is an object oriented partial differential equation solver written in Python using a standard finite volume approach, developed at NIST for materials science problems such as phase field transformations and electrodeposition. It suits research groups that need coupled elliptic, hyperbolic and parabolic equations without buying or rewriting a solver, and it runs on NumPy and SciPy rather than a compiled code base.

**usnistgov/fipy** — FiPy is a Finite Volume PDE solver written in Python

- Repository: https://github.com/usnistgov/fipy
- Website: http://pages.nist.gov/fipy/en/latest
- Stars: 643 · Forks: 185
- Language: Python
- License: NOASSERTION
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/usnistgov-fipy

## A PDE solver from NIST's materials science groups

FiPy is described as an object oriented, partial differential equation solver, written in Python, based on a standard finite volume approach. It was developed by NIST's Materials Science and Engineering Division and Center for Theoretical and Computational Materials Science, inside NIST's Material Measurement Laboratory.

That origin is visible in the project scope. The implemented models are phase field treatments of polycrystalline, dendritic and electrochemical phase transformations, drug eluting stents, reactive wetting, photovoltaics, and a level set treatment of the electrodeposition process. These are not demo problems. They are the questions a national metrology institute works on, and the examples directory carries a matching set of cases: cahnHilliard, chemotaxis, convection, diffusion, elphf, flow, levelSet, meshing, phase, reactiveWetting, riemann and updating, plus a parallel.py example and a benchmarking directory.

The framework is published on PyPI as FiPy, on CondaForge, and through a Binder link that opens the examples as notebooks, and the documentation is built in two versions, a stable one and a development one, at pages.nist.gov/fipy.

The audience is a computational scientist who already knows the mathematics of their problem and needs a solver they can inspect, extend and couple to other Python code, rather than a black box they configure through a settings file.

## Why a Python solver, according to the project

The project states its reasoning directly, and the argument is about the cost of building tools rather than about performance.

The solution of coupled sets of PDEs is ubiquitous to numerical simulation in science, and numerous PDE solvers exist using a variety of languages and numerical approaches. Many of them are proprietary, expensive and difficult to customise. The consequence described is that scientists spend considerable resources repeatedly developing limited tools for specific problems.

The approach taken is to combine the finite volume method with Python, with the stated goal of a tool that is extensible, freely available, and backed by the existing suite of Python tools for array calculations, sparse matrices and data rendering.

That last clause is the practical one. A finite volume discretisation of a coupled system produces a large sparse linear system, and in Python that system goes straight into the SciPy sparse solvers without a wrapper layer, an interface definition language, or a file format to serialise the mesh into. The cost of that convenience is real, because Python level loops over a mesh are slow, and a reader evaluating FiPy should expect the performance ceiling to be set by how the discretisation is vectorised rather than by the linear algebra.

What you get in exchange is that the same language handles your data loading, your post-processing and your plots. For a research codebase that already lives in Python, that is often the decisive factor.

## Terms you combine: diffusion, convection and sources

The mechanics of the solver are described in terms of the equation building blocks it provides. The framework includes terms for transient diffusion, convection and standard sources, and those terms are what you combine to describe an arbitrary system of coupled elliptic, hyperbolic and parabolic PDEs.

That decomposition is the design. Rather than exposing a monolithic solver with a long option list, FiPy gives you terms, and a coupled system is the sum of terms you assemble. The terms are the parts of a PDE that a physicist actually reasons about separately, so a model can be read as physics rather than as a configuration file.

The finite volume method underneath means the discretisation is conservative by construction, since fluxes are shared between neighbouring cells. That matters for the phase field and electrodeposition problems the project targets, where the quantity being conserved is the point of the calculation.

The repository carries a full meshing example directory, and a meshing module is implied by the fact that mesh generation is a separate concern from the equation terms. The documentation also points to an FAQ page and a changelog, and the package installs three console entry points, fipy_changelog, fipy_copy_script and fipy_test, the last of which runs the test suite through a command line tool built with typer.

## Viewers for Matplotlib and Mayavi through entry points

The rendering story is worth looking at, because it is where the NumPy and SciPy argument pays off. The package registers plugin entry points under the fipy.viewers group:

```toml
[project.entry-points."fipy.viewers"]
matplotlib = "fipy.viewers.matplotlibViewer:MatplotlibViewer"
mayavi = "fipy.viewers.mayaviViewer:MayaviClient"
```

The first is the default, and the second is the option for larger or three dimensional scenes through Mayavi. The mechanism is a standard Python entry point group, so a viewer is a plugin: the solver looks up which viewer implementations are installed rather than importing one directly, and a site can register its own without patching the package.

That design has a practical consequence for installation. A viewer that is not installed simply is not available, so a minimal environment gets the Matplotlib viewer and nothing else, and a Mayavi based workflow needs Mayavi present in the same environment.

The declared runtime dependencies are short and specific:

```toml
dependencies = [
    "numpy",
    "scipy",
    "matplotlib",
    "typer",
    "typing_extensions"
]
```

Five dependencies, four of which are the numerical and plotting stack, plus typer for the command line tools and typing_extensions for the typing support on older Python versions. There is no compiled extension of its own, which is the practical meaning of the framework being written in Python.

## Packaging, versions and how the distribution is maintained

The build is a standard setuptools project with versioneer supplying the version from the git tags:

```toml
[build-system]
requires = ["setuptools", "versioneer[toml]"]
build-backend = "setuptools.build_meta"
```

The version comes from the repository rather than from a hand-maintained string, with versionfile_source and versionfile_build both pointing at fipy/_version.py, and the style is pep440. The consequence for users is that a source checkout reports its own version, and the release tags are the single source of truth.

The distribution channels are unusually broad for a scientific package. There is a PyPI package, a CondaForge package, a Binder link that launches the examples as Jupyter notebooks, and a flake.nix with a flake.lock, which is the Nix workflow for a reproducible environment. There is also stdeb.cfg, the configuration for building a Debian package, and environments/ directories for the dependency specifications.

The tests run on Azure Pipelines, with the status badge pointing at a build definition, and there is a separate workflow that builds the documentation for the NIST pages, plus a .codacy.yml for code analysis and a .pyspelling.yml configuration for documentation spelling. That is a well instrumented project, and the combination of Nix, conda and Debian packaging shows the maintainers expect deployment in several different environments.

The documentation itself is split into an installation page, a usage page, an examples page, a FAQ and a changelog, all hosted under pages.nist.gov, with the development version published separately from the stable one.

## Release 4.0, the licence question and the limits of a pure Python solver

The release history shows a major version in September 2025, and its title is the most useful single piece of information about the direction of the project: 4.0, dropping Python 2.7 and Pysparse. Later point releases are 4.0.2 in February 2026 and 4.0.3 in June 2026, and the repository is not archived with the last push on 2026-10-14.

Dropping Pysparse is the more consequential half of that change. Pysparse is a sparse linear solver library, and removing it changes what a FiPy installation can do with large coupled systems. The project documentation does not say, in the pages shown here, how the replacement path works for problems that previously needed it, and that is a question worth asking before upgrading a working simulation.

The licence is the other open item. GitHub reports the licence as one it cannot classify. The repository ships LICENSE.rst and a separate DISCLAIMER.rst, and the pyproject file has commented-out fields referring to a NIST software licence identifier and to licence file naming conventions, which suggests the licensing terms are a NIST variant of a standard licence rather than a stock one. That combination is normal for US government laboratory software, but it means the text itself has to be read rather than assumed, and it is a question for a legal review if you intend to redistribute.

The other limitation is inherent. A pure Python, NumPy-based solver is a good fit for research code where the equations are coupled but the mesh sizes are moderate, and a poor fit for production scale runs where a compiled finite volume code with a purpose built linear solver will be faster by a wide margin.

## Conclusion

Adopt FiPy if your research code needs coupled PDEs solved with a finite volume method and you want to read and modify the solver rather than call into a compiled library, particularly for phase field, level set or electrodeposition work. Do not adopt it for problems needing unstructured mesh support beyond what the meshing examples cover, for industrial scale runs where a specialised commercial solver is the better tool, or if you cannot accept a package whose licence GitHub cannot classify and whose pyproject still declares support for Python 3.7. Before you start, read the INSTALLATION page at pages.nist.gov/fipy, check that your NumPy and SciPy versions satisfy the declared dependencies, and confirm that your system of interest can be expressed in the solver's term model before you commit to rewriting your numerics.

## FAQ

### What is FiPy and which organisation develops it?

FiPy is an object oriented partial differential equation solver written in Python, based on a standard finite volume approach. It was developed by NIST's Materials Science and Engineering Division and Center for Theoretical and Computational Materials Science, inside NIST's Material Measurement Laboratory.

### How do I install FiPy?

The project documents installation on its own pages at pages.nist.gov/fipy, and FiPy is available on PyPI as FiPy and on CondaForge, with a Binder link for running the examples as notebooks and a Nix flake in the repository. The runtime dependencies are numpy, scipy, matplotlib, typer and typing_extensions.

### What kinds of PDEs can FiPy solve?

The framework provides terms for transient diffusion, convection and standard sources, which can be combined to solve arbitrary coupled elliptic, hyperbolic and parabolic PDEs. Implemented models include phase field treatments of polycrystalline, dendritic and electrochemical phase transformations, drug eluting stents, reactive wetting, photovoltaics and a level set treatment of electrodeposition.

### What changed in FiPy 4.0?

The 4.0 release is titled as dropping Python 2.7 and Pysparse. Point releases 4.0.2 in February 2026 and 4.0.3 in June 2026 followed, and the repository is not archived, with the last push on 2026-10-14.

## Sources

- [Issues](https://github.com/usnistgov/fipy/issues)
- [Project website](http://pages.nist.gov/fipy/en/latest)
- [README](https://github.com/usnistgov/fipy/blob/master/README.md)
- [Releases](https://github.com/usnistgov/fipy/releases)
- [usnistgov/fipy on GitHub](https://github.com/usnistgov/fipy)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/usnistgov-fipy
