fully integrate ABC-FIRE and make it a min_modify option
This commit is contained in:
@ -14,7 +14,7 @@ Syntax
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
keyword = *dmax* or *line* or *norm* or *alpha_damp* or *discrete_factor* or *integrator* or *tmax*
|
keyword = *dmax* or *line* or *norm* or *alpha_damp* or *discrete_factor* or *integrator* or *abcfire* or *tmax*
|
||||||
*dmax* value = max
|
*dmax* value = max
|
||||||
max = maximum distance for line search to move (distance units)
|
max = maximum distance for line search to move (distance units)
|
||||||
*line* value = *backtrack* or *quadratic* or *forcezero* or *spin_cubic* or *spin_none*
|
*line* value = *backtrack* or *quadratic* or *forcezero* or *spin_cubic* or *spin_none*
|
||||||
@ -29,6 +29,9 @@ Syntax
|
|||||||
factor = discretization factor for adaptive spin timestep (adim)
|
factor = discretization factor for adaptive spin timestep (adim)
|
||||||
*integrator* value = *eulerimplicit* or *verlet* or *leapfrog* or *eulerexplicit*
|
*integrator* value = *eulerimplicit* or *verlet* or *leapfrog* or *eulerexplicit*
|
||||||
time integration scheme for fire minimization
|
time integration scheme for fire minimization
|
||||||
|
*abcfire* value = yes or no (default no)
|
||||||
|
yes = use ABC-FIRE variant of fire minimization style
|
||||||
|
no = use default FIRE variant of fire minimization style
|
||||||
*tmax* value = factor
|
*tmax* value = factor
|
||||||
factor = maximum adaptive timestep for fire minimization (adim)
|
factor = maximum adaptive timestep for fire minimization (adim)
|
||||||
|
|
||||||
@ -149,6 +152,14 @@ reached your minimization criteria. This could happen when the system
|
|||||||
comes to be stuck in a local basin of the phase space. *vdfmax* is the
|
comes to be stuck in a local basin of the phase space. *vdfmax* is the
|
||||||
maximum number of consecutive iterations with P(t) < 0.
|
maximum number of consecutive iterations with P(t) < 0.
|
||||||
|
|
||||||
|
.. versionadded:: TBD
|
||||||
|
|
||||||
|
The *abcfire* keyword allows to activate the ABC-FIRE variant of the
|
||||||
|
*fire* minimization algorithm. ABC-FIRE introduces an additional factor
|
||||||
|
that modifies the bias and scaling of the velocities of the atoms during
|
||||||
|
the mixing step :ref:`(Echeverri Restrepo) <EcheverriRestrepo>`. This
|
||||||
|
can lead to faster convergence of the minimizer.
|
||||||
|
|
||||||
The :doc:`min_style <min_style>` *fire* is an optimized implementation of
|
The :doc:`min_style <min_style>` *fire* is an optimized implementation of
|
||||||
:doc:`min_style <min_style>` *fire/old*. It can however behave similarly
|
:doc:`min_style <min_style>` *fire/old*. It can however behave similarly
|
||||||
to the *fire/old* style by using the following set of parameters:
|
to the *fire/old* style by using the following set of parameters:
|
||||||
@ -184,3 +195,7 @@ For the *fire* style, the option defaults are integrator =
|
|||||||
eulerimplicit, tmax = 10.0, tmin = 0.02, delaystep = 20, dtgrow = 1.1,
|
eulerimplicit, tmax = 10.0, tmin = 0.02, delaystep = 20, dtgrow = 1.1,
|
||||||
dtshrink = 0.5, alpha0 = 0.25, alphashrink = 0.99, vdfmax = 2000,
|
dtshrink = 0.5, alpha0 = 0.25, alphashrink = 0.99, vdfmax = 2000,
|
||||||
halfstepback = yes and initialdelay = yes.
|
halfstepback = yes and initialdelay = yes.
|
||||||
|
|
||||||
|
.. _EcheverriRestrepo:
|
||||||
|
|
||||||
|
**(EcheverriRestrepo)** Echeverri Restrepo, Andric, Comput Mater Sci, 218, 111978 (2023).
|
||||||
|
|||||||
@ -91,12 +91,12 @@ by this style, at the beginning of a minimization.
|
|||||||
Style *fire* is a damped dynamics method described in :ref:`(Bitzek)
|
Style *fire* is a damped dynamics method described in :ref:`(Bitzek)
|
||||||
<Bitzek>`, which is similar to *quickmin* but adds a variable timestep
|
<Bitzek>`, which is similar to *quickmin* but adds a variable timestep
|
||||||
and alters the projection operation to maintain components of the
|
and alters the projection operation to maintain components of the
|
||||||
velocity non-parallel to the current force vector. The velocity of
|
velocity non-parallel to the current force vector. The velocity of each
|
||||||
each atom is initialized to 0.0 by this style, at the beginning of a
|
atom is initialized to 0.0 by this style, at the beginning of a
|
||||||
minimization. This style correspond to an optimized version described
|
minimization. This style correspond to an optimized version described
|
||||||
in :ref:`(Guenole) <Guenole>` that include different time integration
|
in :ref:`(Guenole) <Guenole>` that include different time integration
|
||||||
schemes and defaults parameters. The default parameters can be
|
schemes and default parameters. The default parameters can be modified
|
||||||
modified with the command :doc:`min_modify <min_modify>`.
|
with the command :doc:`min_modify <min_modify>`.
|
||||||
|
|
||||||
Style *fire/old* is the original implementation of *fire* in Lammps,
|
Style *fire/old* is the original implementation of *fire* in Lammps,
|
||||||
conserved for backward compatibility. The main differences regarding
|
conserved for backward compatibility. The main differences regarding
|
||||||
|
|||||||
@ -97,6 +97,7 @@ amu
|
|||||||
Amzallag
|
Amzallag
|
||||||
analytical
|
analytical
|
||||||
Anders
|
Anders
|
||||||
|
Andric
|
||||||
Andrienko
|
Andrienko
|
||||||
Andzelm
|
Andzelm
|
||||||
Ang
|
Ang
|
||||||
@ -873,6 +874,7 @@ ebook
|
|||||||
ebt
|
ebt
|
||||||
ec
|
ec
|
||||||
Ec
|
Ec
|
||||||
|
Echeverri
|
||||||
eco
|
eco
|
||||||
ecoul
|
ecoul
|
||||||
ecp
|
ecp
|
||||||
@ -3042,6 +3044,7 @@ resquared
|
|||||||
REsquared
|
REsquared
|
||||||
restartfile
|
restartfile
|
||||||
restartinfo
|
restartinfo
|
||||||
|
Restrepo
|
||||||
rethrowing
|
rethrowing
|
||||||
Revenga
|
Revenga
|
||||||
rewrap
|
rewrap
|
||||||
@ -4025,6 +4028,7 @@ Zi
|
|||||||
ziegenhain
|
ziegenhain
|
||||||
Ziegenhain
|
Ziegenhain
|
||||||
zincblende
|
zincblende
|
||||||
|
zj
|
||||||
Zj
|
Zj
|
||||||
zlim
|
zlim
|
||||||
zlo
|
zlo
|
||||||
|
|||||||
15
src/min.cpp
15
src/min.cpp
@ -72,6 +72,7 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
|
|||||||
delaystep_start_flag = 1;
|
delaystep_start_flag = 1;
|
||||||
max_vdotf_negatif = 2000;
|
max_vdotf_negatif = 2000;
|
||||||
alpha_final = 0.0;
|
alpha_final = 0.0;
|
||||||
|
abcflag = 0;
|
||||||
|
|
||||||
elist_global = elist_atom = nullptr;
|
elist_global = elist_atom = nullptr;
|
||||||
vlist_global = vlist_atom = cvlist_atom = nullptr;
|
vlist_global = vlist_atom = cvlist_atom = nullptr;
|
||||||
@ -719,13 +720,17 @@ void Min::modify_params(int narg, char **arg)
|
|||||||
else if (strcmp(arg[iarg+1],"eulerexplicit") == 0) integrator = EULEREXPLICIT;
|
else if (strcmp(arg[iarg+1],"eulerexplicit") == 0) integrator = EULEREXPLICIT;
|
||||||
else error->all(FLERR,"Illegal min_modify command");
|
else error->all(FLERR,"Illegal min_modify command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
} else if (strcmp(arg[iarg],"abcfire") == 0) {
|
||||||
|
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
||||||
|
abcflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"line") == 0) {
|
} else if (strcmp(arg[iarg],"line") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
||||||
if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = 0;
|
if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = BACKTRACK;
|
||||||
else if (strcmp(arg[iarg+1],"quadratic") == 0) linestyle = 1;
|
else if (strcmp(arg[iarg+1],"quadratic") == 0) linestyle = QUADRATIC;
|
||||||
else if (strcmp(arg[iarg+1],"forcezero") == 0) linestyle = 2;
|
else if (strcmp(arg[iarg+1],"forcezero") == 0) linestyle = FORCEZERO;
|
||||||
else if (strcmp(arg[iarg+1],"spin_cubic") == 0) linestyle = 3;
|
else if (strcmp(arg[iarg+1],"spin_cubic") == 0) linestyle = SPIN_CUBIC;
|
||||||
else if (strcmp(arg[iarg+1],"spin_none") == 0) linestyle = 4;
|
else if (strcmp(arg[iarg+1],"spin_none") == 0) linestyle = SPIN_NONE;
|
||||||
else error->all(FLERR,"Illegal min_modify command");
|
else error->all(FLERR,"Illegal min_modify command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"norm") == 0) {
|
} else if (strcmp(arg[iarg],"norm") == 0) {
|
||||||
|
|||||||
@ -100,6 +100,7 @@ class Min : protected Pointers {
|
|||||||
int halfstepback_flag; // half step backward when v.f <= 0.0
|
int halfstepback_flag; // half step backward when v.f <= 0.0
|
||||||
int delaystep_start_flag; // delay the initial dt_shrink
|
int delaystep_start_flag; // delay the initial dt_shrink
|
||||||
int max_vdotf_negatif; // maximum iteration with v.f > 0.0
|
int max_vdotf_negatif; // maximum iteration with v.f > 0.0
|
||||||
|
int abcflag; // when 1 use ABC-FIRE variant instead of FIRE, default 0
|
||||||
|
|
||||||
int nelist_global, nelist_atom; // # of PE,virial computes to check
|
int nelist_global, nelist_atom; // # of PE,virial computes to check
|
||||||
int nvlist_global, nvlist_atom, ncvlist_atom;
|
int nvlist_global, nvlist_atom, ncvlist_atom;
|
||||||
|
|||||||
@ -1,34 +0,0 @@
|
|||||||
/* -*- c++ -*- ----------------------------------------------------------
|
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
|
||||||
LAMMPS development team: developers@lammps.org
|
|
||||||
|
|
||||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
|
||||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
|
||||||
certain rights in this software. This software is distributed under
|
|
||||||
the GNU General Public License.
|
|
||||||
|
|
||||||
See the README file in the top-level LAMMPS directory.
|
|
||||||
------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
#ifdef MINIMIZE_CLASS
|
|
||||||
// clang-format off
|
|
||||||
MinimizeStyle(abcfire,MinABCFire);
|
|
||||||
// clang-format on
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifndef LMP_MIN_ABCFIRE_H
|
|
||||||
#define LMP_MIN_ABCFIRE_H
|
|
||||||
|
|
||||||
#include "min_fire.h"
|
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
|
||||||
|
|
||||||
class MinABCFire : public MinFire {
|
|
||||||
public:
|
|
||||||
MinABCFire(class LAMMPS *_lmp) : MinFire(_lmp) { abcflag = true; }
|
|
||||||
};
|
|
||||||
} // namespace LAMMPS_NS
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@ -42,10 +42,7 @@ using namespace LAMMPS_NS;
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
MinFire::MinFire(LAMMPS *lmp) : Min(lmp)
|
MinFire::MinFire(LAMMPS *lmp) : Min(lmp) {}
|
||||||
{
|
|
||||||
abcflag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -77,17 +74,17 @@ void MinFire::setup_style()
|
|||||||
// print the parameters used within fire/abcfire into the log
|
// print the parameters used within fire/abcfire into the log
|
||||||
|
|
||||||
const char *integrator_names[] = {"eulerimplicit", "verlet", "leapfrog", "eulerexplicit"};
|
const char *integrator_names[] = {"eulerimplicit", "verlet", "leapfrog", "eulerexplicit"};
|
||||||
const char *yesno[] = {"yes", "no"};
|
const char *yesno[] = {"no", "yes"};
|
||||||
|
|
||||||
if (comm->me == 0)
|
if (comm->me == 0)
|
||||||
utils::logmesg(lmp,
|
utils::logmesg(lmp,
|
||||||
" Parameters for {}:\n"
|
" Parameters for {}:\n"
|
||||||
" {:^5} {:^9} {:^6} {:^8} {:^6} {:^11} {:^4} {:^4} {:^14} {:^12} \n"
|
" {:^5} {:^9} {:^6} {:^8} {:^6} {:^11} {:^4} {:^4} {:^14} {:^12} {:^11}\n"
|
||||||
" {:^5} {:^9} {:^6} {:^8} {:^6} {:^11} {:^4} {:^4} {:^14} {:^12} \n",
|
" {:^5} {:^9} {:^6} {:^8} {:^6} {:^11} {:^4} {:^4} {:^14} {:^12} {:^11}\n",
|
||||||
update->minimize_style, "dmax", "delaystep", "dtgrow", "dtshrink", "alpha0",
|
update->minimize_style, "dmax", "delaystep", "dtgrow", "dtshrink", "alpha0",
|
||||||
"alphashrink", "tmax", "tmin", "integrator", "halfstepback", dmax, delaystep,
|
"alphashrink", "tmax", "tmin", "integrator", "halfstepback", "abcfire", dmax,
|
||||||
dtgrow, dtshrink, alpha0, alphashrink, tmax, tmin, integrator_names[integrator],
|
delaystep, dtgrow, dtshrink, alpha0, alphashrink, tmax, tmin,
|
||||||
yesno[halfstepback_flag]);
|
integrator_names[integrator], yesno[halfstepback_flag], yesno[abcflag]);
|
||||||
|
|
||||||
// initialize the velocities
|
// initialize the velocities
|
||||||
|
|
||||||
@ -140,8 +137,8 @@ int MinFire::iterate(int maxiter)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error->all(FLERR, "Unexpected integrator style {}; expected 1-{}",
|
error->all(FLERR, "Unexpected integrator style {}; expected 1-{}", integrator,
|
||||||
integrator, (int)EULEREXPLICIT);
|
(int) EULEREXPLICIT);
|
||||||
return MAXITER;
|
return MAXITER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,6 @@ class MinFire : public Min {
|
|||||||
bigint last_negative, ntimestep_start;
|
bigint last_negative, ntimestep_start;
|
||||||
int vdotf_negatif, flagv0;
|
int vdotf_negatif, flagv0;
|
||||||
template <int INTEGRATOR, bool ABCFLAG> int run_iterate(int);
|
template <int INTEGRATOR, bool ABCFLAG> int run_iterate(int);
|
||||||
|
|
||||||
protected:
|
|
||||||
bool abcflag;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|||||||
Reference in New Issue
Block a user