Commit e4c6c46b authored by julient31's avatar julient31
Browse files

Commit JT 010318 (before APS)

parent 7990826c
Loading
Loading
Loading
Loading
+1 −2
Changes for examples/SPIN/bfo/in.spin.bfo: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -23,8 +23,7 @@ set group all spin/random 11 2.50

pair_style 	hybrid/overlay pair/spin/exchange 6.0 pair/spin/me 4.5
pair_coeff 	* * pair/spin/exchange exchange 6.0 -0.01575 0.0 1.965
#pair_coeff 	* * pair/spin/me me 4.5 0.000109 1.0 1.0 1.0
pair_coeff 	* * pair/spin/me me 4.5 0.00109 1.0 1.0 1.0
pair_coeff 	* * pair/spin/me me 4.5 0.000109 1.0 1.0 1.0

neighbor 	0.1 bin
neigh_modify 	every 10 check yes delay 20
+2 −4
Changes for examples/SPIN/cobalt_fcc/in.spin.cobalt_fcc: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -22,11 +22,9 @@ mass 1 58.93
set group all spin/random 31 1.72
velocity all create 100 4928459 rot yes dist gaussian

#pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0 pair/spin/soc/neel 4.0
pair_style hybrid/overlay eam/alloy pair/spin/exchange 4.0
pair_coeff * * eam/alloy ../examples/SPIN/cobalt/Co_PurjaPun_2012.eam.alloy Co
pair_coeff * * eam/alloy ../examples/SPIN/cobalt_fcc/Co_PurjaPun_2012.eam.alloy Co
pair_coeff * * pair/spin/exchange exchange 4.0 0.0446928 0.003496 1.4885 
#pair_coeff * * pair/spin/soc/neel neel 4.0 0.003330282 0.864159 2.13731 

neighbor 0.1 bin
neigh_modify every 10 check yes delay 20
@@ -55,5 +53,5 @@ thermo 10

#dump 1 all custom 50 dump_cobalt.lammpstrj type x y z spx spy spz

run 10
run 500
+6006 −0

File added.

Preview size limit exceeded, changes collapsed.

+32 −0
Changes for examples/SPIN/cobalt_hcp/exchange_fit_hcp_co/exchange_fit.py: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
#Program fitting the exchange interaction
#Model curve: Bethe-Slater function
import numpy as np, pylab, tkinter
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from decimal import *

print("Loop begin")

#Definition of the Bethe-Slater function
def func(x,a,b,c):
    return 4*a*((x/c)**2)*(1-b*(x/c)**2)*np.exp(-(x/c)**2)

#Exchange coeff table (data to fit)
rdata, Jdata = np.loadtxt('exchange_hcp_co.dat', usecols=(0,1), unpack=True)
plt.plot(rdata, Jdata, 'b-', label='data')

#Perform the fit
popt, pcov = curve_fit(func, rdata, Jdata, bounds=(0, [500.,5.,5.]))
plt.plot(rdata, func(rdata, *popt), 'r--', label='fit')

#Print the fitted params
print("Parameters: a={:.10} (in meV), b={:.10} (adim), c={:.10} (in Ang)".format(*popt))

#Ploting the result
plt.xlabel('r_ij')
pylab.xlim([0,6.5])
plt.ylabel('J_ij')
plt.legend()
plt.show()

print("Loop end")
Loading