femforge¶

femforge is finite-element analysis as a typed Python API.
You describe a simulation once, as one SimulationConfig: the geometry, the mesh, the materials and conditions of each region, and the physics to solve. 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.
The geometry is a STEP file whose bodies are named with their tags, exported from any CAD or scripted in build123d with femforge's helpers.
A Driver meshes the config, solves it and returns a Result whose quantities carry their units. Every run lands in a bundle named after the content hash of its inputs, so an identical config reuses the finished run instead of solving again.
The workbench shows the fields and the runs in a browser, and everything it shows is also scriptable. Geometry, meshing and solving run behind interfaces, and Status lists what each one supports today.
femforge is pre-alpha. The API will change between 0.x releases, and the changelog records each change.
See it¶
Four workbenches, each a script you can run. Examples describes them.
-
Magnet and plate: a disc magnet pulls on a steel plate at four air gaps. The quickstart.
-
Bearing seat: a magnet holds a steel ball, with and without a shell, in 2D and 3D.
-
Coil current: a coil in a pot frame pulls a steel plunger across two gaps.
-
Thermal: a puck dissipates 1 W on a board that still air cools.
How it fits together¶
- Geometry and tags: name each body with its material and name tags, in your CAD's STEP export or in a build123d script.
- Materials and conditions and physics: say what each region is made of, what drives it and which physics to solve.
- Mesh and frames: set the element sizes and choose how the model maps onto the solve.
- Driver and runs: mesh, write the solver input, solve and record the run bundle.
- Results: read forces, torques, peak fields and the solved field mesh.
- Artifacts and retention and telemetry: reuse meshes and runs across processes, trim old bundles and query logs and sweeps.
- Workbench: browse runs and view fields in a browser.
Where to start¶
- Install femforge and an Elmer solver.
- Run a first simulation with the Quickstart.
- Run one of the examples, each a workbench over a small model.
- Read Concepts for the pipeline on one page.
- Check Status for what works today and which tasks are open.
- Work through the User guide, one task per page.
- Look up a class or function in the API reference.
- Set up a development checkout with Contributing.



