Skip to content

Commit

Permalink
Merge pull request #77 from ColdingPlasma883/master
Browse files Browse the repository at this point in the history
Visualization.py contains Y-Axis bug and Source.py frequency is not updated when _resister_grid() is called.
  • Loading branch information
flaport authored Sep 22, 2024
2 parents 56d3c43 + 5dc7157 commit a0ff3a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fdtd/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def _register_grid(self, grid: Grid, x: Number, y: Number, z: Number):
raise ValueError("a point source should be placed on a single grid cell.")
self.x, self.y, self.z = grid._handle_tuple((x, y, z))
self.period = grid._handle_time(self.period)
self.frequency = 1.0 / self.period

def update_E(self):
"""Add the source to the electric field"""
Expand Down Expand Up @@ -191,6 +192,7 @@ def _register_grid(
self.x, self.y, self.z = self._handle_slices(x, y, z)

self.period = grid._handle_time(self.period)
self.frequency = 1.0 / self.period

L = len(self.x)
vect = bd.array(
Expand Down Expand Up @@ -370,6 +372,7 @@ def _register_grid(
self.x, self.y, self.z = self._handle_slices(x, y, z)

self.period = grid._handle_time(self.period)
self.frequency = 1.0 / self.period

x = bd.arange(self.x.start, self.x.stop, 1) - (self.x.start + self.x.stop) // 2
y = bd.arange(self.y.start, self.y.stop, 1) - (self.y.start + self.y.stop) // 2
Expand Down
2 changes: 1 addition & 1 deletion fdtd/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def visualize(
_y = source.z
elif y is not None:
_x = source.z
_y = source.y
_y = source.x
elif z is not None:
_x = source.x
_y = source.y
Expand Down

0 comments on commit a0ff3a9

Please sign in to comment.