Metadata-Version: 2.5
Name: felupe-studio
Version: 0.9.0
Summary: The Python side of FElupe Studio: the commands of a model, its FElupe script, its results and an MCP server for AI agents
Project-URL: Homepage, https://github.com/adtzlr/felupe-studio
Project-URL: App, https://adtzlr.github.io/felupe-studio/
Project-URL: Documentation, https://github.com/adtzlr/felupe-studio/blob/main/docs/guide.md
Project-URL: Changelog, https://github.com/adtzlr/felupe-studio/blob/main/CHANGELOG.md
Author: Andreas Dutzler
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: felupe,finite-element-method,hyperelasticity,mcp
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: felupe>=12.1.1
Requires-Dist: jsonschema>=4.18
Requires-Dist: meshio
Requires-Dist: tensortrax>=0.30.0
Provides-Extra: mcp
Requires-Dist: mcp>=2.3; extra == 'mcp'
Provides-Extra: pardiso
Requires-Dist: pypardiso; extra == 'pardiso'
Provides-Extra: serve
Requires-Dist: starlette>=0.40; extra == 'serve'
Requires-Dist: uvicorn>=0.30; extra == 'serve'
Requires-Dist: websockets>=13; extra == 'serve'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: ruff; extra == 'test'
Description-Content-Type: text/markdown

# felupe-studio

A graphical modeling environment for [FElupe](https://github.com/adtzlr/felupe): build, solve and evaluate finite element models of solids, entirely in the browser.

Every node in the GUI is a FElupe object. Every action is a command; the command list is saved as a text-diffable project file and turned into a readable FElupe script, which runs in the browser with [Pyodide](https://pyodide.org) and can be exported.

**Open the app:** <https://adtzlr.github.io/felupe-studio/>

![FElupe Studio with the sample "Hyperelastic block with a rigid plate"](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/model.png)

FElupe Studio builds models of solids, hyperelastic (e.g. rubber) or elastic-plastic (e.g. steel), in 3D, in plane strain or axisymmetric, from mesh files, Python scripts or the mesh tools of FElupe, with parameters (also derived ones): cell sets from cell tags, materials (linear elastic for small or large strains; hyperelastic like Neo-Hooke, Mooney-Rivlin, Yeoh, Ogden, Arruda-Boyce, …, also with the Mullins effect; strain-based, also elastic-plastic), sections with the `u`, `u-p-J` or `u-isochoric` formulation (e.g. air as a third medium), point sets (by a plane, at a bound, on a cylinder, on the outer surface, of a section, by picked surfaces or nodes), face sets, boundaries, symmetry planes and load cases, control points, multi-point constraints with rotation points (e.g. a rigid plate glued to a face), rigid planes and cylinders with contacts and friction, point loads and pressures, and steps that ramp several items with their own values, in jobs that may repeat a step for a load cycle. Solve runs in the browser with live results; the results show the deformed shape with contours of the displacement, the strains and the stresses per substep (at the cells or smooth at the points), the equivalent plastic strain and the maximum strain energy density of the Mullins effect, their minimum and maximum, the range of the contour of all or of chosen sections, the force-displacement (or moment-rotation) curve with free axes and the displacements and forces of the control points, and play the substeps. The FElupe script, the results (XDMF/VTU/CSV), the meshes and pictures of the view can be exported; a project is saved as a text file or as an archive with its mesh files. The app has a dark and a light theme, and on a phone a compact layout.

Version 0.9 adds:
- **Pictures for reports:** a light theme, with a white view and so a white picture of the view, beside the dark one (the default) or following the system. The symbols in the view are darker in it, so they stand out on white.
- **Own colors of sections and cell sets,** like those of the meshes, e.g. the rubber in black and the steel in gray.
- **The range of a contour from chosen sections:** the scale of e.g. the rubber of a bushing instead of a scale set by the stresses of its steel sleeves, with the minimum and the maximum of the rubber and its name at the scalar bar.
- **The app on a phone:** a compact layout of the same app in portrait and in landscape, in which the view has about four fifths of the height; the controls of the results are one row, and the curve takes the bottom of the view instead of covering it.

![The sample "Bushing with steel sleeves" in the light theme: the von Mises stress of the rubber with the range of the rubber, the sleeves in the extra color and Range: soft_body at the scalar bar](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/light.png)

![The app on a phone in portrait: the model, and the results with the row of the contour, Play and the substep, and the curve below the view](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/phone.png)

Version 0.8 added your own deployment under the name of an institute or a company ([your own deployment](https://github.com/adtzlr/felupe-studio/blob/main/docs/deployment.md)), load cycles with the Mullins effect and derived parameters. Version 0.7 added the mesh tools of FElupe in the app, PARDISO with Python on your computer and a fixed link of `felupe-studio serve`. Version 0.6 added expressions of parameters, Python on your computer (`felupe-studio serve`), agents on the open app and single precision. Version 0.5 added plasticity, the strains and stresses at the points, the samples of the engine mount and the metacone, and the MCP server. Version 0.4 added parameters and mesh scripts, 2D models, symmetry planes and contacts with rigid surfaces. See the [changelog](https://github.com/adtzlr/felupe-studio/blob/main/CHANGELOG.md).

![The results of the sample "Bushing with the Mullins effect" back at the start after its first load cycle: the maximum strain energy density that the rubber keeps, and the force-displacement curve of the first loading, the softer unloading and second loading and the loading on to 9 mm](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/mullins.png)

![The results of the sample "Engine mount (FElupe ex07)": the von Mises stress at the points, with air in the cavities of the rubber, and the force-displacement curve of the horizontal shift](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/engine-mount.png)

**Python on your computer:** `pip install "felupe-studio[serve]"`, then `felupe-studio serve` opens the same app with the Python of your computer instead of Pyodide: native NumPy and SciPy for large models, and mesh scripts with your own packages ([user guide](https://github.com/adtzlr/felupe-studio/blob/main/docs/guide.md#python-on-your-computer)).

**AI agents:** with `pip install "felupe-studio[serve,mcp]"`, `felupe-studio serve --agent` lets an agent like Claude Code or GitHub Copilot work on the model that is open in your browser. *Help ▸ Connect an agent* connects the tab; you see every change in the history and undo it, and you read a mesh script of the agent before it runs ([agents](https://github.com/adtzlr/felupe-studio/blob/main/docs/agents.md)). Headless, `felupe-studio-mcp` builds, checks and solves models with CPython, and you open the saved project in the app.

![An agent on the open app: it opened a sample, added a parameter and wrote a mesh script, which the user reads before it runs](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/agent.png)

**Documentation:** the [user guide](https://github.com/adtzlr/felupe-studio/blob/main/docs/guide.md) with tutorials, the [command reference](https://github.com/adtzlr/felupe-studio/blob/main/docs/reference.md), how the [commands](https://github.com/adtzlr/felupe-studio/blob/main/docs/commands.md) become a FElupe script, the [MCP server](https://github.com/adtzlr/felupe-studio/blob/main/docs/agents.md) for AI agents, [your own deployment](https://github.com/adtzlr/felupe-studio/blob/main/docs/deployment.md) under your own name, the [architecture decision records](https://github.com/adtzlr/felupe-studio/blob/main/docs/adr/), the [changelog](https://github.com/adtzlr/felupe-studio/blob/main/CHANGELOG.md) and the [roadmap](https://github.com/adtzlr/felupe-studio/issues/382).

**Non-goals:** meshing from CAD, contact between deformable bodies (contacts are with rigid planes and cylinders), a server backend (the MCP server and `felupe-studio serve` run on your computer).

## Repository layout

| Path | Content |
| --- | --- |
| `app/` | The web app (TypeScript, Vite) |
| `python/felupe_studio/` | Python package: command list → FElupe script (runs in Pyodide and CPython), the MCP server for AI agents (`mcp.py`, CPython) and the local runtime of the app (`felupe-studio serve`: `serve.py`, `runtime.py`, CPython) |
| `tests/` | Python tests |
| `docs/adr/` | Architecture decision records |
| `docs/` | User guide, command reference (generated by `docs/make_reference.py`), screenshots (`docs/images`, made by `docs/make_screenshots.py`), commands, your own deployment, benchmarks and the [release checklist](https://github.com/adtzlr/felupe-studio/blob/main/docs/release.md) |

## Development

Web app:

```bash
cd app
npm install
npm run dev      # development server
npm test         # unit tests (Vitest)
npm run lint     # ESLint and Prettier
npm run build    # typecheck and production build
```

Python package:

```bash
pip install -e ".[test,mcp,serve]"
pytest            # the app in a browser: pytest -m e2e (Playwright, a built app)
ruff check . && ruff format --check .
```

## License

felupe-studio is licensed under GPL-3.0-or-later, the same license as [FElupe](https://github.com/adtzlr/felupe).
