Skip to content

Commit

Permalink
Corrected type bug in lossy_propagation function to access the alpha …
Browse files Browse the repository at this point in the history
…and beta values correctly.
  • Loading branch information
LyceanEM committed Sep 17, 2024
1 parent d909d96 commit 8c2d5ff
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/examples/03_frequency_domain_channel_modelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Frequency and Mesh Resolution
# ------------------------------
#
freq = np.asarray(16.0e9)
freq = np.asarray(26.0e9)
wavelength = 3e8 / freq
mesh_resolution = 0.5 * wavelength

Expand Down
11 changes: 8 additions & 3 deletions lyceanem/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,17 +437,22 @@ def excitation_function(
wavelength=1.0,
steering_vector=np.zeros((1, 3)),
transmit_power=1.0,
local_projection=True
):
# generate the local excitation function and then convert into the global coordinate frame.
if point_index == None:
aperture_points = self.export_all_points()
else:
aperture_points = self.export_all_points(point_index=point_index)

if local_projection:
# as export all points imposes the transformation from local to global frame on the points and associated normal vectors, no rotation is required within calculate_conformalVectors
aperture_weights = EM.calculate_conformalVectors(
desired_e_vector, aperture_points.point_data["Normals"], np.eye(3)
)
aperture_weights = EM.calculate_conformalVectors(
desired_e_vector, aperture_points.point_data["Normals"], np.eye(3)
)
else:
aperture_weights=np.repeat(desired_e_vector,aperture_points.points.shape[0],axis=0)

if phase_shift == "wavefront":
source_points = np.asarray(aperture_points.points)
phase_weights = BM.WavefrontWeights(
Expand Down
2 changes: 2 additions & 0 deletions lyceanem/electromagnetics/empropagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ def lossy_propagation(point1, point2, alpha, beta):
normal[2] = point1["nz"]
projection_dot = dot_vec(outgoing_dir, normal)
front = -(1 / (2 * cmath.pi))
s=2.5
#distance_loss=1.0/((1+length[0]**2)**)**(1/s)
G = (cmath.exp(-(alpha[0] + 1j * beta[0]) * length[0])) / length[0]

dG = (-(alpha[0] + 1j * beta[0]) - complex64((1 / length[0]))) * G
Expand Down
8 changes: 4 additions & 4 deletions lyceanem/geometry/geometryfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ def compute_normals(mesh):
point_normals = np.empty((0, 3))
for inc, cell in enumerate(mesh.cells):
if cell.type == "triangle":
for inc in range(mesh.points.shape[0]):
associated_cells = np.where(inc == cell.data)[0]
for inc_b in range(mesh.points.shape[0]):
associated_cells = np.where(inc_b == cell.data)[0]
# print(associated_cells)
point_normals = np.append(
point_normals,
Expand All @@ -311,8 +311,8 @@ def compute_normals(mesh):
axis=0,
)
if cell.type == "vertex":
for inc in range(mesh.points.shape[0]):
associated_cells = np.where(inc == cell.data)[0]
for inc_b in range(mesh.points.shape[0]):
associated_cells = np.where(inc_b == cell.data)[0]
# print(associated_cells)
point_normals = np.append(
point_normals,
Expand Down

0 comments on commit 8c2d5ff

Please sign in to comment.