|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Basic utilities and shared state for lattice relaxation algorithms. More...
Functions | |
| void | setup_gradient (const UnitCell &ucell, double *lat, double *grad, ModuleBase::matrix &stress) |
| Setup gradient from stress tensor. | |
| void | change_lattice (UnitCell &ucell, double *move, double *lat, const bool fixed_ibrav) |
| Update lattice vectors according to displacement. | |
| bool | check_converged (const UnitCell &ucell, ModuleBase::matrix &stress, double *grad, std::ofstream &ofs, const double &stress_thr) |
| Check convergence based on stress threshold. | |
| void | terminate (const bool converged, std::ofstream &ofs) |
| Terminate lattice optimization and output results. | |
| void | setup_etot (const double &energy_in, std::vector< double > &etot_info) |
| Update energy values and compute energy difference. | |
Variables | |
| int | update_iter = 0 |
| Number of successfully updated iterations. | |
| int | stress_step = 0 |
| Index of stress optimization step. | |
| double | lattice_change_ini = 0.01 |
| Initial trust radius for lattice change (default: 0.01). | |
| std::string | fixed_axes = "None" |
| Fixed axes constraint ("None", "shape", "volume", or specific axes). | |
Basic utilities and shared state for lattice relaxation algorithms.
This namespace provides common functions and parameters used by lattice optimization methods. It shares core state variables through references to Relax_Data, ensuring consistent data across different optimization algorithms.
| void Lattice_Change_Basic::change_lattice | ( | UnitCell & | ucell, |
| double * | move, | ||
| double * | lat, | ||
| const bool | fixed_ibrav ) |
Update lattice vectors according to displacement.
| ucell | Unit cell to update |
| move | Displacement vector for lattice change (9 elements) |
| lat | Current lattice vectors (9 elements) |
| bool Lattice_Change_Basic::check_converged | ( | const UnitCell & | ucell, |
| ModuleBase::matrix & | stress, | ||
| double * | grad, | ||
| std::ofstream & | ofs, | ||
| const double & | stress_thr ) |
Check convergence based on stress threshold.
| ucell | Unit cell containing lattice constraints |
| stress | Stress tensor (3x3 matrix) |
| grad | Gradient array (9 elements) |
| ofs | Output stream for logging |
| void Lattice_Change_Basic::setup_etot | ( | const double & | energy_in, |
| std::vector< double > & | etot_info ) |
Update energy values and compute energy difference.
| energy_in | Input energy value |
| judgement | Flag for SD method (true) or BFGS (false) |
| etot_info | Vector containing [etot, etot_p] |
| void Lattice_Change_Basic::setup_gradient | ( | const UnitCell & | ucell, |
| double * | lat, | ||
| double * | grad, | ||
| ModuleBase::matrix & | stress ) |
Setup gradient from stress tensor.
| ucell | Unit cell containing lattice information |
| lat | Output lattice vector array (9 elements: e11, e12, e13, e21, e22, e23, e31, e32, e33) |
| grad | Output gradient array (9 elements) |
| stress | Stress tensor (3x3 matrix) |
| void Lattice_Change_Basic::terminate | ( | const bool | converged, |
| std::ofstream & | ofs ) |
Terminate lattice optimization and output results.
| converged | Convergence flag |
| ofs | Output stream for logging |
|
extern |
Fixed axes constraint ("None", "shape", "volume", or specific axes).
|
extern |
Initial trust radius for lattice change (default: 0.01).
|
extern |
Index of stress optimization step.
|
extern |
Number of successfully updated iterations.