# FEA Stress Analysis API: STEP to Stress & Safety Factor (`jumblemog/fea-stress-analysis`) Actor

Finite element stress analysis of a CAD part by API. Send a STEP file, the faces that are held and the loads; get von Mises stress, displacement, safety factor and reaction forces, with stress plots and a mesh convergence check. Meshed with Gmsh, solved with CalculiX. For engineers and AI agents.

- **URL**: https://apify.com/jumblemog/fea-stress-analysis.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## FEA Stress Analysis API: STEP to Stress & Safety Factor

**Finite element stress analysis of a CAD part from one API call.** Send a STEP file, say which faces are held and what loads act on it, and you get back:

- **The highest von Mises stress**, where it is and which faces meet there, plus the largest tension and compression.
- **The safety factor** against the material's yield strength, for 29 built-in metals and plastics or your own values.
- **How far the part moves**, and the reaction force at every support, so you can see the loads balance.
- **Pictures**: the stress on the deformed part with the peaks marked, the movement, and the supports and loads as you set them.
- **A mesh check** on request: the study solved again on a finer mesh, with how much the stress and movement changed.
- **A sentence that says the result**, warnings where the numbers can't be trusted, and a Markdown report with all of the above.

![von Mises stress in a bracket held by two bolt holes and pulled at a third](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/fea-stress-analysis-example.png?signature=NEA3bwIr0bUpTsmFiJBN)

The part is meshed by [Gmsh](https://gmsh.info/) into 10-node tetrahedra and solved by [CalculiX](https://www.calculix.de/), the open-source solver engineers use for this. Nothing is estimated by a language model, and you need no CAD or FEA program, license or installation.

It's made for:

- AI agents and design assistants asked "will this bracket hold 300 N?". A language model can't solve a stress field in its head; this gives it a real solution as JSON, with a picture it can show.
- Product and hardware developers who want a first strength check of a part before it is made, straight from the STEP file.
- Quoting, design-review and generative-design pipelines that need stress and stiffness for many parts or load cases, in a loop.
- 3D-printing and maker tools that want to tell a user where a part is weak.

### How to use it

1. Put a link to your STEP file into **Link to the CAD file**, or upload it. IGES and BREP work too.
2. Pick the **Material**.
3. Under **Fixed faces** say what holds the part, and under **Loads** what pushes on it, in plain words: `bottom`, `hole A`, `500 N down on top`.
4. Click **Start**. The result is one row with the summary, the numbers and links to the pictures.

Don't know what your part's faces are called? Leave the supports and loads empty. You get the list of faces, sides and holes with a numbered picture, for a quarter of the price of a study.

The form opens with a worked example: an aluminum bracket bolted down through two holes and pulled sideways at a third.

#### Naming faces

| You write | It means |
|---|---|
| `top`, `bottom`, `left`, `right`, `front`, `back` | The flat face at that end of the part. Up is +Z unless you set **Up axis** to Y. |
| `face 7`, `faces 3, 4`, `faces 3-5` | Faces by their number in the faces list and picture. |
| `hole A`, `hole B and C` | Round holes by their letter. Holes are lettered from the largest down. |
| `holes 7 mm`, `all holes`, `largest hole` | Round holes by diameter, all of them, or the biggest. |
| `near 10, 0, 5` | The face closest to that point (mm). |
| `top and hole A` | Several of the above together. |

#### Writing loads

| You write | It means |
|---|---|
| `500 N down on top` | A force of 500 N, spread evenly over the top face. Units: N, kN, lbf, kgf. |
| `1.2 kN -x on hole A` | Directions are `down`, `up`, `left`, `right`, `front`, `back`, `+x` to `-z`, or three numbers such as `1, 0, -1`. |
| `150 N normal on face 7` | Pushing straight into a flat face; `outward` pulls on it. |
| `2 MPa on face 7` | Pressure on any faces, flat or curved. Units: MPa, kPa, Pa, bar, psi, ksi. |
| `5 N·m on hole A` | Torque about the axis of a hole or a shaft. Units: N·m, N·mm, lbf·in, lbf·ft. |

**Gravity** adds the part's own weight: `down` for one g, `2 g down`, or `0, 0, -9.81` in m/s².

### Examples

The form's example is the built-in bracket: 80 × 40 mm base, 60 mm upright, 6 mm thick, in aluminum 6061-T6. Its two 7 mm holes are fixed and 300 N pulls sideways on the 10 mm hole. `{"model": "example"}` runs the same study over the API.

### How-to examples

The result lines are from runs of these inputs.

#### How to run a stress analysis on a STEP file

```json
{
  "model": "https://example.com/bracket.step",
  "material": "aluminum 6061-t6",
  "fixed": ["holes 7 mm"],
  "loads": ["300 N right on hole A"]
}
```

Result for the example bracket: "example-bracket in Aluminum 6061-T6 under 300 N: the highest von Mises stress is 118.1 MPa at a support, where it isn't reliable, and 56.06 MPa more than 5.39 mm from the supports. Safety factor 4.92 against the yield strength of 276 MPa (2.34 counting the support). It moves 0.5794 mm at most." The supports' reaction is (-300, 0, 0) N, equal and opposite to the load. Solved on 14,912 elements in 12 seconds.

The tool reports two stresses because the first is a trap. A face that is held perfectly rigid makes the stress at its edge climb without limit as the mesh gets finer, which no real bolt does. So you get the peak, and next to it the highest stress away from the supports, which is the one to judge the part by.

#### How to find out what a part's faces and holes are called

```json
{ "model": "https://example.com/bracket.step" }
```

With nothing fixed and nothing loaded, the part is only inspected. Result: "example-bracket: 80 × 40 × 60 mm, 31.7763 cm³, 12 faces, 3 round holes (A ⌀10 mm; B and C ⌀7 mm). By side: top is face 4; bottom is face 3; right is face 10; left is face 1; back is face 5; front is face 2." `faces` lists every face with its kind, area, centre and side, and `facesImageUrl` is this picture:

![The bracket from two corners with its face numbers and hole letters](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/fea-stress-analysis-faces.png?signature=oJ15D8x8jcMQn02ms613)

A study whose supports or loads name a face that doesn't exist fails with the reason, costs nothing, and returns the same list and picture.

#### How to run several load cases on one part

```json
{
  "model": "example",
  "material": "aluminum 6061-t6",
  "fixed": ["holes 7 mm"],
  "studies": [
    { "title": "pull", "loads": ["300 N right on hole A"] },
    { "title": "push down", "loads": ["500 N down on top"] },
    { "title": "twist", "loads": ["5 N·m on hole A"] }
  ]
}
```

Result: three rows. Away from the supports the highest stress is 56.06 MPa for the pull (safety factor 4.92), 68.64 MPa for the push (4.02) and 17.11 MPa for the twist (16.1); the bracket moves 0.5794, 0.4156 and 0.1221 mm. Fields outside `studies` are shared by all of them, and each study can change any field, the model and material included.

#### How to check that the mesh is fine enough

```json
{
  "model": "example",
  "fixed": ["holes 7 mm"],
  "loads": ["300 N right on hole A"],
  "material": "aluminum 6061-t6",
  "convergenceCheck": true
}
```

Result: `convergence` compares the two meshes. From 14,912 to 35,877 elements the stress away from the supports went from 56.06 to 56.07 MPa (+0.02%) and the movement from 0.5794 to 0.5802 mm (+0.14%), so the first mesh was already fine enough. The peak at the support went from 118.1 to 133.2 MPa (+12.8%), which is the trap from the first example showing itself. A change of more than 10% away from the supports adds a warning.

#### How to let an AI agent check a part's strength

Add the tool to an agent through Apify's MCP server at `https://mcp.apify.com/?tools=jumblemog/fea-stress-analysis`. The agent first calls it with only `model` to learn the faces, then with `fixed`, `loads` and `material`. The `summary` is a sentence it can repeat, `warnings` tell it what not to claim, and `stressImageUrl` is a picture it can show.

### FAQ

**What kind of analysis is this?**
Linear static: the part is elastic, movements are small, and the load is steady. It answers "how much stress and deflection under this load?" It does not do buckling, fatigue, impact, vibration, heat, contact between parts, bolt preload or plastic flow after yielding. A warning appears when the stress passes the material's strength or the part moves by more than 5% of its size, because the answer is then outside what a linear analysis can say.

**Can I trust the numbers?**
The solver is CalculiX with second-order elements, and the tests check it against beam and bar theory: a cantilever's deflection within 2%, its bending stress within 3%, a pulled bar within 0.5%. What decides the quality of your answer is the setup: where you hold the part and how you load it. Use `convergenceCheck` when the number matters, read the warnings, and treat the result as a first check, not as a certificate. For anything safety-critical, have an engineer review it.

**Which stress should I look at?**
`maxVonMisesAwayFromSupportsMpa` when `maxVonMisesNearSupport` is true, otherwise `maxVonMisesMpa`. The summary sentence already picks the right one. For brittle materials such as cast iron and acrylic, compare `maxPrincipalMpa` with the ultimate strength instead.

**What does "fixed" mean, and what is "sliding"?**
A fixed face can't move at all, like a face welded to a rigid wall. That is stiffer than a real bolted joint, so stresses right at it are too high. A sliding face can move in its own plane but not lift off or sink in: use it for a part resting on a table, or for a plane of symmetry. Sliding faces must be flat and square to an axis.

**How do I hold a part by its bolt holes?**
`"fixed": ["all holes"]`, or name them: `["hole B and C"]`, `["holes 7 mm"]`. This fixes the holes' walls.

**Which units does it use?**
Results are in millimetres, newtons and megapascals. The file's own units are read: a STEP file in inches is converted. Loads can be written in N, kN, lbf, kgf, MPa, psi, bar, N·m and lbf·in.

**Can I use my own material?**
Yes: `"customMaterial": {"youngsModulusMpa": 71700, "poissonRatio": 0.33, "densityKgM3": 2810, "yieldStrengthMpa": 480, "name": "7075 plate"}`. With a `material` chosen too, only the values you give are changed. Materials are isotropic: wood, composites and the layers of a 3D print are not modelled, and printed plastics get a warning that they are weaker than the moulded values.

**What about assemblies?**
A file with several solid bodies is solved as one piece: bodies that touch are bonded where they touch, and all get the one material. Bodies that don't touch must each be held. For a real assembly with different materials or sliding contact, analyse the parts one at a time with the forces they pass to each other.

**Can it read STL files?**
No. A stress analysis needs the exact solid, and an STL is only a skin of triangles. Export STEP from your CAD program. IGES files and others that hold surfaces only are sewn into a solid when the surfaces close.

**Can I get the full result, not only the peaks?**
Set `resultFiles` to true. You get a VTU file with displacement and von Mises stress at every node, which opens in [ParaView](https://www.paraview.org/), and the CalculiX input deck, which you can rerun or extend yourself.

### Input

| Field | Type | What it does |
|---|---|---|
| `model` | string | Link to a STEP (.step, .stp), IGES or BREP file; gzip and ZIP with one CAD file work too. `example` is the built-in bracket. Up to 60 MB. |
| `upload` | file | The CAD file, uploaded, instead of a link. |
| `material` | string | One of: steel, steel s355, steel 1045, steel 4140, stainless 304, stainless 316, cast iron, aluminum 6061-t6, aluminum 7075-t6, aluminum 5052-h32, aluminum 2024-t3, aluminum a356-t6, titanium ti-6al-4v, titanium grade 2, brass, copper, bronze, magnesium az31b, abs, pla, petg, nylon pa6, nylon pa12, polycarbonate, pom, peek, hdpe, polypropylene, acrylic. Default steel. |
| `customMaterial` | object | Your own values: `youngsModulusMpa` (or `youngsModulusGpa`), `poissonRatio`, `densityKgM3`, `yieldStrengthMpa`, `ultimateStrengthMpa`, `name`. |
| `fixed` | list | Faces held completely still. See "Naming faces". |
| `sliding` | list | Flat faces that may slide in their plane but not move across it. |
| `loads` | list | Forces, pressures and torques. See "Writing loads". |
| `gravity` | string | The part's weight as a load: `down` (one g), `2 g down`, `9.81 m/s2 -y` or `0, 0, -9.81` (m/s²). |
| `up` | string | `z` (default) or `y`: the axis that points up, for the words top, bottom, front, back, up and down. |
| `meshQuality` | string | `coarse` (about 6,000 elements), `normal` (about 20,000, default) or `fine` (about 45,000). Parts with many holes and fillets get more. |
| `elementSizeMm` | string | The largest element edge in millimetres, set by hand: `"1.5"`. Up to 150,000 elements are solved. |
| `convergenceCheck` | boolean | Solve again on a finer mesh and report the change. |
| `inspect` | boolean | Only list the faces, sides and holes. Automatic when nothing is fixed or loaded. |
| `pictures` | boolean | Draw the PNG pictures. Default true. |
| `imageWidth` | integer | Picture width, 600 to 3000 pixels. Default 1400. |
| `resultFiles` | boolean | Also save the VTU result and the CalculiX input deck. |
| `title` | string | A title for the pictures and the report. |
| `timeLimitSeconds` | integer | Time limit per study, 10 to 1800. Default 300. |
| `studies` | list | Several studies in one run, each an object with any of the fields above; fields outside it are the defaults. Up to 50. |

In `studies`, or over the API, a face can also be an object (`{"hole": "A"}`, `{"faces": [3, 4]}`, `{"holeDiameterMm": 7}`, `{"near": [10, 0, 5]}`) and so can a load: `{"on": "hole A", "force": 300, "direction": [1, 0, 0]}`, `{"on": "face 7", "pressure": 2}`, `{"on": "hole A", "torque": 5}` (N, MPa, N·m).

### Output

One dataset row per study. The main fields:

```json
{
  "study": 1,
  "name": "example-bracket",
  "status": "ok",
  "summary": "example-bracket in Aluminum 6061-T6 under 300 N: the highest von Mises stress is 118.1 MPa at a support, where it isn't reliable, and 56.06 MPa more than 5.39 mm from the supports. Safety factor 4.92 against the yield strength of 276 MPa (2.34 counting the support). It moves 0.5794 mm at most.",
  "maxVonMisesMpa": 118.1,
  "maxVonMisesAt": [36.619, 19.094, 6.0],
  "maxVonMisesFaces": [9, 11],
  "maxVonMisesNearSupport": true,
  "maxVonMisesAwayFromSupportsMpa": 56.06,
  "supportZoneMm": 5.39,
  "maxPrincipalMpa": 184.3,
  "minPrincipalMpa": -193.3,
  "maxDisplacementMm": 0.5794,
  "maxDisplacementAt": [0.0, 20.0, 60.0],
  "safetyFactor": 2.34,
  "safetyFactorAwayFromSupports": 4.92,
  "hotspots": [
    { "vonMisesMpa": 118.1, "at": [36.619, 19.094, 6.0], "faces": [9, 11] },
    { "vonMisesMpa": 52.83, "at": [12.984, 24.118, 6.065], "faces": [8] },
    { "vonMisesMpa": 50.33, "at": [12.928, 9.996, 6.072], "faces": [8] }
  ],
  "supports": [{ "kind": "fixed", "faces": [11, 12], "areaMm2": 263.884, "reactionN": [-300.0, 0.0, 0.0] }],
  "loads": [{ "kind": "force", "faces": [6], "areaMm2": 188.49, "forceN": [300.0, 0.0, 0.0], "totalForceN": [300.0, 0.0, 0.0] }],
  "appliedForceN": [300.0, 0.0, 0.0],
  "reactionForceN": [-300.0, 0.0, 0.0],
  "equilibriumErrorPercent": 0.0,
  "material": { "name": "Aluminum 6061-T6", "youngsModulusMpa": 68900.0, "poissonRatio": 0.33, "densityKgM3": 2700.0, "yieldStrengthMpa": 276, "ultimateStrengthMpa": 310 },
  "model": { "sizeMm": [80.0, 40.0, 60.0], "volumeCm3": 31.7763, "massKg": 0.085796, "bodies": 1, "faceCount": 12 },
  "mesh": { "nodes": 26333, "elements": 14912, "elementType": "10-node tetrahedron (C3D10)", "elementSizeMm": 2.38 },
  "solver": "CalculiX direct (SPOOLES)",
  "warnings": ["The highest stress (118.1 MPa) is right at a support. ..."],
  "stressImageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-example-bracket-stress.png",
  "displacementImageUrl": "https://...",
  "setupImageUrl": "https://...",
  "toolSeconds": 11.5
}
```

Also in each row: `faces` (every face with number, kind, area, centre, side and hole letter), `model.holes` and `model.sides`, `convergence`, `gravity`, `notes`, `report` (Markdown), `facesImageUrl`, `resultVtuUrl` and `inputDeckUrl`. `status` is `ok`, `inspect` (faces listed), `timeout` or `failed`, with an `error` that says what to change. The run's `OUTPUT` record holds all studies in one object.

The setup picture shows what was solved, so a wrong face or a load pointing the wrong way is caught at a glance:

![The bracket with its two fixed holes in blue and the 300 N load as an orange arrow](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/fea-stress-analysis-setup.png?signature=1mOfmyFDWLudivo8W72x1)

### How it works

1. The CAD file is read with the OpenCascade kernel inside Gmsh. Faces are numbered as in the file, flat ends become sides, and complete cylindrical holes get letters.
2. Gmsh meshes the solid with curved 10-node tetrahedra, smaller around holes and fillets. Elements that come out folded are straightened.
3. Forces, pressures and torques are turned into consistent nodal loads. Supports become fixed nodes.
4. CalculiX solves the linear static problem, with its direct solver (SPOOLES) or, for large meshes, its iterative one.
5. Stresses and movements are read at the nodes; reactions are summed per support and checked against the loads.
6. PyVista draws the pictures off screen.

Each study runs in its own process without access to the run's token, with limits on time and memory.

### Pricing

You pay per study, at the price shown on this page. One study event covers up to 30 seconds of meshing, solving and drawing, which is enough for a normal mesh of most parts; a larger study costs one more event for each further 30 seconds it starts. Listing a part's faces is a cheaper inspection event. A study that runs out of time counts for the time it used. A file that can't be read, and supports or loads that can't be set up, are never charged. If you set a maximum cost per run, the Actor stops before a study that wouldn't fit.

### Speed

Measured on one CPU core, meshing, solving and drawing together:

| Study | Time |
|---|---|
| Listing the faces of the example bracket | 2 to 3 seconds |
| The example, coarse mesh (5,300 elements) | 5 seconds |
| The example, normal mesh (14,900 elements) | 12 seconds |
| The example, fine mesh (35,900 elements) | 70 seconds |
| The example, normal mesh with `convergenceCheck` | 77 seconds |
| A 200 × 100 mm plate with 50 holes, normal mesh (76,000 elements) | 55 seconds |
| The example with `"elementSizeMm": "1.2"` (92,000 elements) | 3 minutes 50 seconds |

Apify gives a run one core for every 4 GB of memory, so the default 4 GB runs at these speeds and 2 GB at about half. A run through the API adds a few seconds for the cloud container to start.

### Tips and limits

- One material per study, isotropic and linear. No contact, no bolt preload, no buckling, fatigue, heat or dynamics.
- Up to 150,000 elements. A part too detailed for that fails with advice to remove small features such as threads, text and tiny fillets.
- Very thin sheet parts get one element through the thickness: fine for stiffness, less so for stress. Set `elementSizeMm` to about half the thickness when it matters.
- The safety factor uses the yield strength, or the ultimate strength for materials without one. The strengths are typical handbook values, not the minimums of a specification; put the values from your material's certificate into `customMaterial`.
- A load is spread evenly over the faces it names. To load part of a face, split the face in your CAD program first.
- Hole letters and face numbers are stable for a file: the same file gives the same names every time.
- Files up to 60 MB; links must be public.

### For AI agents and developers

- **Input**: `model` alone lists the faces. Add `fixed`, `loads` and `material` for a study.
- **Output**: `summary` says the result in a sentence; `maxVonMisesAwayFromSupportsMpa`, `maxDisplacementMm` and `safetyFactorAwayFromSupports` are the numbers to act on; `warnings` say what limits them; `report` is Markdown you can show a person.
- **Errors**: `status` is "ok", "inspect", "timeout" or "failed", with an `error` that says what to change. A failed setup still returns `faces` and `facesImageUrl`, so the next call can name the right faces.
- **Cost**: one event per study that takes under 30 seconds, a cheaper one for an inspection, nothing for input that can't be used.

Get the results from one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~fea-stress-analysis/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model": "example", "fixed": ["holes 7 mm"], "loads": ["300 N right on hole A"], "material": "aluminum 6061-t6"}'
```

`run-sync` instead returns the run's `OUTPUT`: every study as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/fea-stress-analysis").call(run_input={
    "model": "https://example.com/bracket.step",
    "material": "steel",
    "fixed": ["bottom"],
    "studies": [{"title": f"{load} N", "loads": [f"{load} N down on top"]} for load in (250, 500, 1000)],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], item["status"], item["summary"] or item["error"])
    print(item["maxVonMisesAwayFromSupportsMpa"], item["maxDisplacementMm"], item["stressImageUrl"])
```

### Credits

- Solver: [CalculiX](https://www.calculix.de/) (GPL-2.0), by Guido Dhondt and Klaus Wittig, with the SPOOLES direct solver.
- Geometry and meshing: [Gmsh](https://gmsh.info/) (GPL-2.0-or-later). Geuzaine C, Remacle J-F. Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities. International Journal for Numerical Methods in Engineering 2009. It reads CAD files with [Open CASCADE Technology](https://dev.opencascade.org/) (LGPL-2.1).
- Pictures: [PyVista](https://pyvista.org/) (MIT) and [VTK](https://vtk.org/) (BSD).

# Actor input Schema

## `model` (type: `string`):

A link to a STEP file (.step, .stp), or IGES or BREP; gzip and ZIP with one file work too. Units are read from the file and results are in millimetres. Write example to use the built-in bracket.

## `upload` (type: `string`):

A STEP, IGES or BREP file from your computer, instead of a link.

## `material` (type: `string`):

Sets the stiffness, the weight and the strength the safety factor is measured against. Steel when left empty. Typical handbook values; put your own in customMaterial.

## `customMaterial` (type: `object`):

Instead of the list, or to change single values of the chosen material: {"youngsModulusMpa": 71000, "poissonRatio": 0.33, "densityKgM3": 2800, "yieldStrengthMpa": 420, "ultimateStrengthMpa": 480, "name": "My alloy"}. Young's modulus and Poisson's ratio are needed for a material of your own; density only for gravity; the strengths only for the safety factor.

## `fixed` (type: `array`):

Faces held completely still, one entry each: a side (bottom, top, left, right, front, back), a face number (face 3, faces 3-5), a hole (hole A, holes 7 mm, all holes, largest hole) or the face nearest a point (near 10, 0, 5). Leave supports and loads empty to get the list and a picture of the part's faces first.

## `sliding` (type: `array`):

Flat faces that may slide in their own plane but not lift off or sink in: a part resting on a table, or a symmetry plane. Named like fixed faces.

## `loads` (type: `array`):

One entry each, as amount, direction and faces: 500 N down on top; 1.2 kN -x on hole A; 150 lbf normal on face 7 (pushing straight into the face); 2 MPa on face 7 (pressure); 5 N·m on hole A (torque about the hole's axis). Directions: down, up, left, right, front, back, +x to -z, normal, outward, or three numbers. A force is spread evenly over the faces it names.

## `gravity` (type: `string`):

The part's own weight as a load: down for one g downward, or 2 g down, 9.81 m/s2 -y, or three numbers in m/s² such as 0, 0, -9.81. Empty: no weight.

## `up` (type: `string`):

Which axis of the model points up; it decides what top, bottom, front, back, down and up mean.

## `meshQuality` (type: `string`):

How finely the part is divided into 10-node tetrahedra. Parts with many holes and fillets get more elements than the figure says.

## `elementSizeMm` (type: `string`):

Set the largest element edge yourself, in millimetres, such as 1.5, instead of the mesh setting. Up to 150,000 elements are solved.

## `convergenceCheck` (type: `boolean`):

Solve a second time on a finer mesh and report how much the stress and the movement change. Under a few percent means the mesh is fine enough. Takes about three times as long.

## `inspect` (type: `boolean`):

Don't solve: return the part's size, volume, faces, sides and holes with a numbered picture, to see what to hold and load. Billed as the cheaper inspection event.

## `pictures` (type: `boolean`):

Draw the stress, the movement and the supports and loads as PNG.

## `imageWidth` (type: `integer`):

Width of each picture.

## `resultFiles` (type: `boolean`):

Also save the full result as a VTU file (opens in ParaView, with displacement and von Mises stress at every node) and the CalculiX input deck (.inp), to rerun or extend the study yourself.

## `title` (type: `string`):

A title for the pictures and the report.

## `timeLimitSeconds` (type: `integer`):

How long one study may mesh, solve and draw. A normal mesh takes 10 to 20 seconds. Time past 30 seconds is billed per started 30 seconds.

## `studies` (type: `array`):

Several studies in one run, such as load cases of one part: a list of objects, each with any of the fields above: \[{"title": "pull", "loads": \["300 N right on hole A"]}, {"title": "twist", "loads": \["5 N·m on hole A"]}]. Fields not given come from above. In a study a load can also be an object: {"on": "hole A", "force": 300, "direction": \[1, 0, 0]}, {"on": "face 7", "pressure": 2} or {"on": "hole A", "torque": 5}.

## Actor input object example

```json
{
  "model": "example",
  "material": "aluminum 6061-t6",
  "fixed": [
    "holes 7 mm"
  ],
  "loads": [
    "300 N right on hole A"
  ],
  "up": "z",
  "meshQuality": "normal",
  "convergenceCheck": false,
  "inspect": false,
  "pictures": true,
  "imageWidth": 1400,
  "resultFiles": false,
  "timeLimitSeconds": 300
}
```

# Actor output Schema

## `results` (type: `string`):

One item per study: highest stress, movement, safety factor, reactions, warnings and links to the pictures.

## `files` (type: `string`):

The stress, displacement, setup and faces pictures, and the VTU and CalculiX files when asked for, in the run's key-value store.

## `output` (type: `string`):

The OUTPUT record: the run's status and every study in one object.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "model": "example",
    "material": "aluminum 6061-t6",
    "fixed": [
        "holes 7 mm"
    ],
    "loads": [
        "300 N right on hole A"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/fea-stress-analysis").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "model": "example",
    "material": "aluminum 6061-t6",
    "fixed": ["holes 7 mm"],
    "loads": ["300 N right on hole A"],
}

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/fea-stress-analysis").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "model": "example",
  "material": "aluminum 6061-t6",
  "fixed": [
    "holes 7 mm"
  ],
  "loads": [
    "300 N right on hole A"
  ]
}' |
apify call jumblemog/fea-stress-analysis --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/fea-stress-analysis"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/M8k8pBMkgPDCHmKST/builds/bPz42VIA4Z3ABhhIr/openapi.json
