From 73b2ad0acce681b5203ffe8c67d7f8f3a906ee26 Mon Sep 17 00:00:00 2001 From: julient31 Date: Mon, 12 Oct 2020 11:38:52 -0600 Subject: [PATCH] - slight modifs of the damped exchange example --- .../validation_damped_exchange/llg_exchange.py | 18 +++++++++++++++++- .../test-spin-precession.in | 5 ++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/examples/SPIN/test_problems/validation_damped_exchange/llg_exchange.py b/examples/SPIN/test_problems/validation_damped_exchange/llg_exchange.py index dd1c543bb3..5b93ac5c2d 100755 --- a/examples/SPIN/test_problems/validation_damped_exchange/llg_exchange.py +++ b/examples/SPIN/test_problems/validation_damped_exchange/llg_exchange.py @@ -6,9 +6,17 @@ import matplotlib.pyplot as plt import mpmath as mp hbar=0.658212 # Planck's constant (eV.fs/rad) -J0=0.05 # per-neighbor exchange interaction (eV) +# J0=0.05 # per-neighbor exchange interaction (eV) + +# exchange interaction parameters +J1 = 11.254 # in eV +J2 = 0.0 # adim +J3 = 1.0 # in Ang. + +# initial spins S1 = np.array([1.0, 0.0, 0.0]) S2 = np.array([0.0, 1.0, 0.0]) + alpha=0.01 # damping coefficient pi=math.pi @@ -30,6 +38,14 @@ def rotation_matrix(axis, theta): [2 * (bc - ad), aa + cc - bb - dd, 2 * (cd + ab)], [2 * (bd + ac), 2 * (cd - ab), aa + dd - bb - cc]]) +#Definition of the Bethe-Slater function +def func_BS(x,a,b,c): + return 4*a*((x/c)**2)*(1-b*(x/c)**2)*np.exp(-(x/c)**2) + +#Definition of the derivative of the Bethe-Slater function +def func_dBS(x,a,b,c): + return 4*a*((x/c)**2)*(1-b*(x/c)**2)*np.exp(-(x/c)**2) + # calculating precession field of spin Sr def calc_rot_vector(Sr,Sf): rot = (J0/hbar)*(Sf-alpha*np.cross(Sf,Sr))/(1.0+alpha**2) diff --git a/examples/SPIN/test_problems/validation_damped_exchange/test-spin-precession.in b/examples/SPIN/test_problems/validation_damped_exchange/test-spin-precession.in index 86da20e6f9..9dfb4a98d6 100644 --- a/examples/SPIN/test_problems/validation_damped_exchange/test-spin-precession.in +++ b/examples/SPIN/test_problems/validation_damped_exchange/test-spin-precession.in @@ -21,7 +21,7 @@ pair_coeff * * exchange 3.1 11.254 0.0 1.0 variable Temperature equal 0.0 variable RUN equal 30000 -fix 1 all nve/spin lattice no +fix 1 all nve/spin lattice frozen fix 2 all langevin/spin ${Temperature} 0.01 12345 compute out_mag all spin @@ -36,6 +36,9 @@ variable emag equal c_out_mag[5] thermo_style custom step time v_magx v_magy v_magz v_emag pe etotal thermo 10 +compute outsp all property/atom spx spy spz sp fmx fmy fmz +dump 1 all custom 10 dump.data type x y z c_outsp[1] c_outsp[2] c_outsp[3] fx fy fz + timestep 0.0001 run ${RUN}