Elementa: open-source finite element method (FEM) simulation workbench.
Project description
Elementa
Open-source Finite Element Method (FEM) simulation workbench for Python
Overview
Elementa is a desktop FEM simulation environment built entirely in Python. It combines a parametric CAD modeller, an automatic mesh generator, physics solvers, and an interactive results viewer in a single application — without requiring commercial licences or external solvers.
| Feature | Details |
|---|---|
| Geometry | 2-D (rectangle, disk, polygon) and 3-D (box, sphere, cylinder) primitives with boolean operations |
| Meshing | Automatic triangular / tetrahedral meshing via gmsh |
| Physics | Electrostatics · Heat Transfer (stationary & transient) |
| Solvers | scikit-fem FEM back-end; backward-Euler time stepping |
| Post-processing | Surface plots, arrow / vector plots, point & line probes |
| Parameters | Symbolic parametric expressions with dependency resolution |
| File format | Portable .elem project archive (ZIP-based JSON + mesh + results) |
Screenshots
Quickstart
Requirements
- Python 3.10 – 3.12
- A working C compiler (required by
gmshwheels on some platforms)
Install from PyPI
pip install elementa
Launch the GUI
elementa
# or
python -m elementa
Install from source
git clone https://github.com/soheilgreen/elementa.git
cd elementa
pip install -e ".[dev]"
Physics Modules
Electrostatics
Solves the Poisson equation for electric potential:
$$-\nabla \cdot (\varepsilon_0 \varepsilon_r \nabla \varphi) = \rho$$
Boundary conditions: Electric Potential, Ground, Surface Charge Density, Zero Charge
Results: Electric potential φ (V), Electric field E (V/m)
Heat Transfer
Solves the heat equation (stationary and transient):
$$\rho C_p \frac{\partial T}{\partial t} - \nabla \cdot (k \nabla T) = Q$$
Boundary conditions: Temperature, Heat Flux, Convection, Thermal Insulation
Results: Temperature T (K), Heat flux q (W/m²)
Project Structure
elementa/
├── elementa/
│ ├── __init__.py # Package metadata
│ ├── __main__.py # CLI entry point
│ ├── assets/ # Icons and images
│ ├── cad/
│ │ └── cad.py # gmsh CAD wrapper (ElementaCAD)
│ ├── core/
│ │ ├── cad_builder.py # Orchestrates geometry build from project state
│ │ ├── evaluator.py # Parametric expression evaluator
│ │ ├── exceptions.py # Custom exception hierarchy
│ │ ├── geometry_registry.py # Shape descriptors registry
│ │ ├── logger.py # Logging configuration
│ │ ├── material_library.py # Built-in material database
│ │ └── project_state.py # Central state + serialisation
│ ├── physics/
│ │ ├── base.py # PhysicsState data class
│ │ ├── registry.py # Plugin registry & descriptors
│ │ ├── electrostatics.py
│ │ └── heat_transfer.py
│ └── ui/
│ ├── main_window.py # Main application window
│ ├── graphics_canvas.py
│ ├── model_builder.py
│ ├── plot_window.py
│ ├── expr.py # Safe mathematical expression evaluator
│ └── panels/ # Dockable settings panels
├── docs/ # GitHub Pages documentation
├── tests/ # Test suite
├── pyproject.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
└── LICENSE
Adding a New Physics Module
Elementa uses a plugin architecture. To add a new physics solver:
- Create
elementa/physics/my_physics.py - Subclass
PhysicsDescriptorand implementassemble_and_solve() - Call
register_physics(MyDescriptor)at module level - Import it in
elementa/physics/__init__.py
See docs/guides/adding-physics.md for a complete walkthrough.
Dependencies
| Package | Purpose |
|---|---|
| PyQt6 | GUI framework |
| gmsh | CAD geometry & mesh generation |
| scikit-fem | FEM assembly & solvers |
| NumPy | Numerical arrays |
| Matplotlib | Results visualisation |
Contributing
Contributions are very welcome! Please read CONTRIBUTING.md before opening a pull request.
- Bug reports → GitHub Issues
- Feature requests → GitHub Issues
- Pull requests → see CONTRIBUTING.md
License
Elementa is released under the GPL v3 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elementa-1.0.0.tar.gz.
File metadata
- Download URL: elementa-1.0.0.tar.gz
- Upload date:
- Size: 7.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f08ab0715bf2c6e767df5f63fc53ab27c9445728ffbef7b6ae70d93ed9b2ad
|
|
| MD5 |
a607c2ef5117b8474b5afb97f1442172
|
|
| BLAKE2b-256 |
571183312c3648743194a8567efbe99e111f7ff06f52e9938cb9761f17dc2f07
|
File details
Details for the file elementa-1.0.0-py3-none-any.whl.
File metadata
- Download URL: elementa-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d90d958f207cd190d8d09f8ce13dc1f3ef8449e5d7e856d1ba55ad4094eeb1a
|
|
| MD5 |
6a0e54efba87c51e88977fc196170f8a
|
|
| BLAKE2b-256 |
7585ca72112aacdf209d9c24eb66debac4408597f35acf34895d3bf8b7ebcbcc
|