Skip to content

Commit 3a00bbf

Browse files
author
davidcorteso
committed
Added option to reset the integrator CVODE in the atomistic code
1 parent ba2fa7b commit 3a00bbf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fidimag/atomistic/llg.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ def set_default_options(self, gamma=1, mu_s=1, alpha=0.1):
8989
self.gamma = gamma
9090
self.do_precession = True
9191

92+
def reset_integrator(self, t=0):
93+
self.vode.reset(self.spin, t)
94+
self.t = t # also reinitialise the simulation time and step
95+
self.step = 0
96+
9297
def set_tols(self, rtol=1e-8, atol=1e-10):
9398
self.vode.set_options(rtol, atol)
9499

0 commit comments

Comments
 (0)