Structural FEM task generator and solver
Project description
Generate random or predefined beam / plane‑stress (CST) tasks, solve them with CalFEM and produce:
- PDF task cards (TikZ, Tectonic)
- PNG plots (internal forces, displacements, stresses)
- JSON results for auto‑grading
Powered by NumPy, CALFEM, gmsh & Tectonic; wrapped in a single Typer CLI and container image.
Requires
- Linux (x86-64). Tested on Ubuntu 22.04/24.04 & WSL2.
- Tectonic ≥ 0.15 for local PDF generation
curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net \| sh
Install
| Tool | Command |
|---|---|
| Stable wheel | pip install structural-fem-taskgen-cli |
| Test PyPI | pip install -i https://test.pypi.org/simple structural-fem-taskgen-cli |
| Docker image | docker pull lukpacho/taskgen:latest |
Quick Use ⚡️
CLI summary
taskgen --help
usage: taskgen [OPTIONS] COMMAND [ARGS]...
Options:
--out-root, -o Output directory (default: "./out" for docker, "~/.cache/taskgen" for local Python)
--version, -V Print version and exit
--help Show this message and exit
Commands:
beam Generate / solve 1‑D beam problems
plane2d Generate / solve 2‑D plane (CST) problems
Args: (see docs for beam/plan2d geometries)
--beam-version (-v) Available options: [1, 2, 3, 4, 5, 6, 7, 8, 999]
--plane2d-version (-v) Available options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
--num (-n) Number of simulations per beam/plane2d version
Examples
Local Python / Docker container
# Create out/ directory
mkdir out
# Generate 10 random beams of beam-version 2 with task PDFs and solutions
taskgen --out-root ./out beam random -v 2 -n 10
# Generate 5 random beam tasks of beam-versions 2, 3, 4, 5 with task PDFs and solutions
takgen --out-root ./out beam random -v 2 -v 3 -v 4 -v 5 -n 5
# Do the same for plane2d through Docker (keeps host UID/GID)
docker run --rm \
-e HOST_UID=$(id -u) -e HOST_GID=$(id -g) \
-v "$PWD/out:/out" \
lukpacho/taskgen \
plane2d random -v 2 -v 3 -v 4 -v 5 -n 5
Develop 🛠️
git clone https://github.com/lukpacho/structural-fem-taskgen.git
cd structural-fem-taskgen
# new env with deps
python -m venv .venv && source .venv/bin/activate
pip install -e .[dev]
# one‑shot lint | type‑check | tests
ruff check .
mypy src/ tests/
pytest -q
# auto‑format before commit
pre-commit install
Local smoke test
python -m build --wheel -o /tmp/dist
pipx run --spec /tmp/dist/*.whl taskgen --help
docker build -t taskgen-dev .
docker run --rm taskgen-dev --help
Release 📦 GitHub Actions workflow
- Lint, type‑check, test on 3.11 & 3.12.
- Build wheel + sdist →
pip check→taskgen --help - Upload to Test PyPI or PyPI (
PYPI_TARGET(test/prod)). - Build & push multi‑arch Docker images to GHCR and DockerHub.
- Run container smoke-test (
docker run … --help).
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 structural_fem_taskgen_cli-0.1.7-py3-none-any.whl.
File metadata
- Download URL: structural_fem_taskgen_cli-0.1.7-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44be5c57d007639c10284bf1c44fdaa6662155aadcb06fc2dfe7ff289506439b
|
|
| MD5 |
9eb2abda959bdf5f7a00c74c9308ded7
|
|
| BLAKE2b-256 |
5aa11e36d1e74a7dc9a63019c222df127d6d06847d71cf627c74abaf3dd9d247
|