Commit 5f2f7d15 authored by julient31's avatar julient31
Browse files

Merge branch 'pppm_spin' of github.com:julient31/lammps into pppm_spin

parents 3e60ec9b fbb78e7b
Loading
Loading
Loading
Loading
+37.5 KiB
Loading image diff...
+42 −0
Original line number Diff line number Diff line
\documentclass[preview]{standalone}
\usepackage{varwidth}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath,amssymb,graphics,bm,setspace}

\begin{document}
\begin{varwidth}{50in}
  \begin{equation}
    \mathcal{H}_{\rm long}= 
    -\frac{\mu_{0} \left( \mu_B\right)^2}{4\pi} 
    \sum_{i,j,i\neq j}^{N}
    \frac{g_i g_j}{r_{ij}^3}
    \Big(3 
    \left(\bm{e}_{ij}\cdot \bm{s}_{i}\right) 
    \left(\bm{e}_{ij}\cdot \bm{s}_{j}\right) 
    -\bm{s}_i\cdot\bm{s}_j \Big)
    \nonumber
  \end{equation}
  \begin{equation}
    \bm{\omega}_i = 
    \frac{\mu_0 (\mu_B)^2}{4\pi\hbar}\sum_{j}
    \frac{g_i g_j}{r_{ij}^3}
    \, \Big(
    3\,(\bm{e}_{ij}\cdot\bm{s}_{j})\bm{e}_{ij}
    -\bm{s}_{j} \Big) \nonumber
  \end{equation}
  \begin{equation}
    \bm{F}_i =
    \frac{3\, \mu_0 (\mu_B)^2}{4\pi} \sum_j
    \frac{g_i g_j}{r_{ij}^4}
    \Big[\big( (\bm{s}_i\cdot\bm{s}_j) 
    -5(\bm{e}_{ij}\cdot\bm{s}_i)
    (\bm{e}_{ij}\cdot\bm{s}_j)\big) \bm{e}_{ij}+
    \big(
    (\bm{e}_{ij}\cdot\bm{s}_i)\bm{s}_j+
    (\bm{e}_{ij}\cdot\bm{s}_j)\bm{s}_i
    \big)
    \Big]
    \nonumber
  \end{equation}
\end{varwidth}
\end{document}
+21 −3
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ style = {none} or {ewald} or {ewald/disp} or {ewald/omp} or {pppm} or {pppm/cg}
    accuracy = desired relative error in forces
  {ewald/omp} value = accuracy
    accuracy = desired relative error in forces
  {ewald/dipole} value = accuracy
    accuracy = desired relative error in forces
  {ewald/dipole/spin} value = accuracy
    accuracy = desired relative error in forces
  {pppm} value = accuracy
    accuracy = desired relative error in forces
  {pppm/cg} values = accuracy (smallq)
@@ -47,6 +51,10 @@ style = {none} or {ewald} or {ewald/disp} or {ewald/omp} or {pppm} or {pppm/cg}
    accuracy = desired relative error in forces
  {pppm/stagger} value = accuracy
    accuracy = desired relative error in forces
  {pppm/dipole} value = accuracy
    accuracy = desired relative error in forces
  {pppm/dipole/spin} value = accuracy
    accuracy = desired relative error in forces
  {msm} value = accuracy
    accuracy = desired relative error in forces
  {msm/cg} value = accuracy (smallq)
@@ -105,9 +113,13 @@ The {ewald/disp} style adds a long-range dispersion sum option for
but in a more efficient manner than the {ewald} style.  The 1/r^6
capability means that Lennard-Jones or Buckingham potentials can be
used without a cutoff, i.e. they become full long-range potentials.
The {ewald/disp} style can also be used with point-dipoles
"(Toukmaji)"_#Toukmaji and is currently the only kspace solver in
LAMMPS with this capability.

The {ewald/dipole} style adds long-range standard Ewald summations 
for dipole-dipole interactions.

The {ewald/dipole/spin} style adds long-range standard Ewald 
summations for magnetic dipole-dipole interactions between
magnetic spins.

:line

@@ -128,6 +140,12 @@ The optional {smallq} argument defines the cutoff for the absolute
charge value which determines whether a particle is considered charged
or not.  Its default value is 1.0e-5.

The {pppm/dipole} style invokes a particle-particle particle-mesh solver 
for dipole-dipole interactions. 

The {pppm/dipole/spin} style invokes a particle-particle particle-mesh solver 
for magnetic dipole-dipole interactions between magnetic spins. 

The {pppm/tip4p} style is identical to the {pppm} style except that it
adds a charge at the massless 4th site in each TIP4P water molecule.
It should be used with "pair styles"_pair_style.html with a
+23 −191
Original line number Diff line number Diff line
@@ -8,15 +8,13 @@

pair_style spin/dipole/cut command :h3
pair_style spin/dipole/long command :h3
pair_style spin/dipole/long/qsymp command :h3

[Syntax:]

pair_style spin/dipole/cut cutoff 
pair_style spin/dipole/long cutoff
pair_style spin/dipole/long/qsymp cutoff :pre
pair_style spin/dipole/long cutoff :pre

cutoff = global cutoff for Magnetic dipole energy and forces
cutoff = global cutoff for magnetic dipole energy and forces
(optional) (distance units) :ulb,l
:ule

@@ -31,179 +29,31 @@ pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 scale 0.5
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre

pair_style spin/dipole/long/qsymp 10.0
pair_coeff * * 1.0 1.0
pair_coeff 2 3 1.0 1.0 2.5 4.0 :pre

[Description:]

Style {spin/dipole/cut} computes a short-range dipole-dipole
interactions between pairs of magnetic particles that each 
interaction between pairs of magnetic particles that each 
have a magnetic spin. 
The magnetic dipole-dipole interactions are computed by the
following formulas for the energy (E), force
(F), and torque (T) between particles I and J.

:c,image(Eqs/pair_dipole.jpg)

where qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles.  Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically.  These formulas are discussed in
"(Allen)"_#Allen2 and in "(Toukmaji)"_#Toukmaji2.

Also note, that in the code, all of these terms (except Elj) have a
C/epsilon prefactor, the same as the Coulombic term in the LJ +
Coulombic pair styles discussed "here"_pair_lj.html.  C is an
energy-conversion constant and epsilon is the dielectric constant
which can be set by the "dielectric"_dielectric.html command.  The
same is true of the equations that follow for other dipole pair
styles.

Style {lj/sf/dipole/sf} computes "shifted-force" interactions between
pairs of particles that each have a charge and/or a point dipole
moment. In general, a shifted-force potential is a (slightly) modified
potential containing extra terms that make both the energy and its
derivative go to zero at the cutoff distance; this removes
(cutoff-related) problems in energy conservation and any numerical
instability in the equations of motion "(Allen)"_#Allen2. Shifted-force
interactions for the Lennard-Jones (E_LJ), charge-charge (Eqq),
charge-dipole (Eqp), dipole-charge (Epq) and dipole-dipole (Epp)
potentials are computed by these formulas for the energy (E), force
(F), and torque (T) between particles I and J:

:c,image(Eqs/pair_dipole_sf.jpg)
:c,image(Eqs/pair_dipole_sf2.jpg)
following formulas for the magnetic energy, magnetic precession 
vector omega and mechanical force between particles I and J.

where epsilon and sigma are the standard LJ parameters, r_c is the
cutoff, qi and qj are the charges on the two particles, pi and pj are
the dipole moment vectors of the two particles, r is their separation
distance, and the vector r = Ri - Rj is the separation vector between
the two particles.  Note that Eqq and Fqq are simply Coulombic energy
and force, Fij = -Fji as symmetric forces, and Tij != -Tji since the
torques do not act symmetrically.  The shifted-force formula for the
Lennard-Jones potential is reported in "(Stoddard)"_#Stoddard.  The
original (non-shifted) formulas for the electrostatic potentials,
forces and torques can be found in "(Price)"_#Price2. The shifted-force
electrostatic potentials have been obtained by applying equation 5.13
of "(Allen)"_#Allen2. The formulas for the corresponding forces and
torques have been obtained by applying the 'chain rule' as in appendix
C.3 of "(Allen)"_#Allen2.
:c,image(Eqs/pair_spin_dipole.jpg)

If one cutoff is specified in the pair_style command, it is used for
both the LJ and Coulombic (q,p) terms.  If two cutoffs are specified,
they are used as cutoffs for the LJ and Coulombic (q,p) terms
respectively. This pair style also supports an optional {scale} keyword
as part of a pair_coeff statement, where the interactions can be
scaled according to this factor. This scale factor is also made available
for use with fix adapt.
where si and sj are the spin on two magnetic particles, 
r is their separation distance, and the vector e = (Ri - Rj)/|Ri - Rj| 
is the direction vector between the two particles.  

Style {lj/cut/dipole/long} computes long-range point-dipole
interactions as discussed in "(Toukmaji)"_#Toukmaji2. Dipole-dipole,
dipole-charge, and charge-charge interactions are all supported, along
with the standard 12/6 Lennard-Jones interactions, which are computed
with a cutoff.  A "kspace_style"_kspace_style.html must be defined to
use this pair style.  Currently, only "kspace_style
ewald/disp"_kspace_style.html support long-range point-dipole
interactions.

Style {lj/long/dipole/long} also computes point-dipole interactions as
discussed in "(Toukmaji)"_#Toukmaji2. Long-range dipole-dipole,
dipole-charge, and charge-charge interactions are all supported, along
with the standard 12/6 Lennard-Jones interactions.  LJ interactions
can be cutoff or long-ranged.

For style {lj/long/dipole/long}, if {flag_lj} is set to {long}, no
cutoff is used on the LJ 1/r^6 dispersion term.  The long-range
portion is calculated by using the "kspace_style
ewald_disp"_kspace_style.html command.  The specified LJ cutoff then
determines which portion of the LJ interactions are computed directly
by the pair potential versus which part is computed in reciprocal
space via the Kspace style.  If {flag_lj} is set to {cut}, the LJ
interactions are simply cutoff, as with "pair_style
lj/cut"_pair_lj.html.  If {flag_lj} is set to {off}, LJ interactions
are not computed at all.

If {flag_coul} is set to {long}, no cutoff is used on the Coulombic or
dipole interactions.  The long-range portion is calculated by using
{ewald_disp} of the "kspace_style"_kspace_style.html command. If
{flag_coul} is set to {off}, Coulombic and dipole interactions are not
computed at all.

Atoms with dipole moments should be integrated using the "fix
nve/sphere update dipole"_fix_nve_sphere.html or the "fix
nvt/sphere update dipole"_fix_nvt_sphere.html command to rotate the
dipole moments.  The {omega} option on the "fix
langevin"_fix_langevin.html command can be used to thermostat the
rotational motion.  The "compute temp/sphere"_compute_temp_sphere.html
command can be used to monitor the temperature, since it includes
rotational degrees of freedom.  The "atom_style
hybrid dipole sphere"_atom_style.html command should be used since
it defines the point dipoles and their rotational state.
The magnitude and orientation of the dipole moment for each particle
can be defined by the "set"_set.html command or in the "Atoms" section
of the data file read in by the "read_data"_read_data.html command.

The following coefficients must be defined for each pair of atoms
types via the "pair_coeff"_pair_coeff.html command as in the examples
above, or in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands, or by mixing as described below:

epsilon (energy units)
sigma (distance units)
cutoff1 (distance units)
cutoff2 (distance units) :ul

The latter 2 coefficients are optional.  If not specified, the global
LJ and Coulombic cutoffs specified in the pair_style command are used.
If only one cutoff is specified, it is used as the cutoff for both LJ
and Coulombic interactions for this type pair.  If both coefficients
are specified, they are used as the LJ and Coulombic cutoffs for this
type pair.
Style {spin/dipole/long} computes long-range magnetic dipole-dipole
interaction.
A "kspace_style"_kspace_style.html must be defined to
use this pair style.  Currently, "kspace_style 
ewald/dipole/spin"_kspace_style.html and "kspace_style
pppm/dipole/spin"_kspace_style.html support long-range magnetic 
dipole-dipole interactions.

:line

Styles with a {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed on the "Speed packages"_Speed_packages.html doc
page.  The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.

These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
USER-OMP and OPT packages, respectively.  They are only enabled if
LAMMPS was built with those packages.  See the "Build
package"_Build_package.html doc page for more info.

You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the "-suffix command-line
switch"_Run_options.html when you invoke LAMMPS, or you can use the
"suffix"_suffix.html command in your input script.

See the "Speed packages"_Speed_packages.html doc page for more
instructions on how to use the accelerated styles effectively.

:line

[Mixing, shift, table, tail correction, restart, rRESPA info]:

For atom type pairs I,J and I != J, the epsilon and sigma coefficients
and cutoff distances for this pair style can be mixed.  The default
mix value is {geometric}.  See the "pair_modify" command for details.

For atom type pairs I,J and I != J, the A, sigma, d1, and d2
coefficients and cutoff distance for this pair style can be mixed.  A
is an energy value mixed like a LJ epsilon.  D1 and d2 are distance
values and are mixed like sigma.  The default mix value is
{geometric}.  See the "pair_modify" command for details.

This pair style does not support the "pair_modify"_pair_modify.html
shift option for the energy of the Lennard-Jones portion of the pair
interaction; such energy goes to zero at the cutoff by construction.

The "pair_modify"_pair_modify.html table option is not relevant
for this pair style.

@@ -215,28 +65,20 @@ This pair style writes its information to "binary restart
files"_restart.html, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.

This pair style can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command.  It does not support the
{inner}, {middle}, {outer} keywords.

[Restrictions:]

The {lj/cut/dipole/cut}, {lj/cut/dipole/long}, and
{lj/long/dipole/long} styles are part of the DIPOLE package.  They are
only enabled if LAMMPS was built with that package.  See the "Build
package"_Build_package.html doc page for more info.

The {lj/sf/dipole/sf} style is part of the USER-MISC package.  It is
only enabled if LAMMPS was built with that package.  See the "Build
package"_Build_package.html doc page for more info.
The {spin/dipole/cut} and {spin/dipole/long} styles are part of
the SPIN package.  They are only enabled if LAMMPS was built with that 
package.  See the "Build package"_Build_package.html doc page for more 
info.

Using dipole pair styles with {electron} "units"_units.html is not
Using dipole/spin pair styles with {electron} "units"_units.html is not
currently supported.

[Related commands:]

"pair_coeff"_pair_coeff.html, "set"_set.html, "read_data"_read_data.html,
"fix nve/sphere"_fix_nve_sphere.html, "fix nvt/sphere"_fix_nvt_sphere.html
"pair_coeff"_pair_coeff.html, "kspace_style"_kspace_style.html
"fix nve/spin"_fix_nve_spin.html

[Default:] none

@@ -245,13 +87,3 @@ currently supported.
:link(Allen2)
[(Allen)] Allen and Tildesley, Computer Simulation of Liquids,
Clarendon Press, Oxford, 1987.

:link(Toukmaji2)
[(Toukmaji)] Toukmaji, Sagui, Board, and Darden, J Chem Phys, 113,
10913 (2000).

:link(Stoddard)
[(Stoddard)] Stoddard and Ford, Phys Rev A, 8, 1504 (1973).

:link(Price2)
[(Price)] Price, Stone and Alderton, Mol Phys, 52, 987 (1984).
+5 −4
Original line number Diff line number Diff line
@@ -21,12 +21,16 @@ mass 1 55.845
set 		group all spin 2.2 -1.0 0.0 0.0
velocity 	all create 100 4928459 rot yes dist gaussian

pair_style 	hybrid/overlay eam/alloy spin/exchange 3.5
pair_style 	hybrid/overlay eam/alloy spin/exchange 3.5 spin/dipole/long 8.0
pair_coeff 	* * eam/alloy Fe_Mishin2006.eam.alloy Fe
pair_coeff 	* * spin/exchange exchange 3.4 0.02726 0.2171 1.841
pair_coeff	* * spin/dipole/long 8.0

neighbor 	0.1 bin
neigh_modify 	every 10 check yes delay 20

kspace_style 	ewald/dipole/spin 1.0e-4

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.0
fix_modify 	1 energy yes
fix 		2 all langevin/spin 0.0 0.0 21
@@ -55,6 +59,3 @@ compute outsp all property/atom spx spy spz sp fmx fmy fmz
dump 		100 all custom 1 dump_iron.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]

run 		2000
# min_style 	spin
# min_modify	alpha_damp 1.0 discrete_factor 10
# minimize 	1.0e-16 1.0e-16 10000 10000
Loading