Skip to content

Commit 9dfd8d2

Browse files
nebm fs: implementing path refine method
1 parent d6406e1 commit 9dfd8d2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

fidimag/common/chain_method_integrators.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .integrators import BaseIntegrator
44
from .integrators import euler_step, runge_kutta_step
55
from itertools import cycle
6+
import scipy.interpolate as si
67

78
import fidimag.extensions.nebm_clib as nebm_clib
89

@@ -307,6 +308,19 @@ def run_for(self, n_steps):
307308
self.eta = self.eta * self.dEta
308309
resetCount = 0
309310

311+
# Taken from the string method class
312+
def refine_path(self, distances):
313+
"""
314+
"""
315+
new_dist = np.linspace(distances[0], distances[-1], distances.shape[0])
316+
# Restructure the string by interpolating every spin component
317+
# print(self.integrator.y[self.n_dofs_image:self.n_dofs_image + 10])
318+
bandrs = self.band.reshape(self.n_images, self.n_dofs_image)
319+
for i in range(self.n_dofs_image):
320+
321+
cs = si.CubicSpline(distances, bandrs[:, i])
322+
bandrs[:, i] = cs(new_dist)
323+
310324
def set_options(self):
311325
pass
312326

0 commit comments

Comments
 (0)