Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh committed Aug 28, 2024
1 parent 3b0f84e commit 62124dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions superscreen/solver/solve_film.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def _get_boundary_effective_field(
out[i] += (
boundary_stream[j]
/ np.linalg.norm(dr) ** 3
* np.sum(dr * boundary_normals[j])
* np.sum(dr * -boundary_normals[j])
* boundary_lengths[j]
)
return out / (4 * np.pi)
Expand All @@ -421,7 +421,7 @@ def _biot_savart_within_film(
tri_areas: np.ndarray,
tri_current_densities: np.ndarray,
) -> np.ndarray:
"""Evaluates the Biot-Savar self-field within a single film."""
"""Evaluates the Biot-Savart self-field within a single film."""
Jx = tri_current_densities[:, 0]
Jy = tri_current_densities[:, 1]
out = np.empty(len(sites), dtype=float)
Expand All @@ -432,11 +432,11 @@ def _biot_savart_within_film(
for k in range(len(tri_centroids)):
dx = sites[i, 0] - tri_centroids[k, 0]
dy = sites[i, 1] - tri_centroids[k, 1]
pref = (1 / (4 * np.pi)) * tri_areas[k] * (dx * dx + dy * dy) ** (-3 / 2)
pref = tri_areas[k] * (dx * dx + dy * dy) ** (-3 / 2)
Jx_dy += pref * Jx[k] * dy
Jy_dx += pref * Jy[k] * dx
out[i] = Jx_dy - Jy_dx
return out
return out / (4 * np.pi)


def solve_film(
Expand Down Expand Up @@ -516,12 +516,12 @@ def solve_film(
g += g_transport

boundary_sites = points[film_info.boundary_indices]
boundary_centers = 0.5 * (boundary_sites + np.roll(boundary_sites, -1, axis=0))
boundary_stream = g_transport[film_info.boundary_indices]
boundary_centers = 0.5 * (boundary_sites + np.roll(boundary_sites, -1, axis=0))
boundary_stream = 0.5 * (boundary_stream + np.roll(boundary_stream, -1, axis=0))
edge_lengths, boundary_normals = path_vectors(close_curve(boundary_sites))
Ha_transport = _get_boundary_effective_field(
points, boundary_centers, edge_lengths, -boundary_normals, boundary_stream
points, boundary_centers, edge_lengths, boundary_normals, boundary_stream
)
Ha_eff += Ha_transport

Expand Down

0 comments on commit 62124dc

Please sign in to comment.