ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
relax_nsync.h
Go to the documentation of this file.
1#ifndef ION_CELL_OPTIMIZER_H
2#define ION_CELL_OPTIMIZER_H
3
4#include "ions_move_methods.h"
5#include "lat_change_method.h"
8
9#include <fstream>
10#include <vector>
11
26{
27 public:
32 void init_relax(const int &natom, const Input_para &inp);
33
51 bool relax_step(
52 const int &istep,
53 const double &energy,
54 UnitCell &ucell,
56 ModuleBase::matrix stress,
57 int &force_step,
58 int &stress_step,
59 std::ofstream &ofs_running);
60
61 private:
64 const Input_para *inp_ = nullptr;
65
67 std::vector<double> max_force_history_;
69 std::vector<double> max_stress_history_;
70
82 void print_converged_summary(const int istep, const bool with_stress, std::ofstream &ofs_running) const;
83
84 public:
86 const std::vector<double> &get_max_force_history() const { return max_force_history_; }
87 const std::vector<double> &get_max_stress_history() const { return max_stress_history_; }
88};
89
90#endif
Optimizer for ionic position relaxation and cell parameter optimization.
Definition relax_nsync.h:26
bool relax_step(const int &istep, const double &energy, UnitCell &ucell, ModuleBase::matrix force, ModuleBase::matrix stress, int &force_step, int &stress_step, std::ofstream &ofs_running)
Perform one step of relaxation (atomic and/or cell).
Definition relax_nsync.cpp:73
std::vector< double > max_force_history_
Largest force of each ionic step (eV/Angstrom), kept across cell changes.
Definition relax_nsync.h:67
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.
Definition relax_nsync.cpp:9
Ions_Move_Methods IMM
Ionic movement methods for atom relaxation.
Definition relax_nsync.h:62
std::vector< double > max_stress_history_
Largest stress of each cell step (kbar), only filled in cell-relax.
Definition relax_nsync.h:69
const std::vector< double > & get_max_force_history() const
Read-only observers of the per-step convergence history, for the final summary.
Definition relax_nsync.h:86
const Input_para * inp_
Definition relax_nsync.h:64
const std::vector< double > & get_max_stress_history() const
Definition relax_nsync.h:87
void init_relax(const int &natom, const Input_para &inp)
Initialize relaxation algorithms.
Definition relax_nsync.cpp:35
Lattice_Change_Methods LCM
Lattice change methods for cell relaxation.
Definition relax_nsync.h:63
Definition ions_move_methods.h:17
Definition lat_change_method.h:12
Definition matrix.h:15
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition input_parameter.h:13