Home / Demos / Cantilever design with CalculiX

Simulation CalculiX 2.20 · gmsh 4.10

Cantilever design with CalculiX

The agent picks the cross-section of a steel cantilever under a 1000 N tip load, writes the CalculiX deck, and iterates until the judge passes. The judge meshes the beam with gmsh at two sizes, solves it with ccx, checks a reference beam against Euler-Bernoulli theory, checks mesh convergence, and only then applies the spec limits: stress ≤ 166.7 MPa and tip deflection ≤ L/100. Mass is reported for the agent to minimise; passing does not prove the lightest design.

The real displacement field ramped from 0 to 1000 N, then the gate that rejects each mutant. Made from real judge output, no illustrative data.

Measured

138.2 MPa
stress at the wall
≤ 166.7 MPa
7.72 mm
tip deflection
≤ 10.00 mm
+0.41 % / −0.74 %
deflection / stress vs Euler-Bernoulli
≤ 3 %
0.23 % / 0.50 %
change from 4 mm to 2 mm mesh
≤ 2 %
9/9
known-bad artifacts rejected
self-test, ≥ 90 % required

reproduced Independently reproduced: byte-identical media. Numbers from the demo's README and receipt.

Ask your agent

With the sandbox plugin or any agent that can use a sandbox, paste:

Clone https://github.com/agent-next/sandbox into this sandbox and run `bash cookbook/fea-calculix/judge/setup.sh` (installs CalculiX `ccx` and gmsh under `~/tools/bin`). Design the lightest cantilever beam for the spec in `SPEC.md`: produce `artifact/design.json` (`L`, `b`, `h`, `mesh_size` in mm) and `artifact/beam.inp` (deck contract in SPEC.md — include `mesh.inc`, clamp `NFIX`, apply 250 N downward on each `NLOAD` corner node, request `U` and `S` output). Then run `judge/grade.sh artifact` and iterate until it prints "PASS".

Or run it yourself

Creates a sandbox, installs the pinned tools, runs the judge's self-test, grades the known-good example, prints the verdict and kills the sandbox.

pip install "git+https://github.com/agent-next/sandbox#subdirectory=cli"
export SBX_API_KEY=<your key>  # from the console
git clone --depth 1 https://github.com/agent-next/sandbox && cd sandbox
python3 cookbook/fea-calculix/run.py
No key? Run the judge on any Debian 12 box
# from cookbook/fea-calculix/
bash judge/setup.sh
bash judge/selftest.sh
bash judge/grade.sh examples/good --seed 42

Results

Deformed mesh coloured by von Mises stress with the allowable on the colour bar, mesh convergence, and the Euler-Bernoulli comparison
Deformed mesh coloured by von Mises stress with the allowable on the colour bar, mesh convergence, and the Euler-Bernoulli comparison. Full size
Agent-loop replay and the mutant-by-gate self-test matrix
Agent-loop replay and the mutant-by-gate self-test matrix. Full size

Why a sandbox

The solver, mesher and solver libraries install from sha256-pinned packages into a throwaway machine; the agent's deck runs there, never on your workstation.

Measured wall time

StepWall time
judge/setup.sh (pinned .deb files + gmsh tarball)~15 s
judge/selftest.sh (good + 9 mutants + determinism)~5 min
judge/grade.sh examples/good~35 s

Limits, plainly

  • Linear-elastic, static, slender beams only (L ≥ 5 × max(b, h)).
  • Stress is evaluated away from the clamped-face singularity; the pointwise wall-corner stress is singular and deliberately not the measured quantity.

Source

Demo folder · SPEC · RECEIPT · REPRODUCE — pinned at ba328e6

Run one yourself

Sign in with GitHub for a free key with 10 sandbox-hours. Every demo above finishes in minutes and kills its sandbox when it is done.