-
Notifications
You must be signed in to change notification settings - Fork 63
Updates for fully anisotropic mode solver #2728
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
base: develop
Are you sure you want to change the base?
Conversation
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.
5 files reviewed, 9 comments
tidy3d/components/mode/solver.py
Outdated
@@ -410,7 +419,7 @@ def conductivity_model_for_good_conductor( | |||
|
|||
elif not is_eps_complex: | |||
eps_spec = "tensorial_real" | |||
E, H, neff, keff = cls.solver_tensorial(**kwargs, direction="+") | |||
E, H, neff, keff = cls.solver_tensorial(**kwargs, direction="+", col_mats=col_mats) |
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: Missing col_mats parameter in the tensorial_complex case (line 429) - this could cause inconsistent behavior for complex anisotropic materials
E, H, neff, keff = cls.solver_tensorial(**kwargs, direction="+", col_mats=col_mats) | |
E, H, neff, keff = cls.solver_tensorial(**kwargs, direction=direction, col_mats=col_mats) |
# Angle to test | ||
theta = np.pi / 180 | ||
theta = np.pi / 6 |
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.
style: Remove commented code and hardcoded values. Consider parameterizing the angle or using a constant.
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
sim_size = (10, 10, 10) | ||
# sim_size = (4, 3, 3) |
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.
style: Remove commented sim_size definition.
sim_size = (10, 10, 10) | |
# sim_size = (4, 3, 3) | |
sim_size = (10, 10, 10) |
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
grid_spec=td.GridSpec.auto(wavelength=1.0, min_steps_per_wvl=10), | ||
# grid_spec=td.GridSpec.uniform(dl=0.04), |
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.
style: Remove commented grid_spec alternatives.
grid_spec=td.GridSpec.auto(wavelength=1.0, min_steps_per_wvl=10), | |
# grid_spec=td.GridSpec.uniform(dl=0.04), | |
grid_spec=td.GridSpec.auto(wavelength=1.0, min_steps_per_wvl=10), |
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
run_time=1e-12, | ||
symmetry=(0, 0, -1), | ||
sources=[src], | ||
# medium=td.Medium(permittivity=4.5), |
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.
style: Remove commented medium parameter.
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
# simulation = td.Simulation.from_file("/home/momchil/flexcompute/test_fdtd/lucas/FDTD_Setup_P1@0_v1.json") | ||
# print(simulation.grid.num_cells) | ||
# freq0 = simulation.sources[0].source_time.freq0 | ||
# plane = td.Box(center=simulation.monitors[1].center, size=simulation.monitors[1].size) |
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.
style: Remove commented debugging code with hardcoded file paths.
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
import matplotlib.pyplot as plt | ||
|
||
fig, ax = plt.subplots(1, 3) | ||
simulation.plot(x=0, ax=ax[0]) | ||
simulation.plot(y=0, ax=ax[1]) | ||
simulation.plot(z=0, ax=ax[2]) | ||
plt.show() | ||
|
||
# Plot the mode_index = 0 mode for both | ||
_, ax = plt.subplots(1, 2) | ||
ms.plot_field("E", mode_index=0, ax=ax[0], robust=False) | ||
ms_angle.plot_field("E", mode_index=0, ax=ax[1], robust=False) | ||
plt.show() |
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.
style: Remove matplotlib plotting and plt.show()
calls. Tests should not display interactive plots or require user interaction.
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
print(modes_zero.n_complex.values) | ||
print(modes_angle.n_complex.values) |
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.
style: Remove print statements used for debugging.
Context Used: Rule - Remove temporary debugging code (print() calls), commented-out code, and other workarounds before finalizing a pull request. (link)
34938d1
to
1f5ce51
Compare
direction, | ||
dls, | ||
Nxy=None, | ||
dmin_pmc=None, |
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.
This diff is mostly because of a bit of reorganizing, but nothing substantial is changing in this file except for passing dls
, Nxy
and dmin_pmc
around.
No description provided.