Commit cf1d421e authored by julient31's avatar julient31
Browse files

Commit JT 082318

- corrected memory errors in pppm_dipole and pppm_dipole_spin
- created fm_long in atom_vec_spin
- fm_long added to fm in initial_integrate (in ComputeInteractionsSpin)
parent 8d79db03
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
../cobalt_fcc/Co_PurjaPun_2012.eam.alloy
 No newline at end of file
+32 −0
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")
+9 −0
Original line number Diff line number Diff line
2.25569176882662 73.37931034482759
2.3817863397548162 47.99999999999999
2.4518388791593697 34.39080459770115
2.507880910683012 31.816091954022987
2.5359019264448337 28.137931034482747
2.5779334500875657 25.011494252873554
2.6339754816112086 19.126436781609186
2.760070052539404 13.241379310344826
3.5446584938704033 6.068965517241367
+55 −0
Original line number Diff line number Diff line
# 3d Lennard-Jones melt

units		lj
#atom_style	charge
atom_style      hybrid sphere dipole
processors      * 1 1

lattice		fcc 0.8442
#region		box block 0 10 0 10 0 10
region		box block 0 5 0 5 0 5
create_box	3 box
create_atoms	1 box
mass		* 1.0

region		long block 3 6 0 10 0 10
set             region long type 2
set             group all dipole/random 98934 0.75
#set type 1:2    charge 0.0

velocity	all create 1.0 87287

#pair_style	lj/long/coul/long long off 2.5
#pair_coeff	* * 1.0 1.0 2.5
#pair_coeff      * 2 1.0 1.0 5.0
pair_style      lj/cut/dipole/long 3.0
pair_coeff      * * 1.0 1.0

#kspace_style    pppm/disp 1.0e-4
kspace_style    pppm/dipole 1.0e-4
kspace_modify   gewald/disp 0.1

neighbor	0.3 bin
neigh_modify	every 2 delay 4 check yes

group		fast type 1
group		slow type 2
fix		0 all balance 20 1.0 shift x 5 1.0 &
                weight group 2 fast 1.0 slow 2.0 weight time 0.66

fix		1 all nve

#dump		id all atom 50 dump.melt

#dump		2 all image 25 image.*.jpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	2 pad 3

#dump		3 all movie 25 movie.mpg type type &
#		axes yes 0.8 0.02 view 60 -30
#dump_modify	3 pad 3

#thermo		50
thermo		1
#run		500
run		5
+61 −0
Original line number Diff line number Diff line
# hcp cobalt in a 3d periodic box

clear 
units	 	metal
atom_style 	spin

dimension 	3
boundary 	p p p

# necessary for the serial algorithm (sametag)
atom_modify 	map array 

lattice 	hcp 2.5071
region 		box block 0.0 20.0 0.0 20.0 0.0 8.0
create_box 	1 box
create_atoms 	1 box

# setting mass, mag. moments, and interactions for hcp cobalt

mass		1 58.93

#set 		group all spin/random 31 1.72
set 		group all spin 1.72 0.0 0.0 1.0 
velocity 	all create 100 4928459 rot yes dist gaussian

pair_style 	hybrid/overlay eam/alloy spin/exchange 4.0 spin/long 8.0
#pair_style 	hybrid/overlay eam/alloy spin/exchange 4.0
pair_coeff 	* * eam/alloy ../examples/SPIN/pppm_spin/Co_PurjaPun_2012.eam.alloy Co
pair_coeff 	* * spin/exchange exchange 4.0 0.3593 1.135028015e-05 1.064568567
pair_coeff 	* * spin/long long 8.0

neighbor 	0.1 bin
neigh_modify 	every 10 check yes delay 20

kspace_style pppm/dipole/spin 1.0e-4

#fix 		1 all precession/spin zeeman 1.0 0.0 0.0 1.0
fix 		1 all precession/spin zeeman 0.0 0.0 0.0 1.0
fix 		2 all langevin/spin 0.0 0.0 21
fix 		3 all nve/spin lattice yes

timestep	0.0001


compute 	out_mag    all compute/spin
compute 	out_pe     all pe
compute 	out_ke     all ke
compute 	out_temp   all temp

variable 	magz      equal c_out_mag[3]
variable 	magnorm   equal c_out_mag[4]
variable 	emag      equal c_out_mag[5]
variable 	tmag      equal c_out_mag[6]

thermo_style    custom step time v_magnorm v_emag temp etotal
thermo          10

compute 	outsp all property/atom spx spy spz sp fmx fmy fmz
dump 		100 all custom 1 dump_cobalt_hcp.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]

run 		20000
Loading