- improved design of test_problem
- cleaned up langevin/spin - started doc for stt and hexaniso
This commit is contained in:
@ -12,7 +12,7 @@ Syntax
|
||||
|
||||
* ID, group are documented in :doc:`fix <fix>` command
|
||||
* precession/spin = style name of this fix command
|
||||
* style = *zeeman* or *anisotropy* or *cubic*
|
||||
* style = *zeeman* or *anisotropy* or *cubic* or *stt* or *hexaniso*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@ -22,12 +22,15 @@ Syntax
|
||||
*anisotropy* args = K x y z
|
||||
K = intensity of the magnetic anisotropy (in eV)
|
||||
x y z = vector direction of the anisotropy
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*cubic* args = K1 K2c n1x n1y n1x n2x n2y n2z n3x n3y n3z
|
||||
K1 and K2c = intensity of the magnetic anisotropy (in eV)
|
||||
n1x to n3z = three direction vectors of the cubic anisotropy
|
||||
*stt* args = J x y z
|
||||
H = intensity of the spin-transfer torque field (in Tesla)
|
||||
x y z = vector direction of the field
|
||||
*hexaniso* args = K6 x y z
|
||||
H = intensity of the spin-transfer torque field (in Tesla)
|
||||
x y z = vector direction of the field
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
@ -45,3 +45,14 @@ directory.
|
||||
results (computed by the python script).
|
||||
Note: This example is a reworked version of a test problem
|
||||
provided by Martin Kroger (ETHZ).
|
||||
|
||||
- validation_nve:
|
||||
simulates a small assembly of magnetic atoms (54). The atoms are
|
||||
coupled by an exchange interaction and a mechanical potential
|
||||
(EAM here).
|
||||
This example represents an NVE run: the total energy of the
|
||||
system is preserved, whereas the spin and lattice energy
|
||||
reservoirs are exchanging energy.
|
||||
Run as: ./run-test-nve.sh
|
||||
Output: res_lammps.dat contains the data. The results are displayed
|
||||
by nve_spin_lattice.pdf.
|
||||
|
||||
25
examples/SPIN/test_problems/run_all.sh
Executable file
25
examples/SPIN/test_problems/run_all.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# test 1: damping and exchange
|
||||
cd validation_damped_exchange/
|
||||
./run-test-exchange.sh
|
||||
rm dump.data res_lammps.dat res_llg.dat
|
||||
cd ..
|
||||
|
||||
# test 2: damping and Zeeman
|
||||
cd validation_damped_precession/
|
||||
./run-test-prec.sh
|
||||
rm res_lammps.dat res_llg.dat
|
||||
cd ..
|
||||
|
||||
# test 3: langevin, damping and Zeeman
|
||||
cd validation_langevin_precession/
|
||||
./run-test-prec.sh
|
||||
rm average_spin test-prec-spin.in res_lammps.dat res_langevin.dat
|
||||
cd ..
|
||||
|
||||
# test 4: NVE run, test Etot preservation
|
||||
cd validation_nve/
|
||||
./run-test-nve.sh
|
||||
rm nve_spin_lattice.pdf res_lammps.dat
|
||||
cd ..
|
||||
@ -45,7 +45,7 @@ using namespace MathConst;
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg), id_temp(nullptr), random(nullptr)
|
||||
Fix(lmp, narg, arg), random(nullptr)
|
||||
{
|
||||
if (narg != 6) error->all(FLERR,"Illegal langevin/spin command");
|
||||
|
||||
@ -53,14 +53,6 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) :
|
||||
alpha_t = utils::numeric(FLERR,arg[4],false,lmp);
|
||||
seed = utils::inumeric(FLERR,arg[5],false,lmp);
|
||||
|
||||
dynamic_group_allow = 1;
|
||||
scalar_flag = 1;
|
||||
global_freq = 1;
|
||||
extscalar = 1;
|
||||
ecouple_flag = 1;
|
||||
nevery = 1;
|
||||
tallyflag = 1;
|
||||
|
||||
if (alpha_t < 0.0) {
|
||||
error->all(FLERR,"Illegal langevin/spin command");
|
||||
} else if (alpha_t == 0.0) {
|
||||
@ -117,10 +109,8 @@ void FixLangevinSpin::init()
|
||||
|
||||
double hbar = force->hplanck/MY_2PI; // eV/(rad.THz)
|
||||
double kb = force->boltz; // eV/K
|
||||
// D = (MY_2PI*alpha_t*gil_factor*kb*temp);
|
||||
|
||||
D = (alpha_t*gil_factor*kb*temp);
|
||||
// D = (12.0/MY_2PI)*(MY_2PI*alpha_t*gil_factor*kb*temp);
|
||||
D /= (hbar*dts);
|
||||
sigma = sqrt(2.0*D);
|
||||
}
|
||||
@ -163,7 +153,6 @@ void FixLangevinSpin::add_temperature(int i, double spi[3], double fmi[3])
|
||||
double rz = sigma*random->gaussian();
|
||||
double hbar = force->hplanck/MY_2PI;
|
||||
|
||||
energyS += 0.25*hbar*(rx*spi[0]+ry*spi[1]+rz*spi[2])*update->dt;
|
||||
// adding the random field
|
||||
|
||||
fmi[0] += rx;
|
||||
@ -187,16 +176,3 @@ void FixLangevinSpin::compute_single_langevin(int i, double spi[3], double fmi[3
|
||||
if (temp_flag) add_temperature(i,spi,fmi);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double FixLangevinSpin::compute_scalar()
|
||||
{
|
||||
if (!tallyflag) return 0.0;
|
||||
|
||||
double energy_all;
|
||||
MPI_Allreduce(&energyS,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
|
||||
return -energy_all;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -36,7 +36,6 @@ class FixLangevinSpin : public Fix {
|
||||
void add_tdamping(double *, double *); // add transverse damping
|
||||
void add_temperature(int, double *, double *);
|
||||
void compute_single_langevin(int, double *, double *);
|
||||
virtual double compute_scalar();
|
||||
|
||||
protected:
|
||||
double alpha_t; // transverse mag. damping
|
||||
@ -44,11 +43,6 @@ class FixLangevinSpin : public Fix {
|
||||
double temp; // spin bath temperature
|
||||
double D,sigma; // bath intensity var.
|
||||
double gil_factor; // gilbert's prefactor
|
||||
double energyS;
|
||||
int nlocal_max;
|
||||
int tallyflag;
|
||||
char *id_temp;
|
||||
class Compute *temperature;
|
||||
|
||||
int nlevels_respa;
|
||||
class RanMars *random;
|
||||
|
||||
Reference in New Issue
Block a user