Skip to content

Commit

Permalink
Updating requirements to ensure meshio and pygmsh.
Browse files Browse the repository at this point in the history
  • Loading branch information
LyceanEM committed Sep 18, 2024
1 parent 8c2d5ff commit 48d6eec
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .idea/LyceanEM-Python.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions lyceanem/electromagnetics/emfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ def field_magnitude_phase(field_data):
def extract_electric_fields(field_data):
fields = np.array(
[
field_data.point_data["Ex - Real"]
+ 1j * field_data.point_data["Ex - Imag"],
field_data.point_data["Ey - Real"]
+ 1j * field_data.point_data["Ey - Imag"],
field_data.point_data["Ez - Real"]
+ 1j * field_data.point_data["Ez - Imag"],
field_data.point_data["Ex - Real"].ravel()
+ 1j * field_data.point_data["Ex - Imag"].ravel(),
field_data.point_data["Ey - Real"].ravel()
+ 1j * field_data.point_data["Ey - Imag"].ravel(),
field_data.point_data["Ez - Real"].ravel()
+ 1j * field_data.point_data["Ez - Imag"].ravel(),
]
).transpose()

Expand Down Expand Up @@ -405,7 +405,7 @@ def Directivity(field_data):
Utotal = Utheta + Uphi
sin_factor = np.abs(
np.sin(field_data.point_data["theta (Radians)"])
) # only want positive factor
).reshape(-1,1) # only want positive factor
power_sum = np.sum(np.abs(Utheta * sin_factor)) + np.sum(np.abs(Uphi * sin_factor))
# need to dynamically account for the average contribution of each point, this is only true for a theta step of 1 degree, and phi step of 10 degrees
Uav = (power_sum * (np.radians(1.0) * np.radians(10.0))) / (4 * np.pi)
Expand Down
6 changes: 3 additions & 3 deletions lyceanem/electromagnetics/empropagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,10 @@ def lossy_propagation(point1, point2, alpha, beta):
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]
distance_loss=1.0/((1+length[0]**s)**(1/s))
G = (cmath.exp(-(alpha[0] + 1j * beta[0]) * length[0])) * distance_loss

dG = (-(alpha[0] + 1j * beta[0]) - complex64((1 / length[0]))) * G
dG = (-(alpha[0] + 1j * beta[0]) - complex64((distance_loss))) * G
loss = front * dG * projection_dot

return loss
Expand Down
2 changes: 1 addition & 1 deletion lyceanem/geometry/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import meshio
import pyvista as pv
import pygmsh
from importlib_resources import files
from importlib.resources import files
from scipy.spatial.transform import Rotation as R

from ..base_classes import antenna_structures, structures, points
Expand Down
2 changes: 1 addition & 1 deletion lyceanem/tests/reflectordata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import meshio
import scipy.io as io
from importlib_resources import files
from importlib.resources import files
import pyvista as pv

import lyceanem.geometry.geometryfunctions as GF
Expand Down

0 comments on commit 48d6eec

Please sign in to comment.