feat: warning about excessive refinement from gap meshing (FXC-3919)#3206
Open
dbochkov-flexcompute wants to merge 1 commit intodevelopfrom
Conversation
ca91176 to
9786431
Compare
Contributor
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warn if automatically calculated dl from gap meshing is less than 0.1 x (current min mesh size). Threshold (0.1) is somewhat random, we could adjust if needed
Note
Adds a warning during auto grid generation to flag potentially excessive refinement from gap meshing.
LayerRefinementSpec.dl_min_from_gapsis <0.1 ×the smallest lateral grid size0.45toDL_MIN_FROM_GAPS_FRACTIONand addsGAP_REFINEMENT_WARNING_THRESH0.45 * min_gap_widthwithDL_MIN_FROM_GAPS_FRACTION * min_gap_widthdl_min_from_gap_width=False(no warning)CHANGELOG.mdunder UnreleasedWritten by Cursor Bugbot for commit 9786431. This will update automatically on new commits. Configure here.
Greptile Overview
Greptile Summary
This PR adds a warning to alert users when gap meshing creates excessively fine mesh refinement. It introduces two new constants (
DL_MIN_FROM_GAPS_FRACTIONandGAP_REFINEMENT_WARNING_THRESH) and refactors existing code to use the named constant instead of a magic number.Key changes:
0.45intoDL_MIN_FROM_GAPS_FRACTIONconstantdl_min_from_gapsis less than 10% of the smallest lateral grid sizeMinor issue:
Confidence Score: 4/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant GridSpec participant LayerRefinementSpec participant Logger User->>GridSpec: Create simulation with gap meshing enabled GridSpec->>GridSpec: _make_grid_multiple_iterations() loop For each gap meshing iteration GridSpec->>LayerRefinementSpec: _resolve_gaps(old_grid, merged_geos) LayerRefinementSpec-->>GridSpec: (snapping_lines, gap_width) alt dl_min_from_gap_width enabled GridSpec->>GridSpec: Update min_gap_width alt gap_width < inf GridSpec->>GridSpec: Calculate lateral_grid_sizes GridSpec->>GridSpec: Find min_lateral_grid_size GridSpec->>GridSpec: Calculate dl_min_from_gaps = 0.45 * gap_width alt dl_min_from_gaps < 0.1 * min_lateral_grid_size GridSpec->>Logger: log.warning("detected a very small gap width...") Logger-->>User: Display warning about excessive refinement end end end GridSpec->>GridSpec: _make_grid_one_iteration() with dl_min_from_gaps end GridSpec-->>User: Return final grid with refined gapsContext used:
dashboard- Update the CHANGELOG.md file when making changes that affect user-facing functionality or fix bugs. (source)