Skip to content

[codex] Add COMSOL offline postprocessing guidance#28

Merged
jiweiqi merged 1 commit into
mainfrom
codex/comsol-offline-postprocessing-exports
May 11, 2026
Merged

[codex] Add COMSOL offline postprocessing guidance#28
jiweiqi merged 1 commit into
mainfrom
codex/comsol-offline-postprocessing-exports

Conversation

@jiweiqi
Copy link
Copy Markdown
Contributor

@jiweiqi jiweiqi commented May 11, 2026

Summary

Adds optional COMSOL skill guidance for Python-friendly/offline postprocessing exports after a solve.

  • Links a new optional reference from the COMSOL skill index and offline section.
  • Documents a reusable bundle with saved .mph, manifest.json, mph_summary.json, VTU fields, and CSV tables.
  • Adds headless JPype/Java API snippets for volume VTU, surface VTU, and table CSV export.
  • Keeps this guidance opt-in: no required checkpoint rule, no driver behavior change, no plugin-index/release/public-doc changes.

Real COMSOL Validation

Ran a headless COMSOL 6.4.0.293 smoke using the bundled block_with_hole heat-transfer workflow:

  • sim check comsol with UTF-8 forced: COMSOL 6.4 detected.
  • sim connect --solver comsol --ui-mode no_gui.
  • Executed geometry, material, physics, mesh, solve, and plot steps successfully.
  • Exported a validation bundle under a temp workdir:
    • saved .mph
    • exports/manifest.json
    • exports/mph_summary.json
    • exports/fields/domain_solution.vtu
    • exports/fields/boundary_fields.vtu
    • exports/tables/global_metrics.csv

Offline checks after export:

  • inspect_mph read the saved .mph as node_type=solved, comsol_version=6.4.0.293, physics_tags=["ht"], material_tags=["mat1"].
  • meshio opened both VTUs:
    • domain VTU: 926 points, 3908 tetra cells, point data Temperature
    • boundary VTU: 498 points, 996 triangle cells, point data Temperature
  • After stopping COMSOL, plain Python/stdlib parsed the VTU XML and CSV.
  • CSV metrics exported from COMSOL table:
    • average T: 326.19111807164984 K
    • max T: 373.0000000000001 K
    • min T: 292.9999999999999 K

Other Checks

  • git diff --cached --check
  • local markdown link sanity check for changed files

Notes

The real validation found one useful table-export gotcha: COMSOL can write only table metadata if a derived-value table is not populated first or the numerical selection is empty. The reference now calls that out explicitly.

@jiweiqi jiweiqi marked this pull request as ready for review May 11, 2026 13:52
@jiweiqi jiweiqi merged commit 7501fe0 into main May 11, 2026
1 check passed
@jiweiqi jiweiqi deleted the codex/comsol-offline-postprocessing-exports branch May 12, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant