|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Free-function helpers for the DeltaSpin lambda optimization loop. More...
Go to the source code of this file.
Namespaces | |
| namespace | spinconstrain |
Functions | |
| template<typename TK> | |
| void | spinconstrain::print_termination (const SpinConstrain< TK > &sc, std::ostream &ofs_running) |
| Print final spin and lambda values when the lambda loop terminates. | |
| template<typename TK> | |
| bool | spinconstrain::check_rms_stop (const SpinConstrain< TK > &sc, int outer_step, int i_step, double rms_error, double duration, double total_duration, std::ostream &ofs_running) |
| Check if RMS error is below convergence threshold or max steps reached. | |
| template<typename TK> | |
| void | spinconstrain::print_header (const SpinConstrain< TK > &sc, std::ostream &ofs_running) |
| Print header at start of lambda optimization loop. | |
| template<typename TK> | |
| void | spinconstrain::check_restriction (const SpinConstrain< TK > &sc, const std::vector< ModuleBase::Vector3< double > > &search, double &alpha_trial, std::ostream &ofs_running) |
| Cap step size to prevent overshooting in lambda optimization. | |
| template<typename TK> | |
| double | spinconstrain::cal_alpha_opt (const SpinConstrain< TK > &sc, std::vector< ModuleBase::Vector3< double > > spin, std::vector< ModuleBase::Vector3< double > > spin_plus, const double alpha_trial) |
| Compute optimal step size via linear interpolation. | |
| template<typename TK> | |
| bool | spinconstrain::check_gradient_decay (const SpinConstrain< TK > &sc, const std::vector< ModuleBase::Vector3< double > > &new_spin, const std::vector< ModuleBase::Vector3< double > > &spin, const std::vector< ModuleBase::Vector3< double > > &delta_lambda, const std::vector< ModuleBase::Vector3< double > > &dnu_last_step, bool print, std::ostream &ofs_running) |
| Check if the magnetic susceptibility gradient dM/dlambda has decayed below threshold. | |
| template<typename TK> | |
| void | spinconstrain::print_Mi (const SpinConstrain< TK > &sc, std::ostream &ofs_running) |
| Print atomic magnetic moments Mi in a formatted table. | |
| template<typename TK> | |
| void | spinconstrain::print_Mag_Force (const SpinConstrain< TK > &sc, std::ostream &ofs_running) |
| Print the magnetic force (-lambda) per atom in eV/uB. | |
Free-function helpers for the DeltaSpin lambda optimization loop.