TorchFEA —— A PyTorch-based Finite Element Analysis Framework
Developed by Zenan Song
A research-oriented FEA framework supporting nonlinear materials, contact analysis, and dynamics (implicit/explicit). Built with a modular design: the Assembly layer manages geometry, materials, loads, and constraints, while the Solver layer provides static implicit, dynamic implicit (Newmark-β), and dynamic explicit (central difference) solvers.
Features
- Clean Assembly–Solver separation with well-defined interfaces, easy to extend
- Sparse matrix assembly with Pardiso / Conjugate Gradient linear solvers
- Contact (self-contact / body-body contact), pressure, body force, and other load components
- Built on PyTorch — GPU acceleration and automatic differentiation for sensitivity analysis & optimization
Quick Start
pip install torchfea
- Install dependencies. Python ≥ 3.12, PyTorch (float64) recommended.
- Run a minimal example (static + surface pressure):
python tests/pressure_test/test_benchmark.py
The script reads an INP file (e.g., tests/pressure_test/C3D4Less.inp), applies surface pressure and fixes bottom nodes, runs the static implicit solver, and saves the displacement vector.
- More usage examples:
- Usage guide (INP → solve → export → visualization):
docs/usage.md - Architecture & data flow:
docs/structure.md
Directory Overview
src/torchfea/— Core code (assembly, elements, loads, constraints, solvers, etc.)tests/— Test cases & benchmarks (elements, pressure, contact, dynamics, gradients/optimization)docs/— Architecture and usage documentation
License
Research use preferred. For production or commercial use, please evaluate and ensure numerical and engineering robustness first.
Metadata
Release files for torchfea 1.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torchfea-1.0.17.tar.gz | 80.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torchfea-1.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.9 kB
Release files / torchfea-1.0.17.tar.gz
| Download URL | torchfea-1.0.17.tar.gz |
|---|---|
| Size | 80.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adcbef561c78686f299dc5c6af940c0f5295db89185a7e626d090278a0c4ecd7
|
|
BLAKE2b-256 checksum How to use checksums |
695dfed90d92ca78de785512f3a615330a8ac166aeb110b988df0f84f2358fb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / torchfea-1.0.17-py3-none-any.whl
| Download URL | torchfea-1.0.17-py3-none-any.whl |
|---|---|
| Size | 99.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fae26db5b7237796041e9ff691cfbad9da8d87aa74d647b11a25b194485d30f0
|
|
BLAKE2b-256 checksum How to use checksums |
3cd360a2862a01d7c2cec7f492de2cff1c2529e6c29aabc8e0f75d4fb14a8c37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|