Commit a7263628 authored by julient31's avatar julient31
Browse files

Commit JT 032519

- adding all min files into new branch
- preparing branch for pull request of spin minimizer
parent 2f20581b
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -13,11 +13,15 @@ min_modify command :h3
min_modify keyword values ... :pre

one or more keyword/value pairs may be listed :ulb,l
keyword = {dmax} or {line}
keyword = {dmax} or {line} or {alpha_damp} or {discret_factor}
  {dmax} value = max
    max = maximum distance for line search to move (distance units)
  {line} value = {backtrack} or {quadratic} or {forcezero}
    backtrack,quadratic,forcezero = style of linesearch to use :pre
    backtrack,quadratic,forcezero = style of linesearch to use 
  {alpha_damp} value = damping
    damping = fictitious Gilbert damping for spin minimization (adim)
  {discret_factor} value = factor
    factor = discretization factor for adaptive spin timestep (adim) :pre
:ule

[Examples:]
@@ -65,6 +69,17 @@ difference of two large values (energy before and energy after) and
that difference may be smaller than machine epsilon even if atoms
could move in the gradient direction to reduce forces further.

Keywords {alpha_damp} and {discret_factor} only make sense when
a "min_spin"_min_spin.html command is declared. 
Keyword {alpha_damp} defines an analog of a magnetic Gilbert
damping. It defines a relaxation rate toward an equilibrium for
a given magnetic system. 
Keyword {discret_factor} defines a discretization factor for the
adaptive timestep used in the {spin} minimization. 
See "min_spin"_min_spin.html for more information about those
quantities. 
Default values are alpha_damp = 1.0 and discret_factor = 10.0.

[Restrictions:] none

[Related commands:]

doc/src/min_spin.txt

0 → 100644
+63 −0
Original line number Diff line number Diff line
"LAMMPS WWW Page"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)

:line

min_style spin command :h3

[Syntax:]

min_style spin :pre

[Examples:]

min_style 	spin
min_modify      alpha_damp 1.0 discret_factor 10.0 :pre

[Description:]

Apply a minimization algorithm to use when a "minimize"_minimize.html
command is performed.

Style {spin} defines a damped spin dynamics with an adaptive
timestep, according to:

:c,image(Eqs/min_spin_damping.jpg)

with lambda a damping coefficient (similar to a Gilbert damping)
Lambda can be defined by setting the {alpha_damp} keyword with the 
"min_modify"_min_modify.html command. 

The minimization procedure solves this equation using an
adaptive timestep. The value of this timestep is conditionned 
by the largest precession frequency that has to be solved in the 
system:

:c,image(Eqs/min_spin_timestep.jpg)

with |omega|_{max} the norm of the largest precession frequency
in the system (across all processes, and across all replicas if a
spin/neb calculation is performed). 

Kappa defines a discretization factor {discret_factor} for the 
definition of this timestep. 
{discret_factor} can be defined with the "min_modify"_min_modify.html
command.

NOTE: The {spin} style replaces the force tolerance by a torque
tolerance. See "minimize"_minimize.html for more explanation. 

[Restrictions:] none

[Related commands:]

"min_style"_min_style.html, "minimize"_minimize.html, 
"min_modify"_min_modify.html

[Default:]

The option defaults are alpha_damp = 1.0 and discret_factor =
10.0.
+6 −1
Original line number Diff line number Diff line
@@ -11,11 +11,12 @@ min_style command :h3

min_style style :pre

style = {cg} or {hftn} or {sd} or {quickmin} or {fire} :ul
style = {cg} or {hftn} or {sd} or {quickmin} or {fire} or {spin} :ul

[Examples:]

min_style cg
min_style spin
min_style fire :pre

[Description:]
@@ -61,6 +62,10 @@ the velocity non-parallel to the current force vector. The velocity
of each atom is initialized to 0.0 by this style, at the beginning of
a minimization.

Style {spin} is a damped spin dynamics with an adaptive 
timestep.
See the "min/spin"_min_spin.html doc page for more information.

Either the {quickmin} and {fire} styles are useful in the context of
nudged elastic band (NEB) calculations via the "neb"_neb.html command.

+7 −0
Original line number Diff line number Diff line
@@ -103,6 +103,13 @@ the line search fails because the step distance backtracks to 0.0
the number of outer iterations or timesteps exceeds {maxiter}
the number of total force evaluations exceeds {maxeval} :ul

NOTE: the "minimization style"_min_style.html {spin} replaces
the force tolerance {ftol} by a torque tolerance.
The minimization procedure stops if the 2-norm (length) of the 
global torque vector (defined as the cross product between the 
spins and their precession vectors omega) is less than {ftol}, 
or if any of the other criteria are met.

NOTE: You can also use the "fix halt"_fix_halt.html command to specify
a general criterion for exiting a minimization, that is a calculation
performed on the state of the current system, as defined by an
+57 −0
Original line number Diff line number Diff line
# bfo in a 3d periodic box

units 		metal
dimension 	3
boundary 	p p f
atom_style 	spin

# necessary for the serial algorithm (sametag)
atom_modify 	map array 

lattice 	sc 3.96
region 		box block 0.0 34.0 0.0 34.0 0.0 1.0
create_box 	1 box
create_atoms 	1 box

# setting mass, mag. moments, and interactions for bcc iron

mass		1 1.0
set 		group all spin/random 11 2.50

pair_style 	hybrid/overlay spin/exchange 6.0 spin/magelec 4.5 spin/dmi 4.5
pair_coeff 	* * spin/exchange exchange 6.0 -0.01575 0.0 1.965
#pair_coeff 	* * spin/magelec magelec 4.5 0.000109 1.0 1.0 1.0
pair_coeff 	* * spin/magelec magelec 4.5 0.00109 1.0 1.0 1.0
pair_coeff 	* * spin/dmi dmi 4.5 0.00005 1.0 1.0 1.0

neighbor 	0.1 bin
neigh_modify 	every 10 check yes delay 20

#fix 		1 all precession/spin zeeman 0.001 0.0 0.0 1.0 anisotropy 0.01 1.0 0.0 0.0 
fix 		1 all precession/spin anisotropy 0.0000033 0.0 0.0 1.0
fix_modify	1 energy yes
fix 		2 all langevin/spin 0.0 0.1 21
fix		3 all nve/spin lattice no 

timestep	0.0001

compute 	out_mag    all spin
compute 	out_pe     all pe
compute 	out_ke     all ke
compute 	out_temp   all temp

variable 	magz      equal c_out_mag[3]
variable 	magnorm   equal c_out_mag[4]
variable 	emag      equal c_out_mag[5]
variable 	tmag      equal c_out_mag[6]

thermo          50
thermo_style    custom step time v_magnorm v_emag v_tmag temp etotal
thermo_modify   format float %20.15g

compute 	outsp all property/atom spx spy spz sp fmx fmy fmz
dump 		1 all custom 50 dump.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3] c_outsp[4] c_outsp[5] c_outsp[6] c_outsp[7]

min_style	spin
min_modify 	alpha_damp 1.0 discret_factor 10.0
minimize        0.0 0.0 10000 1000
Loading