Skip to main content

COMSOL Multiphysics driver for sim-cli, distributed as an out-of-tree plugin

Project description

sim-plugin-comsol

COMSOL Multiphysics driver and Desktop attach workflow for sim-cli, distributed as an out-of-tree plugin via Python entry_points.

The COMSOL solver and its mph Python binding are not bundled — you supply them yourself. See LICENSE-NOTICE.md.

Install

pip install sim-plugin-comsol

After install, agents can drive an already-open COMSOL Desktop through the server-backed driver. Use this path first when the user wants to watch the same live model that the agent is building, inspecting, or solving:

sim connect --solver comsol --ui-mode gui --driver-option visual_mode=shared-desktop
sim inspect session.health
sim exec --file step.py

shared-desktop starts comsolmphserver, attaches a full COMSOL Desktop client to that server, and binds agent snippets to the Desktop active model tag. session.health should report model_builder_live: true and a live_model_binding.ok value of true before relying on the GUI as a live view of agent edits.

The standalone Java Shell attach helper remains available as a fallback for ordinary COMSOL Desktop windows that are already open, when switching to an mphclient session is undesirable, or when the task is a small human-in-the-loop edit:

sim-comsol-attach open --json --timeout 120
sim-comsol-attach health --json
sim-comsol-attach exec --file step.java --json

Use this fallback for bounded visible edits and quick checks. Prefer shared-desktop for reliable multi-step model building, solving, structured inspection, and repeatable agent workflows.

sim-cli also auto-discovers the server-backed driver:

sim drivers | grep comsol
sim run --solver comsol path/to/script.py

You can also install through sim-cli's plugin command:

sim plugin install sim-plugin-comsol

Agent quickstart

This repository is intended to be the complete COMSOL agent bundle. A receiving agent should not need a separate skill checkout for COMSOL work; the driver, Desktop attach helper, and COMSOL skill are bundled here. The only runtime dependency from the sim stack is the installed sim CLI/core package pulled in by this plugin.

For source-tree development:

git clone https://github.com/svd-ai-lab/sim-plugin-comsol
cd sim-plugin-comsol
uv sync
uv run sim drivers
uv run sim check comsol

The bundled skill entry point is:

src/sim_plugin_comsol/_skills/comsol/SKILL.md

Use it as the first agent instruction for COMSOL tasks, for example:

Use the bundled COMSOL skill in this repository. If the user wants reliable
visible co-editing, use the sim runtime with visual_mode=shared-desktop first
and verify session.health live_model_binding.ok. Use Java Shell Desktop attach
only for already-open ordinary Desktop sessions, small edits, or
human-in-the-loop fallback work. Build and solve the requested model one
bounded step at a time.

How it works

The plugin registers the Desktop attach CLI plus three entry-point groups:

[project.entry-points."sim.drivers"]
comsol = "sim_plugin_comsol:ComsolDriver"

[project.entry-points."sim.skills"]
comsol = "sim_plugin_comsol:skills_dir"

[project.entry-points."sim.plugins"]
comsol = "sim_plugin_comsol:plugin_info"

[project.scripts]
sim-comsol-attach = "sim_plugin_comsol.desktop_attach.cli:main"

sim.drivers exposes the driver class; sim.skills exposes a directory of skill files bundled inside the wheel; sim.plugins exposes plugin metadata for discovery. sim-comsol-attach exposes the Desktop-first collaboration path.

Develop

git clone https://github.com/svd-ai-lab/sim-plugin-comsol
cd sim-plugin-comsol
uv sync
uv run pytest

License

Apache-2.0. See LICENSE and LICENSE-NOTICE.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sim_plugin_comsol-0.1.11.tar.gz (161.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sim_plugin_comsol-0.1.11-py3-none-any.whl (95.3 kB view details)

Uploaded Python 3

File details

Details for the file sim_plugin_comsol-0.1.11.tar.gz.

File metadata

  • Download URL: sim_plugin_comsol-0.1.11.tar.gz
  • Upload date:
  • Size: 161.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sim_plugin_comsol-0.1.11.tar.gz
Algorithm Hash digest
SHA256 f3a1488c94a46587a670f9209524cbdaa53fa93b0d96d77f0cf254866eb826cc
MD5 dd8cb5c6260d8320514b7f39c07ce557
BLAKE2b-256 ff2fbbb18bca5cef73704a57335b7d1e52424875573071592be4c33c9d7eb1ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for sim_plugin_comsol-0.1.11.tar.gz:

Publisher: publish.yml on svd-ai-lab/sim-plugin-comsol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sim_plugin_comsol-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for sim_plugin_comsol-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 45fb526d639d6ef241e520064e55074b24b0c6ba0b27f61ff3dbe0202df64fde
MD5 fbfb48ff20fb89054491f95c09676773
BLAKE2b-256 f7980e4a8ca3d02ce757b4cc313d5aad078c81b05ea00393f9f1633eae31d5e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sim_plugin_comsol-0.1.11-py3-none-any.whl:

Publisher: publish.yml on svd-ai-lab/sim-plugin-comsol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page