Skip to content

Commit

Permalink
nebm fs: implementing path refine method
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcortesortuno committed Jul 31, 2024
1 parent d6406e1 commit 9dfd8d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fidimag/common/chain_method_integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .integrators import BaseIntegrator
from .integrators import euler_step, runge_kutta_step
from itertools import cycle
import scipy.interpolate as si

import fidimag.extensions.nebm_clib as nebm_clib

Expand Down Expand Up @@ -307,6 +308,19 @@ def run_for(self, n_steps):
self.eta = self.eta * self.dEta
resetCount = 0

# Taken from the string method class
def refine_path(self, distances):
"""
"""
new_dist = np.linspace(distances[0], distances[-1], distances.shape[0])
# Restructure the string by interpolating every spin component
# print(self.integrator.y[self.n_dofs_image:self.n_dofs_image + 10])
bandrs = self.band.reshape(self.n_images, self.n_dofs_image)
for i in range(self.n_dofs_image):

cs = si.CubicSpline(distances, bandrs[:, i])
bandrs[:, i] = cs(new_dist)

def set_options(self):
pass

Expand Down

0 comments on commit 9dfd8d2

Please sign in to comment.