Skip to content

Commit

Permalink
remove unneccasery for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
tf17270 committed Oct 10, 2023
1 parent 8bdce51 commit 001bd74
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions lyceanem/models/frequency_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,29 +821,13 @@ def calculate_scattering(
Ex = np.zeros((num_sources, num_sinks), dtype=np.complex64)
Ey = np.zeros((num_sources, num_sinks), dtype=np.complex64)
Ez = np.zeros((num_sources, num_sinks), dtype=np.complex64)
for element in range(num_sources):
point_informationv2[0:num_sources]["ex"] = 0.0
point_informationv2[0:num_sources]["ey"] = 0.0
point_informationv2[0:num_sources]["ez"] = 0.0
point_informationv2[element]["ex"] = (
conformal_E_vectors[element, 0] #/ num_sources
)
point_informationv2[element]["ey"] = (
conformal_E_vectors[element, 1] #/ num_sources
)
point_informationv2[element]["ez"] = (
conformal_E_vectors[element, 2] #/ num_sources
)
unified_weights[0:num_sources, :] = 0.0
unified_weights[element, :] = (
conformal_E_vectors[element, :] #/ num_sources
)
scatter_map = EM.EMGPUFreqDomain(
num_sources, num_sinks, full_index, point_informationv2, wavelength
)
Ex[element, :] = np.dot(np.ones((num_sources)), scatter_map[:, :, 0])
Ey[element, :] = np.dot(np.ones((num_sources)), scatter_map[:, :, 1])
Ez[element, :] = np.dot(np.ones((num_sources)), scatter_map[:, :, 2])
scatter_map = EM.EMGPUFreqDomain(
num_sources, num_sinks, full_index, point_informationv2, wavelength
)
Ex = scatter_map[:, :, 0]
Ey = scatter_map[:, :, 1]
Ez = scatter_map[:, :, 2]


return Ex, Ey, Ez

Expand Down

0 comments on commit 001bd74

Please sign in to comment.