Metadata-Version: 2.5
Name: felupe-studio
Version: 0.14.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-contact<0.2,>=0.1
Requires-Dist: felupe>=12.1.2
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 (also of the meshes of files and scripts), 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; user-defined in a Python file: a constitutive model, a strain energy function or a strain-based function), sections with the `u`, `u-isochoric` (e.g. air as a third medium) or a nearly incompressible formulation (condensed per cell, mixed fields or the three-field variation of any material with a volumetric part), 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), Cartesian constraints in a rotated coordinate system (e.g. a support on an inclined plane), cylindrical constraints about an axis (e.g. a rigid sleeve or a torsion), rigid planes and cylinders with contacts and friction, contacts between deformable bodies (two sections, the bodies of one section or a body with itself, e.g. a rubber buffer pressed on a plate that bends) with friction, point loads and pressures, and steps that ramp several items with their own values and switch boundaries on and off, 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 others in one color or hidden), the force-displacement (or moment-rotation) curve with free axes, also of a control point, and the displacements and forces of the control points, and play the substeps. A plane normal to x, y or z cuts the view, also of the results, so the inside of a model is seen. The FElupe script, the results (XDMF/VTU/CSV), the meshes and pictures of the view can be exported, and the XDMF results of a job imported again, whatever model is open; a project is saved as a text file or as an archive with its mesh files, with the save dialog of the system where the browser has one. The app has a dark and a light theme, and on a phone a compact layout.

Version 0.14 adds **the curves of the bodies of a contact between bodies** and small improvements of the views and of mesh scripts:
- **Curve of** also lists every body of a contact between bodies: its mean displacement and the resultant contact force on it, equal and opposite for the two bodies of a contact; a button copies the curve to the clipboard, ready to paste into a spreadsheet.
- **Perspective** can be switched off in the toolbar of the view (a parallel projection), **Fit while playing** keeps the camera while a result plays, and the toolbar of the view on a phone fades at its edge instead of looking cut off.
- A **mesh script** runs once for all its items, and *Solve* uses the mesh that is shown; *Replace file…* says under which name the chosen file is stored.

![The sample "Rubber buffer on a plate": the von Mises stress and the force of the rubber buffer over its displacement, chosen with Curve of as a body of its contact](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/body-curve.png)

Version 0.13 added **curves of the control points** and a better reading of the results:
- **Curve of:** the curve card chooses the curve of the job, of the curve boundary or of a control point by its name: the force over its displacement, the moment over the rotation of a rotation point, or the displacement over the substep when there is no force. The CSV of the curve is the chosen one.
- **The cell under the pointer** is outlined in the results, and **a long press on a touch screen** shows the value under the finger, which follows the finger and stays when it is lifted.
- **An eye for the groups of the browser** (Point Sets, Sections, Boundaries, …) hides all their objects at once, and **the ribbon keeps its height** in every tab.

![The sample "Bushing with steel sleeves": the von Mises stress of the rubber and the moment over the rotation of its control point `turn`, chosen with Curve of in the curve card](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/point-curve.png)

Version 0.12 added **the contact between deformable bodies**, with `SolidBodyContact` of [felupe-contact](https://github.com/adtzlr/felupe-contact): two sections pressed onto each other, e.g. a rubber buffer on a plate that bends, the bodies of one section or a body with itself, with friction, and the sample *Rubber buffer on a plate*.

![The sample "Rubber buffer on a plate": the von Mises stress of the steel plate bent under the rubber buffer, a quarter with two symmetry planes, and the force-displacement curve of the buffer pressed down](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/buffer.png)

Version 0.11 added the formulation of a section in the Sections ribbon (nearly incompressible in three ways, or the isochoric part of a third medium), constraints in local coordinates (Cartesian and cylindrical), user-defined materials from a Python file, the mesh tools for every mesh, sections without volume and the results of an XDMF file shown again. Version 0.10 added a cut through the model, steps that switch boundaries on and off, more mesh tools (*Stack*, *Circle* and *Triangle*), the other sections of a range in one color or hidden and the save dialog of the system. Version 0.9 added pictures for reports with a light theme, own colors of sections and cell sets, the range of a contour from chosen sections and the app on a phone. 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 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)

![The sample "Bushing with steel sleeves" turned by 30° about its axis by a cylindrical constraint of its inner sleeve: the von Mises stress of the rubber, cut through the axis, and the force around the axis over the arc length on the radius of the sleeve](https://raw.githubusercontent.com/adtzlr/felupe-studio/main/docs/images/torsion.png)

![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/460).

**Non-goals:** meshing from CAD, 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).
