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. For non-trivial modeling, establish the
target model identity and working folder first: load the given .mph, or set a
descriptive model tag/title and save an early checkpoint .mph under a case
workdir. 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.12.tar.gz (164.2 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.12-py3-none-any.whl (97.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sim_plugin_comsol-0.1.12.tar.gz
  • Upload date:
  • Size: 164.2 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.12.tar.gz
Algorithm Hash digest
SHA256 0e819b9eb62ec1b183f5486a79e000d95e8a30f927a5d9be653a63e99b8fc137
MD5 293634f73de5c36ea56123cc62de487f
BLAKE2b-256 f4575941050e0aafe27d86be537ecc03637340278cea19ab5506f021fc55a1e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sim_plugin_comsol-0.1.12.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.12-py3-none-any.whl.

File metadata

File hashes

Hashes for sim_plugin_comsol-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6496388a0b050f9f35978dbbaa8263b13ef2e2152c18bb453750bfa9e102b523
MD5 0dab65b5210502ec480eb09130034a10
BLAKE2b-256 af1a24d7360ee09a75962f00c1b5ebd604c9542fa95e5485b1841cea7efa17c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sim_plugin_comsol-0.1.12-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