mirror of https://github.com/lammps/lammps.git
Commit4 JT 032519
- corrected documentation (errors in min_spin.txt and min_modify.txt) - changed the code accordingly
This commit is contained in:
parent
30be5e94d9
commit
81a4d293db
|
@ -175,6 +175,7 @@ mass.html
|
|||
message.html
|
||||
min_modify.html
|
||||
min_style.html
|
||||
min_spin.html
|
||||
minimize.html
|
||||
molecule.html
|
||||
neb.html
|
||||
|
|
|
@ -13,14 +13,14 @@ min_modify command :h3
|
|||
min_modify keyword values ... :pre
|
||||
|
||||
one or more keyword/value pairs may be listed :ulb,l
|
||||
keyword = {dmax} or {line} or {alpha_damp} or {discret_factor}
|
||||
keyword = {dmax} or {line} or {alpha_damp} or {discrete_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
|
||||
{alpha_damp} value = damping
|
||||
damping = fictitious Gilbert damping for spin minimization (adim)
|
||||
{discret_factor} value = factor
|
||||
{discrete_factor} value = factor
|
||||
factor = discretization factor for adaptive spin timestep (adim) :pre
|
||||
:ule
|
||||
|
||||
|
@ -69,16 +69,16 @@ 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
|
||||
Keywords {alpha_damp} and {discrete_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
|
||||
Keyword {discrete_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.
|
||||
Default values are {alpha_damp} = 1.0 and {discrete_factor} = 10.0.
|
||||
|
||||
[Restrictions:] none
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
:link(lws,http://lammps.sandia.gov)
|
||||
:link(ld,Manual.html)
|
||||
:link(lc,Commands_all.html)
|
||||
|
||||
:line
|
||||
|
||||
min_style spin command :h3
|
||||
|
@ -14,8 +13,7 @@ min_style spin :pre
|
|||
|
||||
[Examples:]
|
||||
|
||||
min_style spin
|
||||
min_modify alpha_damp 1.0 discret_factor 10.0 :pre
|
||||
min_style spin :pre
|
||||
|
||||
[Description:]
|
||||
|
||||
|
@ -33,19 +31,19 @@ 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
|
||||
adaptive timestep. The value of this timestep is defined
|
||||
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
|
||||
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
|
||||
Kappa defines a discretization factor {discrete_factor} for the
|
||||
definition of this timestep.
|
||||
{discret_factor} can be defined with the "min_modify"_min_modify.html
|
||||
{discrete_factor} can be defined with the "min_modify"_min_modify.html
|
||||
command.
|
||||
|
||||
NOTE: The {spin} style replaces the force tolerance by a torque
|
||||
|
@ -54,7 +52,7 @@ tolerance. See "minimize"_minimize.html for more explanation.
|
|||
[Restrictions:]
|
||||
|
||||
This minimization procedure is only applied to spin degrees of
|
||||
fredom for a frozen lattice configuration.
|
||||
freedom for a frozen lattice configuration.
|
||||
|
||||
[Related commands:]
|
||||
|
||||
|
@ -63,5 +61,5 @@ fredom for a frozen lattice configuration.
|
|||
|
||||
[Default:]
|
||||
|
||||
The option defaults are alpha_damp = 1.0 and discret_factor =
|
||||
The option defaults are {alpha_damp} = 1.0 and {discrete_factor} =
|
||||
10.0.
|
||||
|
|
|
@ -51,5 +51,5 @@ 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
|
||||
min_modify alpha_damp 1.0 discrete_factor 10.0
|
||||
minimize 1.0e-10 0.0 1000 100
|
||||
|
|
|
@ -51,5 +51,5 @@ compute outsp all property/atom spx spy spz sp fmx fmy fmz
|
|||
dump 1 all custom 100 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
|
||||
min_modify alpha_damp 1.0 discrete_factor 10.0
|
||||
minimize 1.0e-10 1.0e-10 100000 1000
|
||||
|
|
|
@ -51,7 +51,7 @@ MinSpin::MinSpin(LAMMPS *lmp) : Min(lmp) {}
|
|||
void MinSpin::init()
|
||||
{
|
||||
alpha_damp = 1.0;
|
||||
discret_factor = 10.0;
|
||||
discrete_factor = 10.0;
|
||||
|
||||
Min::init();
|
||||
|
||||
|
@ -84,9 +84,9 @@ int MinSpin::modify_param(int narg, char **arg)
|
|||
alpha_damp = force->numeric(FLERR,arg[1]);
|
||||
return 2;
|
||||
}
|
||||
if (strcmp(arg[0],"discret_factor") == 0) {
|
||||
if (strcmp(arg[0],"discrete_factor") == 0) {
|
||||
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
|
||||
discret_factor = force->numeric(FLERR,arg[1]);
|
||||
discrete_factor = force->numeric(FLERR,arg[1]);
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
|
@ -229,9 +229,9 @@ double MinSpin::evaluate_dt()
|
|||
error->all(FLERR,"Incorrect fmaxsqall calculation");
|
||||
|
||||
// define max timestep by dividing by the
|
||||
// inverse of max frequency by discret_factor
|
||||
// inverse of max frequency by discrete_factor
|
||||
|
||||
dtmax = MY_2PI/(discret_factor*sqrt(fmaxsqall));
|
||||
dtmax = MY_2PI/(discrete_factor*sqrt(fmaxsqall));
|
||||
|
||||
return dtmax;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class MinSpin : public Min {
|
|||
double dts;
|
||||
|
||||
double alpha_damp; // damping for spin minimization
|
||||
double discret_factor; // factor for spin timestep evaluation
|
||||
double discrete_factor; // factor for spin timestep evaluation
|
||||
|
||||
double *spvec; // variables for atomic dof, as 1d vector
|
||||
double *fmvec; // variables for atomic dof, as 1d vector
|
||||
|
|
Loading…
Reference in New Issue