Metadata-Version: 2.5
Name: felupe-studio
Version: 0.6.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: 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 clickable GUI for [FElupe](https://github.com/adtzlr/felupe) that runs 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 or from Python scripts with parameters: cell sets from cell tags, materials (linear elastic for small or large strains; hyperelastic like Neo-Hooke, Mooney-Rivlin, Yeoh, Ogden, Arruda-Boyce, …; 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. 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) and the equivalent plastic strain, their minimum and maximum, 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.

Version 0.6 adds:
- **Expressions of parameters** in the numbers of the commands, e.g. a shear of `0.5 * layers * height`.
- **Python on your computer:** `felupe-studio serve` runs the same app with your Python instead of Pyodide, installed from PyPI.
- **Agents on the open app:** with `felupe-studio serve --agent`, an agent like Claude Code works on the model in your browser, and you see every change in the history.
- **Single precision** of the linear system of a job or of the whole model, for larger models.
- **A faster start:** the bytecode of Python is kept in the browser.
- **Picking by long presses** on touch screens.

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 "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)

![The results of the sample: the von Mises stress with its minimum and maximum and the force-displacement curve](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/results.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 a tutorial, 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, 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/272).

**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, 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).
