Optimizer for ionic position relaxation and cell parameter optimization.
More...
#include <relax_nsync.h>
|
| void | print_converged_summary (const int istep, const bool with_stress, std::ofstream &ofs_running) const |
| | Print the unified convergence summary to the running log.
|
Optimizer for ionic position relaxation and cell parameter optimization.
This class handles both atomic relaxation and cell relaxation calculations. It manages the geometry optimization process by coordinating between Ions_Move_Methods (for atomic position updates) and Lattice_Change_Methods (for cell parameter updates).
The optimization follows a sequential approach:
- First perform atomic relaxation until convergence
- Then perform cell relaxation (only in cell-relax mode)
◆ get_max_force_history()
| const std::vector< double > & IonCellOptimizer::get_max_force_history |
( |
| ) |
const |
|
inline |
Read-only observers of the per-step convergence history, for the final summary.
◆ get_max_stress_history()
| const std::vector< double > & IonCellOptimizer::get_max_stress_history |
( |
| ) |
const |
|
inline |
◆ init_relax()
| void IonCellOptimizer::init_relax |
( |
const int & | natom, |
|
|
const Input_para & | inp ) |
Initialize relaxation algorithms.
Initialize relaxation algorithms based on calculation type.
- Parameters
-
| natom | Number of atoms in the system |
Allocates memory and initializes the appropriate relaxation methods:
- Parameters
-
| natom | Number of atoms in the system |
◆ print_converged_summary()
| void IonCellOptimizer::print_converged_summary |
( |
const int | istep, |
|
|
const bool | with_stress, |
|
|
std::ofstream & | ofs_running ) const |
|
private |
Print the unified convergence summary to the running log.
Shared by every exit path that reports a converged relaxation, so the ASE interface always finds the same set of lines (issue #6546).
- Parameters
-
| istep | Total ionic steps taken. |
| with_stress | Whether the per-step stress history is printed (true for cell-relax with a movable lattice). |
| ofs_running | Output stream for the running log. |
◆ relax_step()
Perform one step of relaxation (atomic and/or cell).
This is the main interface for relaxation. Depending on the calculation type ("relax" or "cell-relax"), it will perform atomic relaxation, cell relaxation, or both in sequence.
- Parameters
-
| istep | Current total iteration step |
| energy | Total energy of the system |
| ucell | Unit cell containing atomic positions and lattice vectors |
| force | Ionic forces matrix |
| stress | Stress tensor matrix |
| force_step | Current step counter for force-based relaxation |
| stress_step | Current step counter for stress-based relaxation |
| ofs_running | Output stream for running log |
- Returns
- true if relaxation is converged, false otherwise
Main relaxation loop that coordinates atomic and cell relaxation:
- Determine calculation mode (relax vs cell-relax)
- Perform atomic relaxation if needed and atoms can move
- If in cell-relax mode and atomic relaxation converged, perform cell relaxation
Convergence behavior:
- Returns false if relaxation is still in progress
- Returns true if the current geometry has converged
- Parameters
-
| istep | Current total iteration step |
| energy | Total energy of the system |
| ucell | Unit cell containing atomic positions and lattice vectors |
| force | Ionic forces matrix (natoms x 3) |
| stress | Stress tensor matrix (3 x 3) |
| force_step | Current step counter for force-based relaxation (output) |
| stress_step | Current step counter for stress-based relaxation (output) |
- Returns
- true if relaxation is converged, false otherwise
◆ IMM
Ionic movement methods for atom relaxation.
◆ inp_
| const Input_para* IonCellOptimizer::inp_ = nullptr |
|
private |
◆ LCM
Lattice change methods for cell relaxation.
◆ max_force_history_
| std::vector<double> IonCellOptimizer::max_force_history_ |
|
private |
Largest force of each ionic step (eV/Angstrom), kept across cell changes.
◆ max_stress_history_
| std::vector<double> IonCellOptimizer::max_stress_history_ |
|
private |
Largest stress of each cell step (kbar), only filled in cell-relax.
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_relax/relax_nsync.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_relax/relax_nsync.cpp