|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Implements L-BFGS optimization algorithm for structural relaxation. More...
#include <lbfgs.h>
Public Member Functions | |
| void | allocate (const int _size) |
| Initialize L-BFGS parameters. | |
| void | relax_step (const ModuleBase::matrix _force, UnitCell &ucell, const double &etot) |
| Perform one L-BFGS relaxation step. | |
Private Member Functions | |
| void | prepare_step (std::vector< ModuleBase::Vector3< double > > &force, std::vector< ModuleBase::Vector3< double > > &pos, std::vector< std::vector< double > > &H, std::vector< double > &pos0, std::vector< double > &force0, std::vector< ModuleBase::Vector3< double > > &dpos, UnitCell &ucell, const double &etot) |
| Prepare optimization step parameters. | |
| void | is_restrain () |
| Judge if the cell is restrain. | |
| void | calculate_largest_grad (const ModuleBase::matrix &_force, UnitCell &ucell) |
| Calculate maximum gradient component. | |
| void | get_pos (UnitCell &ucell, std::vector< ModuleBase::Vector3< double > > &pos) |
| Extract atomic positions from unit cell. | |
| void | get_pos_taud (UnitCell &ucell, std::vector< ModuleBase::Vector3< double > > &pos_taud) |
| Get fractional positions from unit cell. | |
| void | update (std::vector< ModuleBase::Vector3< double > > &pos_taud, std::vector< double > &pos_taud0, std::vector< double > &force, std::vector< double > &force0, UnitCell &ucell, int iteration, int memory, std::vector< std::vector< double > > &s, std::vector< std::vector< double > > &y, std::vector< double > &rho) |
| Update L-BFGS history buffers. | |
| void | determine_step (std::vector< double > &steplength, std::vector< ModuleBase::Vector3< double > > &dpos, double &maxstep) |
| Determine optimal step lengths. | |
| void | update_pos (UnitCell &ucell) |
| Update atomic positions in unit cell. | |
Private Attributes | |
| double | alpha |
| Initial Hessian diagonal element. | |
| double | maxstep |
| Maximum allowed step length. | |
| int | size |
| Number of atoms in system. | |
| int | memory |
| Number of previous steps to store. | |
| double | H0 |
| Initial inverse Hessian approximation. | |
| int | iteration |
| Current iteration count. | |
| double | energy |
| Current system energy. | |
| double | alpha_k |
| Step size parameter. | |
| ModuleESolver::ESolver * | solver |
| Structure solver. | |
| std::vector< double > | steplength |
| std::vector< std::vector< double > > | H |
| std::vector< double > | force0 |
| std::vector< ModuleBase::Vector3< double > > | force |
| std::vector< double > | pos0 |
| std::vector< ModuleBase::Vector3< double > > | pos |
| std::vector< double > | pos_taud0 |
| std::vector< ModuleBase::Vector3< double > > | pos_taud |
| std::vector< ModuleBase::Vector3< double > > | dpos |
| std::vector< std::vector< double > > | s |
| Position difference vectors. | |
| std::vector< std::vector< double > > | y |
| Force difference vectors. | |
| std::vector< double > | rho |
| Scalar products for L-BFGS update. | |
Implements L-BFGS optimization algorithm for structural relaxation.
| void LBFGS::allocate | ( | const int | _size | ) |
Initialize L-BFGS parameters.
| _size | Number of atoms in system |
|
private |
Calculate maximum gradient component.
| _force | Current force matrix |
| ucell | Unit cell being optimized |
|
private |
Determine optimal step lengths.
| steplength | Output step lengths |
| dpos | Position displacements |
| maxstep | Maximum allowed step length |
|
private |
Extract atomic positions from unit cell.
| ucell | Unit cell to read |
| pos | Output position vector |
|
private |
Get fractional positions from unit cell.
| ucell | Unit cell to read |
| pos_taud | Output fractional positions |
|
private |
Judge if the cell is restrain.
| dpos | Position displacements to constrain |
|
private |
Prepare optimization step parameters.
| void LBFGS::relax_step | ( | const ModuleBase::matrix | _force, |
| UnitCell & | ucell, | ||
| const double & | etot | ||
| ) |
Perform one L-BFGS relaxation step.
| _force | Current force |
| ucell | Unit cell to optimize |
| etot | Current total energy |
| p_esolver | Structure solver |
|
private |
Update L-BFGS history buffers.
| pos_taud | Current fractional positions |
| pos_taud0 | Previous fractional positions |
| force | Current forces |
| force0 | Previous forces |
| ucell | Unit cell being optimized |
| iteration | Current step number |
| memory | History buffer size |
| s | Position differences buffer |
| y | Force differences buffer |
| rho | Scalar products buffer |
|
private |
Update atomic positions in unit cell.
| ucell | Unit cell to update |
|
private |
Initial Hessian diagonal element.
|
private |
Step size parameter.
|
private |
|
private |
Current system energy.
|
private |
|
private |
|
private |
|
private |
Initial inverse Hessian approximation.
|
private |
Current iteration count.
|
private |
Maximum allowed step length.
|
private |
Number of previous steps to store.
|
private |
|
private |
|
private |
|
private |
|
private |
Scalar products for L-BFGS update.
|
private |
Position difference vectors.
|
private |
Number of atoms in system.
|
private |
Structure solver.
|
private |
|
private |
Force difference vectors.