Skip to content

Conversation

@momchil-flex
Copy link
Collaborator

@momchil-flex momchil-flex commented Feb 9, 2026

  • Unstructured plotting to use monitor rather than data bounds
  • Switch box_clip to sel in symmetry expansion

Note

Medium Risk
Changes unstructured dataset postprocessing (symmetry expansion clipping and VTK-to-numpy conversion) and TCAD plotting bounds, which could subtly affect returned bounds/visualizations and memory usage.

Overview
Improves unstructured TCAD monitor postprocessing and plotting. Symmetry expansion now clips unstructured datasets using sel_inside() (instead of box_clip()), preserving boundary cells and avoiding over-clipping; tests were updated to assert coverage rather than exact bounds.

Adjusts unstructured mesh/field plotting to use monitor extents. Plot axis limits are derived from the monitor bounds (clipped to the simulation domain) and autoscaling is disabled before overlaying the unstructured mesh, ensuring plots focus on the requested monitor region.

Hardens VTK data ingestion. Converting VTK point arrays to numpy now forces a copy to prevent potential data corruption from views into VTK-managed buffers.

Written by Cursor Bugbot for commit 2e3eb85. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings February 9, 2026 14:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates TCAD postprocessing/plotting behavior to use monitor extents (rather than unstructured data extents) for display limits, and adjusts symmetry-expansion trimming for unstructured datasets to improve downstream accuracy (e.g., capacitance).

Changes:

  • Compute plot axis limits from the monitor extent (clipped to simulation bounds) for unstructured plot_mesh() / plot_field().
  • Replace unstructured box_clip() with sel_inside() during symmetry-expansion trimming.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
tidy3d/components/tcad/data/sim_data.py Sets plot limits based on monitor bounds for unstructured plotting and changes plotting order/limits behavior.
tidy3d/components/tcad/data/monitor_data/abstract.py Switches symmetry-expansion trimming for unstructured data from geometric clipping to coverage-based selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@momchil-flex momchil-flex requested review from dbochkov-flexcompute and marc-flex and removed request for marc-flex February 9, 2026 14:45
@momchil-flex momchil-flex force-pushed the momchil/fix_capacitance branch 3 times, most recently from 2640602 to 9e2b5fa Compare February 11, 2026 14:55
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@momchil-flex momchil-flex force-pushed the momchil/fix_capacitance branch 2 times, most recently from 2db4645 to c9ef4a0 Compare February 12, 2026 10:33
@momchil-flex momchil-flex force-pushed the momchil/fix_capacitance branch from c9ef4a0 to 9f807b0 Compare February 12, 2026 13:03
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/components/tcad/data/monitor_data/abstract.py (100%)
  • tidy3d/components/tcad/data/sim_data.py (100%)

Summary

  • Total: 21 lines
  • Missing: 0 lines
  • Coverage: 100%

@momchil-flex momchil-flex added this pull request to the merge queue Feb 12, 2026
@momchil-flex momchil-flex removed this pull request from the merge queue due to a manual request Feb 12, 2026
switch box_clip to sel in symmetry expansion
@momchil-flex momchil-flex force-pushed the momchil/fix_capacitance branch from 9f807b0 to 2e3eb85 Compare February 12, 2026 13:53
@momchil-flex
Copy link
Collaborator Author

@dbochkov-flexcompute out of caution I wanted to run this by you one last time: I had to modify the symmetry expansion test, because I also switched to using sel_inside in the symmetry expansion instead of box_clip. I did that for performance for large monitors. The modified test assumes that the original mesh will conform to the symmetry plane, which I think is a fair assumption?

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.

3 participants