diff --git a/doc/src/Howto_spins.rst b/doc/src/Howto_spins.rst index 0afcc12c91..87e30a5f6f 100644 --- a/doc/src/Howto_spins.rst +++ b/doc/src/Howto_spins.rst @@ -21,8 +21,8 @@ orientations and their associated inter-atomic distances. The command :doc:`fix precession/spin ` allows to apply a constant magnetic torque on all the spins in the system. This -torque can be an external magnetic field (Zeeman interaction), or an -uniaxial magnetic anisotropy. +torque can be an external magnetic field (Zeeman interaction), and an +uniaxial or cubic magnetic anisotropy. A Langevin thermostat can be applied to those magnetic spins using :doc:`fix langevin/spin `. Typically, this thermostat diff --git a/examples/SPIN/test_problems/validation_damped_exchange/run-test-exchange.sh b/examples/SPIN/test_problems/validation_damped_exchange/run-test-exchange.sh index bd878a52de..a714e22fcf 100755 --- a/examples/SPIN/test_problems/validation_damped_exchange/run-test-exchange.sh +++ b/examples/SPIN/test_problems/validation_damped_exchange/run-test-exchange.sh @@ -3,9 +3,15 @@ # clean old res rm res_*.dat -# compute Lammps -./../../../../src/lmp_serial \ - -in test-spin-precession.in +# test standard Lammps +# ./../../../../src/lmp_serial \ +# -in test-spin-precession.in + +# test spin/kk with Kokkos Lammps +mpirun -np 1 ../../../../src/lmp_kokkos_mpi_only \ + -k on -sf kk -in test-spin-precession.in + +# extract data from Lammps run 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)" 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 9dfb4a98d6..bea5f53bf4 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 @@ -1,16 +1,22 @@ #LAMMPS in.run units metal -atom_style spin +# atom_style spin +atom_style spin/kk atom_modify map array boundary f f f +shell echo "test1" atom_modify map array lattice sc 3.0 region box block 0 2 0 1 0 1 +shell echo "test1" create_box 1 box +shell echo "test1" create_atoms 1 box +shell echo "test1" + mass 1 55.845 set atom 1 spin 2.0 1.0 0.0 0.0 set atom 2 spin 2.0 0.0 1.0 0.0 diff --git a/src/SPIN/pair_spin_exchange_biquadratic.cpp b/src/SPIN/pair_spin_exchange_biquadratic.cpp index 352949e5c3..a00d1cc8b0 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.cpp +++ b/src/SPIN/pair_spin_exchange_biquadratic.cpp @@ -393,7 +393,7 @@ void PairSpinExchangeBiquadratic::compute_exchange(int i, int j, double rsq, jtype = type[j]; r2j = rsq/J3[itype][jtype]/J3[itype][jtype]; - r2k = rsq/J3[itype][jtype]/J3[itype][jtype]; + r2k = rsq/K3[itype][jtype]/K3[itype][jtype]; Jex = 4.0*J1_mag[itype][jtype]*r2j; Jex *= (1.0-J2[itype][jtype]*r2j);