agentleFS
BaratiLabBaratiLab/mechanical-engineering-skills/skills/quick-fea/SKILL.md

quick-fea

Skill16 starsChanged 16 days agoMITView on GitHub

Runs quick linear-static and modal finite-element analysis on a STEP part (gmsh mesh + scikit-fem quadratic tets), reports max stress, deflection, natural frequencies, and always checks against a hand calculation and a mesh-convergence run. Use when the user asks for FEA, stress analysis, deflection, stiffness, natural frequency, or whether a part will survive a load.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Geometry: Use the user's STEP, or build one with the parametric-part-cad skill.

    line 11
  2. Distinctive:

    Write down the idealization: before you solve: the material (E, ν, ρ, σy), which faces are fixed, which faces carry the load, the load …

    line 12

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Quick FEA

Setup: pip install gmsh scikit-fem matplotlib. On headless Linux, gmsh also needs apt-get install libglu1-mesa libxcursor1 libxinerama1 libxft2. Units: mm, N, MPa, t/mm³.

Workflow

  1. Geometry. Use the user's STEP, or build one with the parametric-part-cad skill. Remove cosmetic features (logos, small chamfers) that don't carry load. Note the bounding box; you'll use it to pick boundary faces.
  2. Write down the idealization before you solve: the material (E, ν, ρ, σy), which faces are fixed, which faces carry the load, the load magnitude and direction, and what is being neglected (contact, preload, plasticity, large deflection).
  3. Hand calculation first. Estimate the answer with a closed form: beam bending σ = Mc/I, δ = FL³/3EI, Lamé thick cylinder, plate formulas (references/hand_calcs.md). This is the sanity anchor.
  4. Solve:
    python scripts/fea.py part.step --E 69000 --nu 0.33 --fix "x[0] < 1e-3" \
        --load "x[0] > 149.999" --force 0,0,-500 --size 4 --out run1
    python scripts/fea.py part.step --E 69000 --nu 0.33 --rho 2.7e-9 --fix "x[0] < 1e-3" --modes 6 --out modal
    Face selection uses expressions on facet midpoints, for example np.abs(x[2]-10)<1e-3, or (x[0]**2+x[1]**2) < 6.1**2 for a bolt hole.
  5. Convergence. Re-run with --size halved. A result is converged when max displacement changes by less than 2% and the 99th-percentile von Mises stress by less than 5%. Max von Mises at a sharp re-entrant corner is a singularity: it never converges. Report the stress at a small distance from the corner, or add the real fillet.
  6. Check:
    • equilibrium_error_pct < 1%;
    • FEA agrees with the hand calculation within about 15% for the nominal region, or you can explain why it differs;
    • margin = σy / σ_vm(p99) − 1, reported against the user's target safety factor;
    • deflection small compared with thickness. If not, linear theory doesn't apply; say so.
  7. Report: idealization sketch (text), mesh table, results with the convergence column, hand-calc comparison, contour image run1_vm.png, margin, and recommendations.

Limits

Linear elastic, small deflection, no contact, isotropic material. For bolted joints, model the bolt-hole bearing area as the fixed or load face, not the whole hole. For thin shells, use a fine mesh (at least 2 elements through thickness) or flag the stiffness error.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.