Skip to content

Commit c18bc9d

Browse files
Bug fix in CoaxialLumpedPort.to_source
1 parent ea1198b commit c18bc9d

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Fixed missing amplitude factor and handling of negative normal direction case when making adjoint sources from `DiffractionMonitor`.
1818
- Improved the robustness of batch jobs. The batch state, including all `task_ids`, is now saved to `batch.hdf5` immediately after upload. This fixes an issue where an interrupted batch (e.g., due to a kernel crash or network loss) would be unrecoverable.
1919
- Fixed warning for running symmetric adjoint simulations by port to not trigger when there is a single port.
20+
- Bug in `CoaxialLumpedPort` where source injection is off when the `normal_axis` is not `z`.
2021

2122
## [2.9.0] - 2025-08-04
2223

tests/test_plugins/smatrix/test_terminal_component_modeler.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,22 @@ def test_coaxial_port_snapping(tmp_path):
386386
check_lumped_port_components_snapped_correctly(modeler=modeler)
387387

388388

389+
@pytest.mark.parametrize("axis", [0, 1, 2])
390+
def test_coaxial_port_source_size(axis):
391+
"""Make sure source size is correct."""
392+
port = CoaxialLumpedPort(
393+
center=(0, 0, 0),
394+
inner_diameter=1,
395+
outer_diameter=2,
396+
normal_axis=axis,
397+
direction="+",
398+
name="port",
399+
impedance=50,
400+
)
401+
source = port.to_source(td.GaussianPulse(freq0=1e10, fwidth=1e9))
402+
assert np.isclose(source.size[axis], 0)
403+
404+
389405
def test_power_delivered_helper(monkeypatch, tmp_path):
390406
"""Test computations involving power waves are correct by manually setting voltage and current
391407
at ports using monkeypatch.

tidy3d/plugins/smatrix/ports/coaxial_lumped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def compute_coax_current(rin, rout, x, y):
192192

193193
return CustomCurrentSource(
194194
center=center,
195-
size=(self.outer_diameter, self.outer_diameter, 0),
195+
size=size,
196196
source_time=source_time,
197197
name=self.name,
198198
interpolate=True,

0 commit comments

Comments
 (0)