Important
Experimental development fork — the official, stable OASiS lives at https://github.com/Hereon-InstituteMS/OASiS. This repository is the working mirror where new capabilities are developed and stress-tested before they graduate upstream. Expect rough edges; for anything citable or production use, go to the official repository.
Open-source Agent for Simulation across multiple FEM Solvers
OASiS is an agentic simulation system: it lets any AI language model operate eight professional finite-element and multiphysics codes — FEniCSx, deal.II, 4C Multiphysics, NGSolve, scikit-fem, Kratos Multiphysics, DUNE-fem, and FEBio — through one common interface. You describe the physics problem in plain language; the AI agent picks a solver, writes correct input for it, runs the simulation, checks the result against analytical solutions or published benchmarks, and shows you the outcome. Under the hood, OASiS gives the model curated solver knowledge (pitfalls, working examples, element catalogs) and verified execution, so the agent does not have to rediscover each code's quirks by trial and error.
- Classic PDEs — Poisson and other elliptic problems, heat conduction, diffusion
- Solid mechanics — linear elasticity, hyperelasticity, plasticity, contact, eigenfrequency analysis
- Nonlinear problems — large deformation, nonlinear material laws, Newton-solver setup with sensible defaults
- Flow — Stokes and Navier-Stokes (lid-driven cavity, vortex shedding, channel flow)
- Transport — transient heat, reaction-diffusion (e.g. Turing patterns), convection
- Electromagnetics — Maxwell, cavity resonances, magnetostatics (NGSolve)
- Particle methods — SPH, DEM, peridynamics (4C, Kratos)
- Cross-code coupling — split a problem across two different solvers and iterate to convergence: thermo-mechanics, fluid-structure interaction, domain decomposition, and even multi-paradigm couplings such as FEM ↔ DSMC (continuum solid + rarefied-gas particle code via the experimental SPARTA backend), plus a bridge to the preCICE coupling library
- Mesh generation — Gmsh-based geometries (L-domain, plate with hole, channel, custom)
- Visualization & checking — field statistics, plots, automated sanity checks
- Convergence studies — h-refinement studies with error norms against analytical solutions
- Solver development — when a code lacks a feature, the agent can browse its source, implement the change, rebuild, and test
OASiS speaks the Model Context Protocol (MCP) — the standard way to plug tools into AI assistants. That gives you two ways in.
If you already use an AI coding app with a subscription, this is the zero-extra-cost path: the app brings the model, OASiS brings the solvers.
Claude Code (from the project root):
claude mcp add oasis \
.venv/bin/python -- -m server \
-e PYTHONPATH=src \
-e PYVISTA_OFF_SCREEN=trueClaude Desktop — add to claude_desktop_config.json (Settings > Developer > Edit Config):
{
"mcpServers": {
"oasis": {
"command": "/path/to/open-fem-agent/.venv/bin/python",
"args": ["-m", "server"],
"cwd": "/path/to/open-fem-agent/src",
"env": { "PYTHONPATH": "src", "PYVISTA_OFF_SCREEN": "true" }
}
}
}Cursor / Windsurf / any MCP client — same idea: command /path/to/open-fem-agent/.venv/bin/python, args -m server, working directory /path/to/open-fem-agent/src, env PYTHONPATH=src and PYVISTA_OFF_SCREEN=true. The server speaks standard MCP over stdio.
Then just ask, e.g.: "Solve the Poisson equation on a unit square with a known analytical solution and verify the convergence rate."
If you prefer an API key over an app subscription — OpenAI, OpenRouter, Anthropic, a local vLLM or Ollama server — this repository ships a working LangGraph agent harness in langgraph_eval/. It attaches every OASiS tool to a LangGraph agent via langchain-mcp-adapters and works with any OpenAI-compatible endpoint. The shipped scaffold (langgraph_eval/agent.py) builds the complete agent — model client, host-side tools, OASiS MCP tools — as a reusable function you call from your own driver script; pointing it at any provider is a one-line change to the model client:
from langchain_openai import ChatOpenAI
# OpenRouter (any hosted model)
llm = ChatOpenAI(base_url="https://openrouter.ai/api/v1",
api_key=os.environ["OPENROUTER_API_KEY"],
model="anthropic/claude-sonnet-4.5")
# OpenAI: base_url default, api_key=os.environ["OPENAI_API_KEY"]
# local vLLM: base_url="http://localhost:8000/v1", api_key="not-needed"
# Ollama: base_url="http://localhost:11434/v1", api_key="not-needed"The harness spawns the OASiS server as an MCP subprocess (see _mcp_server_params() in langgraph_eval/agent.py for the exact launch configuration), gives the model file/shell/web tools alongside the solver tools, and even lets it spawn a sub-agent to criticize its own setup before running. Install the extra dependencies with pip install -r langgraph_eval/requirements-langgraph.txt (a separate virtualenv, e.g. .venv-lg, is recommended).
- Subscription (Claude Pro/Max, Cursor, ...): use Option A. No API key, no per-token billing; the app you already pay for becomes a simulation front-end.
- API key: use Option B. Full control over which model runs the agent loop — including free/cheap models via OpenRouter or fully local open-weight models via vLLM/Ollama. Costs scale with usage.
| Tier | Backends | Install effort |
|---|---|---|
| pip-installable | NGSolve, scikit-fem, Kratos | pip install ... — seconds |
| conda-installable | FEniCSx, DUNE-fem | conda create -c conda-forge ... — minutes |
| system package | deal.II | sudo apt install libdeal.ii-dev |
| compiled from source | 4C Multiphysics | CMake build, see 4C docs |
| binary download | FEBio | https://febio.org/downloads/, set FEBIO_BINARY |
You do not need all eight — install what you need; discover(query='list') reports what is available and how to get the rest.
git clone https://github.com/alhermann/open-fem-agent.git && cd open-fem-agent
python3 -m venv .venv && source .venv/bin/activate
pip install -e . && pip install scikit-fem
claude mcp add oasis .venv/bin/python -- -m server -e PYTHONPATH=src -e PYVISTA_OFF_SCREEN=true
claude "Solve the Poisson equation -Δu = 1 on a unit square with u=0 on the boundary using scikit-fem, and report the max value."(For the stable version, clone https://github.com/Hereon-InstituteMS/OASiS.git instead.)
# pip-installable (any combination)
pip install ngsolve scikit-fem
pip install KratosMultiphysics KratosStructuralMechanicsApplication
# FEniCSx and DUNE-fem (conda-forge is the supported path)
conda create -n fenics -c conda-forge fenics-dolfinx
conda create -n ofa-dune -c conda-forge dune-fem
# deal.II (Ubuntu/Debian)
sudo apt install libdeal.ii-devsource .venv/bin/activate
cd src && python -m server # should start without errors (Ctrl+C to stop)
cd .. && pytest tests/ -v # run the test suiteSet *_ROOT environment variables (FOURC_ROOT, DEALII_ROOT, FENICS_ROOT, NGSOLVE_ROOT, KRATOS_ROOT, DUNE_ROOT, SKFEM_ROOT) in your MCP settings to let the agent browse, modify, and rebuild solver source code. For compiled binaries set FOURC_BINARY / FEBIO_BINARY. See .claude/settings.json.example.
You --> AI model (any app or API) --> MCP --> OASiS (src/server.py)
|
+-------------+---------+------+--------+--------+--------+--------+-------+
| | | | | | | | |
FEniCSx deal.II 4C NGSolve skfem Kratos DUNE FEBio
(Python) (C++) (YAML) (Python) (Python) (JSON) (Python) (XML)
- Server —
src/server.py, a stdio MCP server; backends load as plugins viasrc/core/registry.py. - Backends — one package per code under
src/backends/, each with a physics catalog and input generators for the compiled codes (plus an experimental SPARTA DSMC backend for rarefied-gas problems). - Curated knowledge — per-backend pitfalls, element catalogs, installed-version API references, and a cross-backend collation layer, served through
knowledgeandprepare_simulation. - Coupling orchestrator —
src/core/coupling_driver.py: each participant is a black box that readsimports.json/ writesexports.jsonunder an explicit contract; OASiS validates the contract, runs the fixed-point iteration with Aitken relaxation, and reports convergence-or-failure. A non-converged run is never presented as a result. - preCICE bridge —
src/core/precice_config.py+ thecouple_precicetool: generates a validprecice-config.xmlfor standard scenarios and verifies the coupling end-to-end.
| Tool | Purpose |
|---|---|
discover |
List solvers, availability, capabilities matrix |
prepare_simulation |
Knowledge + real examples + template in one call — always the first step |
run_simulation |
Execute Python-based solvers (FEniCSx, NGSolve, scikit-fem, DUNE-fem) |
run_with_generator |
Generate input + run compiled solvers (4C, deal.II, Kratos) |
knowledge |
Physics knowledge, pitfalls, materials, coupling docs, cross-backend collation |
examples |
Real test files from the solvers' own test suites |
couple |
General partitioned coupling for any physics (contract + Aitken relaxation) |
couple_precice |
preCICE-based coupling: config generation and end-to-end run |
coupled_solve |
Legacy fixed-geometry domain decomposition (deprecated — prefer couple) |
transfer_field |
Extract and transfer fields between solver outputs |
generate_mesh |
Gmsh mesh generation |
visualize |
Field statistics, plots, automated validation |
developer |
Solver source architecture, file browsing, extension points |
session_insights |
Review session patterns, contribute reusable knowledge back |
setup_backend / rediscover_backends / reload_catalog |
Install hints, re-scan for new solvers, hot-reload catalogs |
Three principles shape everything in this repository:
- General knowledge, never problem constants. Curated entries describe a class of failure and its general fix. Templates use placeholders, not the dimensions of any particular benchmark — anything that would anchor the agent to one geometry or one paper's parameters is rejected. The agent researches problem-specific values per task; the knowledge layer only removes tooling friction.
- Verification is not optional. Every workflow should end with a check against an analytical solution, a published benchmark, or an independent solver. The coupling orchestrator enforces this in code: contract violations and non-converged iterations are failures, never results. The server also asks the agent to have an independent critic review each setup before running.
- Operate and develop. The agent both runs the solvers and, when a feature is missing, extends them: developer mode exposes the source tree, and the agent reads, modifies, rebuilds, and re-tests the code itself. Fixes flow back into the knowledge layer in general form.
Contributions are welcome — please direct them to the official repository at https://github.com/Hereon-InstituteMS/OASiS. One rule above all: every improvement must benefit all simulations, not be fine-tuned for a specific example. Solver pitfalls, element catalogs, new backends, and new coupling generators are great contributions; benchmark-specific parameter databases and model-specific templates are not.
MIT — see LICENSE.
If you use OASiS in your research, please cite the official archived release:
@software{oasis2026,
title = {OASiS: an open-source multi-physics and multi-code framework for verified computer simulations},
author = {Hermann, Alexander and Shojaei, Arman and Scheider, Ingo and Cyron, Christian},
year = {2026},
doi = {10.5281/zenodo.20543501},
url = {https://github.com/Hereon-InstituteMS/OASiS}
}