Commit JT 033020

- modified all spin pairs (match nve)
- correct doc min_modify
- correct code max norm (square values)
- added draft nvt validation
This commit is contained in:
julient31
2020-03-30 08:09:11 -06:00
parent a739b8c6b7
commit 51e3f9dcda
28 changed files with 30374 additions and 74 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
# bcc iron 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 bcc 2.8665
region box block 0.0 3.0 0.0 3.0 0.0 3.0
create_box 1 box
create_atoms 1 box
# setting mass, mag. moments, and interactions for bcc iron
mass 1 55.845
set group all spin/random 31 2.2
velocity all create 100 4928459 rot yes dist gaussian
pair_style hybrid/overlay eam/alloy spin/exchange 3.5
pair_coeff * * eam/alloy Fe_Mishin2006.eam.alloy Fe
pair_coeff * * spin/exchange exchange 3.4 0.02726 0.2171 1.841
neighbor 0.1 bin
neigh_modify every 10 check yes delay 20
fix 1 all precession/spin zeeman 0.0 0.0 0.0 1.0
fix 2 all langevin/spin 0.0 0.00 21
fix 3 all nve/spin lattice moving
timestep 0.0001
# compute and output options
compute out_mag all spin
compute out_pe all pe
compute out_ke all ke
compute out_temp all temp
variable emag equal c_out_mag[5]
variable tmag equal c_out_mag[6]
thermo_style custom step time v_tmag temp v_emag ke pe etotal
thermo 200
run 100000

View File

@ -0,0 +1,46 @@
#!/usr/bin/env python3
import numpy as np, pylab, tkinter
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from decimal import *
import sys, string, os
argv = sys.argv
if len(argv) != 3:
print("Syntax: ./plot_precession.py res_lammps.dat")
sys.exit()
dirname = os.path.join(os.getcwd(), "Feb_07")
lammps_file = sys.argv[1]
llg_file = sys.argv[2]
t,tmag,temp,e_mag,e_kin,e_pot,e_tot = np.loadtxt(lammps_file,skiprows=0, usecols=(1,2,3,4,5,6,7),unpack=True)
fig = plt.figure(figsize=(8,8))
ax1 = plt.subplot(3,1,1)
ax2 = plt.subplot(3,1,2)
ax3 = plt.subplot(3,1,3)
ax1.plot(t, e_tot, 'k-', label='Total energy')
ax1.plot(t, e_pot, 'r-', label='Potential energy')
ax1.set_ylabel("E (eV)")
ax1.legend(loc=3)
ax2.plot(t, e_kin, 'b-', label='Kinetic energy')
ax2.plot(t, e_mag, 'g-', label='Magnetic energy')
ax2.set_ylabel("E (eV)")
ax2.legend(loc=3)
ax3.plot(t, temp, 'b--', label='Latt. temperature')
ax3.plot(t, tmag, 'r--', label='Spin temperature')
ax3.set_ylabel("T (K)")
ax3.legend(loc=3)
plt.xlabel('Time (in ps)')
plt.legend()
plt.show()
fig.savefig(os.path.join(os.getcwd(), "nve_spin_lattice.pdf"), bbox_inches="tight")
plt.close(fig)

View File

@ -0,0 +1,16 @@
#!/bin/bash
# clean old res
rm res_*.dat
# compute Lammps
./../../../../src/lmp_serial \
-in in.spin.iron-nve
in="$(grep -n Step log.lammps | awk -F ':' '{print $1}')"
en="$(grep -n Loop log.lammps | awk -F ':' '{print $1}')"
in="$(echo "$in+1" | bc -l)"
en="$(echo "$en-$in" | bc -l)"
tail -n +$in log.lammps | head -n $en > res_lammps.dat
# plot results
python3 -m plot_nve.py res_lammps.dat res_llg.dat

View File

@ -0,0 +1,39 @@
#LAMMPS in.run
units metal
atom_style spin
atom_modify map array
boundary f f f
read_data two_spins.data
pair_style spin/exchange 3.1
pair_coeff * * exchange 3.1 11.254 0.0 1.0
group bead type 1
variable H equal 0.0
variable Kan equal 0.0
variable Temperature equal 0.0
variable RUN equal 30000
fix 1 all nve/spin lattice no
fix 2 all precession/spin zeeman ${H} 0.0 0.0 1.0 anisotropy ${Kan} 0.0 0.0 1.0
fix_modify 2 energy yes
fix 3 all langevin/spin ${Temperature} 0.01 12345
compute out_mag all spin
compute out_pe all pe
variable magx equal c_out_mag[1]
variable magy equal c_out_mag[2]
variable magz equal c_out_mag[3]
variable magnorm equal c_out_mag[4]
variable emag equal c_out_mag[5]
thermo_style custom step time v_magx v_magy v_magz v_emag pe etotal
thermo 10
timestep 0.0001
run ${RUN}