Skip to content

Commit

Permalink
Use xp.allclose()
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh committed Jun 27, 2024
1 parent 1cbeefb commit 0562772
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tdgl/solver/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def update(
(current_A_applied - prev_A_applied) / dt,
self.normalized_directions,
)
if xp.any(xp.absolute(dA_dt) > 0):
if not xp.allclose(current_A_applied, self.current_A_applied):
# Update the link exponents only if the applied vector potential
# has actually changed.
operators.set_link_exponents(current_A_applied)
Expand All @@ -642,10 +642,10 @@ def update(
self.current_A_applied = current_A_applied

# Update the value of epsilon
epsilon = self.epsilon
if self.dynamic_epsilon:
epsilon = self.epsilon = self.update_epsilon(time)
self.epsilon = self.update_epsilon(time)

epsilon = self.epsilon
old_sq_psi = xp.absolute(psi) ** 2
screening_error = np.inf
A_induced_vals = [A_induced]
Expand Down

0 comments on commit 0562772

Please sign in to comment.