convez.ai
BomPluginScore · de 0 a 100

OASiS — an open-source multi-physics and multi-code framework for verified computer simulations. Model Context Protocol (MCP) server connecting AI coding agents to 8 finite element solvers (FEniCSx, deal.II, 4C, NGSolve, scikit-fem, Kratos, DUNE-fem, FEBio) with cross-backend collation knowledge.

Instalação

$npx convez-ai Hereon-InstituteMS/OASiS

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
29
Forks
4
Acompanhando
3
Saúde
50%
Último commit
há 6 dias
Versão
v1.3.0
Issues abertas
2
Contribuidores
2

README

A tradução para o português deste README ainda está na fila.

OASiS

Open-source Agent for Simulation across multiple FEM Solvers — an open-source multi-physics and multi-code framework for verified computer simulations.

DOI License: MIT

OASiS is a Model Context Protocol (MCP) server that connects AI coding agents to eight independent finite element codes (FEniCSx, deal.II, 4C Multiphysics, NGSolve, scikit-fem, Kratos Multiphysics, DUNE-fem, FEBio). Any MCP-compatible AI tool (Claude Code, Cursor, Windsurf, GitHub Copilot) can operate solvers, couple them across codes, develop new solver capabilities, and verify simulation correctness — all through one protocol.

Key Numbers

MetricValue
FEM backends8 working (FEniCSx, deal.II, 4C, NGSolve, scikit-fem, Kratos, DUNE-fem, FEBio)
MCP tools13 consolidated tools
Physics types180+ across all backends
Coupling modes7 (heat DD, Poisson DD, one-way TSI, two-way TSI, relaxation study, L-bracket, preCICE)
Supported solver pairs20 for domain decomposition (any Python solver + any backend)
Tests400+ passing
E2E stress tests24 completed (24 pass)
Cross-backend collation topics26 topics, 45+ pitfalls (the actual differentiator)
Signal: retrieval-anchor coverage100% across all 8 backends

Quick Start

1. Clone and install

git clone https://github.com/Hereon-InstituteMS/OASiS.git && cd OASiS
python3 -m venv .venv && source .venv/bin/activate
pip install -e .

2. Install solver backends (pick what you need)

# pip-installable (any combination)
pip install ngsolve scikit-fem dune-fem
pip install KratosMultiphysics KratosStructuralMechanicsApplication

# FEniCSx (requires conda)
conda create -n fenics -c conda-forge fenics-dolfinx
# or: pip install fenics-dolfinx (if available for your platform)

# deal.II (system package)
sudo apt install libdeal.ii-dev   # Ubuntu/Debian

# 4C Multiphysics (build from source — see 4C documentation)

# FEBio (binary download)
# https://febio.org/downloads/  — set FEBIO_BINARY env var or place in PATH

3. Connect to your AI tool

The MCP server runs as a stdio process. Each AI tool has its own way to register it.

Claude Code (recommended — supports sub-agent spawning for critic workflow):

# From the project root:
claude mcp add oasis \
  .venv/bin/python -- -m server \
  -e PYTHONPATH=src \
  -e PYVISTA_OFF_SCREEN=true

Or manually create .claude/settings.json in the project directory:

{
  "mcpServers": {
    "oasis": {
      "type": "stdio",
      "command": ".venv/bin/python",
      "args": ["-m", "server"],
      "cwd": "src",
      "env": {
        "PYTHONPATH": "src",
        "PYVISTA_OFF_SCREEN": "true"
      }
    }
  }
}

Cursor:

Go to Settings > MCP Servers > Add Server, then enter:

  • Name: oasis
  • Command: /path/to/OASiS/.venv/bin/python
  • Args: -m server
  • Working directory: /path/to/OASiS/src
  • Environment: PYTHONPATH=src, PYVISTA_OFF_SCREEN=true

Windsurf:

Add to your Windsurf MCP configuration (Settings > MCP):

{
  "oasis": {
    "command": "/path/to/OASiS/.venv/bin/python",
    "args": ["-m", "server"],
    "cwd": "/path/to/OASiS/src",
    "env": { "PYTHONPATH": "src", "PYVISTA_OFF_SCREEN": "true" }
  }
}

OpenAI Codex / any MCP client:

The server speaks standard MCP over stdio. Point your client at:

command: .venv/bin/python -m server
cwd: src/
env: PYTHONPATH=src

4. Verify

source .venv/bin/activate
cd src && python -m server  # should start without errors (Ctrl+C to stop)

# Run tests
cd .. && pytest tests/ -v

5. Optional: configure solver source access

To enable developer mode (source browsing, modification, rebuild), add solver paths to your MCP environment. See .claude/settings.json.example for the template.

Environment Variables

Solver backends are auto-detected from pip/conda installations. For compiled solvers or source-level development access, set these in your MCP settings:

VariablePurposeExample
FOURC_ROOT4C source tree/home/user/4C
FOURC_BINARY4C binary path/home/user/4C/build/4C
DEALII_ROOTdeal.II source/opt/dealii
FENICS_ROOTFEniCSx source/home/user/dolfinx
NGSOLVE_ROOTNGSolve source/home/user/ngsolve
KRATOS_ROOTKratos source/home/user/Kratos
DUNE_ROOTDUNE-fem source/home/user/dune-fem
SKFEM_ROOTscikit-fem source/home/user/scikit-fem
FEBIO_BINARYFEBio binary/home/user/febio4/bin/febio4

When a *_ROOT variable is set, the agent can browse, modify, and rebuild the solver source code (developer mode).

Architecture

User --> AI Agent (any MCP client) --> MCP Protocol --> OASiS
                                                          |
   +-------------+---------+------+--------+--------+--------+--------+-------+
   |             |         |      |        |        |        |        |       |
FEniCSx     deal.II      4C   NGSolve   skfem   Kratos    DUNE    FEBio
(Python)     (C++)    (YAML) (Python) (Python) (JSON)   (Python)  (XML)

Three Modes of Operation

1. Operate: Run Simulations

The agent generates solver-specific input, runs the simulation, and validates results.

2. Couple: Multi-Solver Workflows

Domain decomposition, field transfer, and multi-physics coupling across different FEM codes.

3. Develop: Extend Solver Capabilities

When a solver lacks a needed feature, the agent can read source code, implement the missing piece, rebuild, and test.

MCP Tools

ToolPurpose
prepare_simulationKnowledge + examples + template in ONE call
run_simulationExecute Python-based solvers (FEniCS, NGSolve, scikit-fem, DUNE)
run_with_generatorGenerate input + run compiled solvers (4C, deal.II, Kratos)
knowledgePhysics knowledge, pitfalls, materials, coupling docs, cross-backend collation
discoverList solvers, check availability, capabilities matrix
examplesReal test files and templates from solver test suites
coupled_solveCross-solver domain decomposition (20 solver pair combinations)
transfer_fieldExtract and transfer fields between solver outputs
visualizeField statistics, plots, automated validation
generate_meshGmsh mesh generation (L-domain, plate with hole, channel)
developerSource architecture, file browsing, extension points
session_insightsReview session patterns, contribute knowledge back
reload_catalogHot-reload backend catalogs without restarting the MCP server

The Cross-Backend Differentiator

OASiS ships 26 cross-backend collation topics with 45+ pitfalls that describe gotchas at the delta between two or more solvers — content that has no equivalent in any individual solver's docs:

  • units, element node ordering, linear-elastic semantics, Dirichlet BC enforcement
  • restart/checkpoint compatibility, MPI launch idioms, element-type naming
  • time-integration defaults, solver-tolerance defaults, contact formulation defaults
  • output-format conventions, integration-order defaults, boundary-tag semantics
  • plasticity return-mapping, turbulence model defaults, material orientation
  • frequency-unit conventions, mesh-quality thresholds, stress-measure conventions
  • periodic-BC implementation, damping-convention defaults, timestamp output
  • initial-condition interpolation, frame-of-reference BC
  • linear-solver defaults (direct vs iterative dispatch, GMRES restart, tolerance scaling)
  • nonlinear convergence criteria (relative vs absolute, energy-norm, line-search, failure-signal paths)

Reach via knowledge(topic='cross_backend') or filter by physics: knowledge(topic='cross_backend', physics='units').

Tested Benchmarks

These benchmarks have been run as end-to-end stress tests with a fresh AI agent. Each prompt was given verbatim to the agent with no additional guidance.

Single-Solver Benchmarks (9/9 pass)

#PromptSolverResult
1Solve the lid-driven cavity problem at Re=400 using FEniCS and visualize the vortex structure in ParaView.FEniCSPASS
2Run a 3D magnetostatics problem in NGSolve: a permanent magnet inside a steel housing. Show the B-field distribution.NGSolvePASS
3Simulate a cantilever beam with Neo-Hookean hyperelastic material under large deformation using deal.II. Apply 30% compression.deal.IIPASS
4Run an eigenvalue analysis on an L-shaped membrane in scikit-fem. Find the first 10 eigenfrequencies and compare against known values.scikit-femPASS
5Simulate fluid-structure interaction of a flexible flag behind a cylinder in 4C.4CPASS
6Solve a transient reaction-diffusion system (Turing patterns) on a unit square using DUNE-fem. Show the pattern evolution.DUNE-femPASS
7Simulate a 3D cantilever beam subjected to a sudden tip load using Kratos Multiphysics. Track the tip displacement over time and compare the oscillation frequency against the analytical first natural frequency.KratosPASS
8Simulate 2D flow past a circular cylinder at Re=100 using FEniCS. Run long enough to capture periodic vortex shedding and measure the Strouhal number. Compare against the accepted value St~0.164.FEniCSPASS
9Solve the Poisson equation with a known analytical solution on a 3D unit cube using NGSolve. Run an h-convergence study with 4 mesh refinement levels and verify optimal L2 convergence rate for P1 and P2 elements.NGSolvePASS

Cross-Solver Validation (2/2 pass)

#PromptSolversResult
10Solve Stokes flow in a backward-facing step on FEniCS, NGSolve, and scikit-fem. Compare the reattachment length.3 solversPASS
11Run linear elasticity on a plate with a circular hole under uniaxial tension. Compare stress concentration factor across deal.II, FEniCS, and 4C.3 solversPASS

Multi-Solver Coupling (4/4 pass)

#PromptSolversResult
12Solve heat conduction on an L-domain with FEniCS, transfer the temperature field to NGSolve, and solve thermoelasticity there. Show the thermal stress distribution.FEniCS + NGSolvePASS
13Run a Poisson problem with domain decomposition: left half on DUNE-fem, right half on scikit-fem. Iterate until convergence.DUNE + scikit-femPASS
14Simulate a heated steel beam in 4C (TSI one-way) and independently verify the thermal expansion using FEniCS. Compare displacements.4C + FEniCSPASS
15Model electromagnetic wave scattering in NGSolve around an obstacle, then use the Joule heating field as a thermal load in a Kratos structural analysis.NGSolve + KratosPASS

Advanced (7/7 pass)

#PromptSolverResult
16Run a poroelasticity consolidation problem in 4C (Terzaghi's problem) and verify against the analytical solution.4CPASS (re-run: settlement 0.1%, pressure < 0.4% error, agent derived correct BULKMODULUS→alpha mapping)
17Simulate crack propagation in a double-cantilever beam using 4C peridynamics and compare the energy release rate against LEFM predictions.4CPASS (G_eff = G_Ic exact, CMOD 8.5% of LEFM)
18Set up a fluid-beam interaction problem in 4C: flow around a slender elastic beam. Monitor the beam tip displacement over time.4CPASS (4.36mm tip deflection, monotonic growth)
19Simulate gravity-driven packing of 500 spherical particles into a cylindrical container using Kratos DEM. Measure the final packing fraction and compare against the random close packing limit (~0.64).KratosPASS
20Compute the first 6 electromagnetic resonant frequencies of a 3D rectangular cavity using NGSolve Nédélec elements. Compare against the analytical TM/TE mode frequencies.NGSolvePASS (all 6 modes match to <10⁻⁶ relative error)
21Generate a 3D thick-walled cylinder mesh with Gmsh, then solve internal pressure loading with Neo-Hookean material in FEniCS. Compare the radial displacement against the analytical Lamé solution at small strain.FEniCSPASS (0.42% L2 error vs Lamé, P2 curved elements)

Solver Selection & Agent Intelligence (1/1 pass)

#PromptSolver ChosenResult
22Solve the heat equation on a unit square with T=1 on the left, T=0 on the right, and zero-flux top/bottom. Pick the best solver and verify against the analytical solution.FEniCS (auto-selected)PASS (L2 error = 7e-15, machine precision)
23Simulate two elastic blocks being pressed together with contact. Use whichever solver is most appropriate.4C (auto-selected)PASS (mortar penalty contact, 10 load steps, stress concentration 1.66x)
24Set up a simple fluid-structure interaction problem in Kratos using the CoSimulation application: flow in a channel with a flexible wall segment. Monitor the wall deflection.KratosPASS (14 Aitken iterations, 13.99mm deflection, 1.3% vs beam theory)

Contributing

We welcome contributions that improve the general-purpose capabilities of OASiS. The key principle:

Every improvement must benefit ALL simulations, not be fine-tuned for specific examples.

How to contribute

  1. Report agent behavior — Run any of the benchmark prompts (or your own) with your AI tool and solver setup. Report:

    • Which AI tool you used (Claude Code, Cursor, Windsurf, etc.)
    • The exact prompt you gave
    • What worked and what didn't
    • The agent's retrospective (ask the debrief questions below)
  2. Improve solver knowledge — Add pitfalls, element catalogs, or API documentation that would help any agent set up simulations correctly. Focus on things the agent had to discover by trial-and-error.

  3. Add solver backends — Implement the SolverBackend interface for a new FEM code.

  4. Expand coupling — Add script generators for new solver pairs in src/tools/coupling.py.

What NOT to contribute

  • Benchmark-specific parameter databases (the agent should research these per-problem)
  • Model-specific templates (e.g., "Turek-Hron FSI2 template") — these are fine-tuning
  • Hardcoded paths or machine-specific configurations

Debrief questions (ask after every stress test)

- "What went wrong and what workarounds did you have to use?"
- "Which MCP tools were useful and which were missing or unhelpful?"
- "What information did you have to look up online that should have been available through the MCP?"
- "What parameters did you struggle with and why?"
- "If you had to do this again, what would you do differently?"

Feed the answers back as general-purpose improvements to the MCP knowledge and tools.

AI Tool Compatibility

The MCP server works with any MCP-compatible AI tool. Agent instructions are provided in multiple formats:

FileAI Tool
CLAUDE.mdClaude Code
AGENTS.mdCross-tool standard
.cursorrulesCursor
.windsurfrulesWindsurf
.github/copilot-instructions.mdGitHub Copilot

License

MIT

Citation

If you use OASiS in your research, please cite:

@article{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},
}
Ver o original no GitHub

Bom para

Relacionados