Skip to content

Validating that bend_radius is strictly larger than half the mode plane size #2371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- The `bend_radius` for a mode solve must be strictly larger than half the mode plane size (previously it could be equal).

## [2.8.2] - 2025-04-09

### Added
Expand Down
7 changes: 4 additions & 3 deletions tidy3d/components/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import numpy as np
import pydantic.v1 as pydantic

from ..constants import fp_eps
from ..exceptions import SetupError, ValidationError
from ..log import log
from .base import DATA_ARRAY_MAP, skip_if_fields_missing
Expand Down Expand Up @@ -459,8 +460,8 @@ def validate_mode_plane_radius(mode_spec: ModeSpec, plane: Box, msg_prefix: str
_, plane_axs = plane.pop_axis([0, 1, 2], plane.size.index(0.0))
radial_ax = plane_axs[(mode_spec.bend_axis + 1) % 2]

if np.abs(mode_spec.bend_radius) < plane.size[radial_ax] / 2:
if not (np.abs(mode_spec.bend_radius) > plane.size[radial_ax] / 2 + fp_eps):
raise ValueError(
f"{msg_prefix} bend radius is smaller than half the mode plane size "
"along the radial axis, which can produce wrong results."
f"{msg_prefix} bend radius must be larger than half the mode plane size "
"along the radial axis to avoid wrong results."
)