femforge
femforge is finite-element analysis as a typed Python API.
|
Bearing seat a magnet holds a ball, in 2D and 3D |
Coil current a coil pulls a plunger |
Thermal a puck heats a board |
Open-source solvers can do remarkable physics. Getting them to do it has meant hours in a manual and in forum threads, hunting for the keyword spelling that makes a case run. femforge moves that knowledge into the type system. Every setting is a typed Pydantic field with a docstring, and every physical quantity carries its unit, so your editor completes the config and validation rejects a mistake before anything is meshed or solved.
You describe a simulation once, as one config, and a Driver meshes it, solves it and returns results that carry their units. Geometry, meshing and solving run behind interfaces, so the same config can target new backends as they land.
NOTE: femforge is pre-alpha. The API will change between 0.x releases, and the changelog records each change.
What you get
- One typed config. Pydantic models check the geometry, the mesh, the materials, the conditions and the physics before anything runs.
- Units that are checked. Lengths, material properties, conditions and results carry pint quantities, so a value with the wrong dimension fails validation instead of corrupting a solve.
- CAD to result in one call. A tagged STEP from your CAD or a build123d script, meshed and solved.
- Runs you can reuse and query. Each run is a bundle named after the content hash of its inputs, with its config, logs and fields. An identical config reuses the finished run, and a telemetry index lists every run.
- A browser workbench. Browse the runs, view the fields and compose your own panels from a script.
- Extensible backends. Geometry, meshing and solving run behind interfaces, so a new mesher or solver plugs in without changing your config. Status lists what each interface and each physics supports today.
Try it
You need uv and either Docker, which is recommended, or a native Elmer install. On Linux, also install the system libraries gmsh loads, as Install lists.
uvx femforge new magnet-plate
uv run magnet-plate/main.py
The script solves a disc magnet pulling on a steel plate at four air gaps, then opens the fields in your browser. The first run downloads about 1.2 GB of packages once, plus a 1.3 GB Docker image when Elmer is not installed natively; later runs start in seconds. The Quickstart walks through it, and the examples go further.
A solve in a few lines
import femforge as ff
config = ff.SimulationConfig(
mesh=ff.MeshConfig(step="magnet_and_plate.step"),
frame=ff.Axisymmetric(),
domain=ff.DomainConfig(
materials=[ff.materials.N52(), ff.materials.Steel_1080(), ff.materials.Air()],
tags=[
ff.EntityTag(selector={ff.TagKey.NAME: "MAGNET"}, conditions=[ff.Magnetization(direction=ff.Direction(0, 0, 1))]),
ff.EntityTag(selector={ff.TagKey.NAME: "PLATE"}, conditions=[ff.ForceComponent()]),
],
),
)
result = ff.Driver().evaluate(config)
print(result.axial_force("PLATE").m_as("newton"), "N")
ff.workbench.show(ff.workbench.field_viewer(result), window=ff.workbench.Window.BROWSER)
The STEP holds a magnet, a steel plate and an air box, each solid named with its tags, such as Material=N52, Name=MAGNET. Geometry and tags builds the same model in build123d.
Install in your own project
| Command | Size | Pick it for | |
|---|---|---|---|
| Recommended | uv add "femforge[workbench]" |
1.2 GB | solves, field plots and the browser workbench |
| Headless | uv add femforge |
0.8 GB | servers, CI and pipelines that need solves and typed results only |
With pip: pip install "femforge[workbench]" or pip install femforge. Elmer runs natively when it is installed, else in the femforge Docker image, pulled on the first solve; Install covers both, and femforge doctor checks the result.
Documentation · Examples · Status · Changelog · License (Apache-2.0)
Metadata
Release files for femforge 0.1.0
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 |
|---|---|---|---|---|
| femforge-0.1.0.tar.gz | 325.5 kB | With provenance | Details for femforge-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| femforge-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for femforge-0.1.0-py3-none-any.whl |
Total release size: 736.5 kB
Release files / femforge-0.1.0.tar.gz
| Download URL | femforge-0.1.0.tar.gz |
|---|---|
| Size | 325.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01a6b08092ec8b978d6c487a47106f8df67a91348faa7d6e66674e25514d8a07
|
|
BLAKE2b-256 checksum How to use checksums |
7d13a4c0ec1399d70b6e3b9ec912efbbebbd905cec6328b7171d1206155a8e16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logRelease files / femforge-0.1.0-py3-none-any.whl
| Download URL | femforge-0.1.0-py3-none-any.whl |
|---|---|
| Size | 411.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8501d1c77d825c2dd8d6ca3388879062c995c026e43bf881fe461154ea588674
|
|
BLAKE2b-256 checksum How to use checksums |
08947749531c004e19f52fb4b00b994572d79ee8849914b427663f9942dfad51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logSecurity for femforge 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for femforge-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logA 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.