Change coordinates when Charge simulations aren't in the xy plane#2610
Change coordinates when Charge simulations aren't in the xy plane#2610marc-flex wants to merge 5 commits into
Conversation
958c1f8 to
384cff4
Compare
586040b to
c3d5226
Compare
There was a problem hiding this comment.
2 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile
| assert list(changed_sim.structures[0].medium.charge.N_d.coords["z"].data) == [0] | ||
|
|
||
| assert changed_sim.structures[0].medium.charge.N_a[0].source == "ymin" | ||
| assert changed_sim.structures[0].medium.charge.N_a[0].size == (1, 2, 1) |
There was a problem hiding this comment.
logic: The assumption that the source should be 'ymin' is not explicitly tested. Add assertion for other source values ('ymax', 'xmin', 'xmax') to ensure complete rotation handling.
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
tidy3d/components/tcad/simulation/heat_charge.py |
dbochkov-flexcompute
left a comment
There was a problem hiding this comment.
it seems like we don't really need to put this in the frontend? Just thinking that if we need to fix anything later, we would need make changes to frontend instead of just backend
I think you're right. I'll do all modifications in this PR and then I'll think how to move this to backend |
|
Closing this PR since coordinate transformation is dealt with entirely in the back end |
Greptile Summary
Added coordinate transformation functionality to rotate 2D charge simulations from z-plane to y-plane orientation with comprehensive handling of structure components and validation.
_create_charge_copy_xy()method intidy3d/components/tcad/simulation/heat_charge.pyto enable z-plane to y-plane rotation of 2D charge simulations_create_charge_copy_xy()test_charge_copy_xyintests/test_components/test_heat_charge.pyto verify rotation functionality