diff --git a/doc/src/fix_langevin_spin.txt b/doc/src/fix_langevin_spin.txt index e4065adad5..e5dccc5e57 100644 --- a/doc/src/fix_langevin_spin.txt +++ b/doc/src/fix_langevin_spin.txt @@ -50,7 +50,7 @@ As an example: fix 1 all precession/spin zeeman 0.01 0.0 0.0 1.0 fix 2 all langevin/spin 300.0 0.01 21 -fix 3 all nve/spin lattice yes :pre +fix 3 all nve/spin lattice moving :pre is correct, but defining a force/spin command after the langevin/spin command would give an error message. diff --git a/doc/src/fix_nve_spin.txt b/doc/src/fix_nve_spin.txt index 7b382bb6ad..8e6284639b 100644 --- a/doc/src/fix_nve_spin.txt +++ b/doc/src/fix_nve_spin.txt @@ -15,22 +15,26 @@ fix ID group-ID nve/spin keyword values :pre ID, group-ID are documented in "fix"_fix.html command :ulb,l nve/spin = style name of this fix command :l keyword = {lattice} :l - {lattice} value = {no} or {yes} :pre + {lattice} value = {moving} or {frozen} + moving = integrate both spin and atomic degress of freedom + frozen = integrate spins on a fixed lattice :pre :ule [Examples:] -fix 3 all nve/spin lattice yes -fix 1 all nve/spin lattice no :pre +fix 3 all nve/spin lattice moving +fix 1 all nve/spin lattice frozen :pre [Description:] Perform a symplectic integration for the spin or spin-lattice system. The {lattice} keyword defines if the spins are integrated on a lattice -of fixed atoms (lattice = no), or if atoms are moving (lattice = yes). - -By default (lattice = yes), a spin-lattice integration is performed. +of fixed atoms (lattice = frozen), or if atoms are moving +(lattice = moving). +The first case corresponds to a spin dynamics calculation, and +the second to a spin-lattice calculation. +By default a spin-lattice integration is performed (lattice = moving). The {nve/spin} fix applies a Suzuki-Trotter decomposition to the equations of motion of the spin lattice system, following the scheme: @@ -63,7 +67,9 @@ instead of "array" is also valid. "atom_style spin"_atom_style.html, "fix nve"_fix_nve.html -[Default:] none +[Default:] + +The option default is lattice = moving. :line diff --git a/examples/SPIN/bfo/in.spin.bfo b/examples/SPIN/bfo/in.spin.bfo index e3c88b0f06..2cd9200121 100644 --- a/examples/SPIN/bfo/in.spin.bfo +++ b/examples/SPIN/bfo/in.spin.bfo @@ -32,7 +32,7 @@ neigh_modify every 10 check yes delay 20 fix 1 all precession/spin anisotropy 0.0000033 0.0 0.0 1.0 fix 2 all langevin/spin 0.0 0.1 21 -fix 3 all nve/spin lattice no +fix 3 all nve/spin lattice frozen timestep 0.0002 diff --git a/examples/SPIN/cobalt_fcc/in.spin.cobalt_fcc b/examples/SPIN/cobalt_fcc/in.spin.cobalt_fcc index ea98eeba94..9193faa798 100644 --- a/examples/SPIN/cobalt_fcc/in.spin.cobalt_fcc +++ b/examples/SPIN/cobalt_fcc/in.spin.cobalt_fcc @@ -35,7 +35,7 @@ fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/cobalt_hcp/in.spin.cobalt_hcp b/examples/SPIN/cobalt_hcp/in.spin.cobalt_hcp index 3f34838553..b9ede5f09c 100644 --- a/examples/SPIN/cobalt_hcp/in.spin.cobalt_hcp +++ b/examples/SPIN/cobalt_hcp/in.spin.cobalt_hcp @@ -37,7 +37,7 @@ neigh_modify every 10 check yes delay 20 fix 1 all precession/spin anisotropy 0.01 0.0 0.0 1.0 #fix 2 all langevin/spin 0.0 0.0 21 fix 2 all langevin/spin 0.0 0.1 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 diff --git a/examples/SPIN/dipole_spin/in.spin.iron_dipole_cut b/examples/SPIN/dipole_spin/in.spin.iron_dipole_cut index a409fe0563..34f7fea0d3 100644 --- a/examples/SPIN/dipole_spin/in.spin.iron_dipole_cut +++ b/examples/SPIN/dipole_spin/in.spin.iron_dipole_cut @@ -33,7 +33,7 @@ fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/dipole_spin/in.spin.iron_dipole_ewald b/examples/SPIN/dipole_spin/in.spin.iron_dipole_ewald index 58b44b55fe..f694bc5ddc 100644 --- a/examples/SPIN/dipole_spin/in.spin.iron_dipole_ewald +++ b/examples/SPIN/dipole_spin/in.spin.iron_dipole_ewald @@ -35,7 +35,7 @@ fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/dipole_spin/in.spin.iron_dipole_pppm b/examples/SPIN/dipole_spin/in.spin.iron_dipole_pppm index 28d7e4a4bc..4175038ade 100644 --- a/examples/SPIN/dipole_spin/in.spin.iron_dipole_pppm +++ b/examples/SPIN/dipole_spin/in.spin.iron_dipole_pppm @@ -36,7 +36,7 @@ fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/iron/in.spin.iron b/examples/SPIN/iron/in.spin.iron index bb1b0e1b4d..3468575493 100644 --- a/examples/SPIN/iron/in.spin.iron +++ b/examples/SPIN/iron/in.spin.iron @@ -33,7 +33,7 @@ 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.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/iron/in.spin.iron_cubic b/examples/SPIN/iron/in.spin.iron_cubic index d4703a2959..859d9df0fa 100644 --- a/examples/SPIN/iron/in.spin.iron_cubic +++ b/examples/SPIN/iron/in.spin.iron_cubic @@ -31,7 +31,7 @@ fix 1 all precession/spin cubic 0.001 0.0005 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1 fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/nickel/in.spin.nickel b/examples/SPIN/nickel/in.spin.nickel index 0ed2fac410..caa1c940ae 100644 --- a/examples/SPIN/nickel/in.spin.nickel +++ b/examples/SPIN/nickel/in.spin.nickel @@ -33,7 +33,7 @@ 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.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/nickel/in.spin.nickel_cubic b/examples/SPIN/nickel/in.spin.nickel_cubic index 3c97b284ae..76ea23689a 100644 --- a/examples/SPIN/nickel/in.spin.nickel_cubic +++ b/examples/SPIN/nickel/in.spin.nickel_cubic @@ -35,7 +35,7 @@ fix 1 all precession/spin cubic -0.0001 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1. fix_modify 1 energy yes fix 2 all langevin/spin 0.0 0.0 21 -fix 3 all nve/spin lattice yes +fix 3 all nve/spin lattice moving timestep 0.0001 # compute and output options diff --git a/examples/SPIN/read_restart/in.spin.read_data b/examples/SPIN/read_restart/in.spin.read_data index a450421699..e788ecf67e 100644 --- a/examples/SPIN/read_restart/in.spin.read_data +++ b/examples/SPIN/read_restart/in.spin.read_data @@ -20,7 +20,7 @@ neigh_modify every 1 check no delay 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 +fix 3 all nve/spin lattice moving timestep 0.0001 # define outputs and computes diff --git a/examples/SPIN/read_restart/in.spin.restart b/examples/SPIN/read_restart/in.spin.restart index 39157fdac4..ccce25b254 100644 --- a/examples/SPIN/read_restart/in.spin.restart +++ b/examples/SPIN/read_restart/in.spin.restart @@ -24,7 +24,7 @@ neigh_modify every 1 check no delay 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 +fix 3 all nve/spin lattice moving timestep 0.0001 # define outputs diff --git a/examples/SPIN/read_restart/in.spin.write_restart b/examples/SPIN/read_restart/in.spin.write_restart index 42f07fd316..c127101093 100644 --- a/examples/SPIN/read_restart/in.spin.write_restart +++ b/examples/SPIN/read_restart/in.spin.write_restart @@ -29,7 +29,7 @@ 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 100.0 0.01 21 -fix 3 all nve/spin lattice no +fix 3 all nve/spin lattice frozen timestep 0.0001 # compute and output options diff --git a/examples/SPIN/setforce_spin/in.spinmin.setforce b/examples/SPIN/setforce_spin/in.spinmin.setforce index 10d4df66ed..822768e0ef 100644 --- a/examples/SPIN/setforce_spin/in.spinmin.setforce +++ b/examples/SPIN/setforce_spin/in.spinmin.setforce @@ -35,7 +35,7 @@ fix 1 all precession/spin zeeman 0.0 0.0 0.0 1.0 anisotropy 5e-05 0.0 0.0 1.0 fix_modify 1 energy yes fix 2 fixed_spin setforce/spin 0.0 0.0 0.0 fix 3 all langevin/spin 0.0 0.1 21 -fix 4 all nve/spin lattice no +fix 4 all nve/spin lattice frozen timestep 0.0001 diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index b1b466b5a4..9b4f1916ae 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -91,12 +91,17 @@ FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : // defining lattice_flag + // changing the lattice option, from (yes,no) -> (moving,frozen) + // for now, (yes,no) still works (to avoid user's confusions). + int iarg = 3; while (iarg < narg) { if (strcmp(arg[iarg],"lattice") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix/NVE/spin command"); if (strcmp(arg[iarg+1],"no") == 0) lattice_flag = 0; + else if (strcmp(arg[iarg+1],"frozen") == 0) lattice_flag = 0; else if (strcmp(arg[iarg+1],"yes") == 0) lattice_flag = 1; + else if (strcmp(arg[iarg+1],"moving") == 0) lattice_flag = 1; else error->all(FLERR,"Illegal fix/NVE/spin command"); iarg += 2; } else error->all(FLERR,"Illegal fix/NVE/spin command"); diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index cc28018ad0..7bc2b846a1 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -504,7 +504,7 @@ void PairSpinExchange::read_restart(FILE *fp) fread(&J1_mag[i][j],sizeof(double),1,fp); fread(&J1_mech[i][j],sizeof(double),1,fp); fread(&J2[i][j],sizeof(double),1,fp); - fread(&J2[i][j],sizeof(double),1,fp); + fread(&J3[i][j],sizeof(double),1,fp); fread(&cut_spin_exchange[i][j],sizeof(double),1,fp); } MPI_Bcast(&J1_mag[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 355ba20f39..017682593a 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -643,10 +643,8 @@ void PairSpinNeel::allocate() memory->create(q3,n+1,n+1,"pair/spin/soc/neel:q3"); memory->create(cutsq,n+1,n+1,"pair/spin/soc/neel:cutsq"); - } - /* ---------------------------------------------------------------------- proc 0 writes to restart file ------------------------------------------------------------------------- */ @@ -694,11 +692,11 @@ void PairSpinNeel::read_restart(FILE *fp) fread(&g1[i][j],sizeof(double),1,fp); fread(&g1_mech[i][j],sizeof(double),1,fp); fread(&g2[i][j],sizeof(double),1,fp); - fread(&g2[i][j],sizeof(double),1,fp); + fread(&g3[i][j],sizeof(double),1,fp); fread(&q1[i][j],sizeof(double),1,fp); fread(&q1_mech[i][j],sizeof(double),1,fp); fread(&q2[i][j],sizeof(double),1,fp); - fread(&q2[i][j],sizeof(double),1,fp); + fread(&q3[i][j],sizeof(double),1,fp); fread(&cut_spin_neel[i][j],sizeof(double),1,fp); } MPI_Bcast(&g1[i][j],1,MPI_DOUBLE,0,world);