Skip to main content

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
  1. Install dependencies. Python ≥ 3.12, PyTorch (float64) recommended.
  2. 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.

  1. 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)

Source distribution for torchfea 1.0.17
File Size Uploaded
torchfea-1.0.17.tar.gz 80.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torchfea 1.0.17
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

This release

1.0.17 This release

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page