Skip to content

bug(FXC-5154): add function to compute min radius#3246

Open
marc-flex wants to merge 1 commit intodevelopfrom
bug/FXC-5154-cylinder-radii
Open

bug(FXC-5154): add function to compute min radius#3246
marc-flex wants to merge 1 commit intodevelopfrom
bug/FXC-5154-cylinder-radii

Conversation

@marc-flex
Copy link
Contributor

@marc-flex marc-flex commented Feb 6, 2026

Note

Low Risk
Localized refactor affecting only pre-simulation geometry validation and warning messages; no solver/runtime behavior changes beyond when warnings are emitted.

Overview
Refactors the small-cylinder-radius validation in HeatChargeSimulation by introducing _get_cylinder_radii_with_meshing_tol() to compute/clamp cylinder radii to a minimum meshing-safe value.

Replaces the previous inline min_radius computation (formerly tied to OPENCASCADE_* naming) with CYLINDER_RADIUS_TOL and updated warnings that trigger when radii are clamped (including handling of negative/too-small radii).

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

@marc-flex marc-flex self-assigned this Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 11:55
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

This PR refactors cylinder radius validation logic in the TCAD heat simulation module by extracting duplicate code into a reusable helper function. The changes improve code maintainability while preserving existing functionality for handling cylinders with radii that are too small for meshing.

Changes:

  • Renamed constant OPENCASCADE_CYLINDER_RADIUS_TOL to CYLINDER_RADIUS_TOL for better generality
  • Extracted minimum radius computation and clamping logic into new helper function _get_cylinder_radii_with_meshing_tol
  • Refactored _warn_small_cylinder_radius validator to use the new helper function instead of duplicating logic

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

@marc-flex marc-flex force-pushed the bug/FXC-5154-cylinder-radii branch from 6ba06ba to e6fc814 Compare February 6, 2026 12:03
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Diff Coverage

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

  • tidy3d/components/tcad/simulation/heat_charge.py (100%)

Summary

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

@marc-flex marc-flex force-pushed the bug/FXC-5154-cylinder-radii branch from e6fc814 to 18d3319 Compare February 6, 2026 12:47
@marc-flex marc-flex force-pushed the bug/FXC-5154-cylinder-radii branch from 18d3319 to caf82c9 Compare February 6, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant