Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when number of (solve steps % options.save_every) == 0 #83

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tdgl/solver/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,6 @@ def save_step(step):
self.logger.warning(msg.format("Cancelling"))
cancelled = True
break
if save:
if save and (i % self.options.save_every):
save_step(i)
return not cancelled
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
2 changes: 1 addition & 1 deletion tdgl/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version_info__ = (0, 8, 2)
__version_info__ = (0, 8, 3)
__version__ = ".".join(map(str, __version_info__))


Expand Down
Loading