-
Notifications
You must be signed in to change notification settings - Fork 63
Change coordinates when Charge simulations aren't in the xy plane #2610
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
Conversation
958c1f8
to
384cff4
Compare
586040b
to
c3d5226
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.py
to enable z-plane to y-plane rotation of 2D charge simulations_create_charge_copy_xy()
test_charge_copy_xy
intests/test_components/test_heat_charge.py
to verify rotation functionality