ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ions_move_sd.h
Go to the documentation of this file.
1#ifndef IONS_MOVE_SD_H
2#define IONS_MOVE_SD_H
3
4#include "relax_criteria.h"
7
8#include <fstream>
9#include <iostream>
10#include <string>
11#include <vector>
12
13namespace ions_move_sd
14{
25void cal_tradius_sd(const int istep, std::vector<double> &etot_info, const std::string &out_level);
26} // namespace ions_move_sd
27
29{
30 public:
32 ~Ions_Move_SD() = default;
33
34 void allocate(void);
35 bool start(
36 UnitCell &ucell,
37 const ModuleBase::matrix &force,
38 const double &etot,
39 const int istep,
40 int &update_iter,
41 std::ofstream &ofs,
42 std::vector<double> &etot_info,
43 const Relax_Criteria &criteria);
44
46 double get_energy_saved() const { return energy_saved; }
48 const std::vector<double> &get_pos_saved() const { return pos_saved; }
50 const std::vector<double> &get_grad_saved() const { return grad_saved; }
51
52 private:
54 std::vector<double> pos_saved;
55 std::vector<double> grad_saved;
56};
57
58#endif
void allocate(void)
Definition ions_move_sd.cpp:13
double energy_saved
Definition ions_move_sd.h:53
const std::vector< double > & get_pos_saved() const
Atomic positions of the last accepted step (dimension: Ions_Move_Basic::dim).
Definition ions_move_sd.h:48
const std::vector< double > & get_grad_saved() const
Normalized gradient of the last accepted step (dimension: Ions_Move_Basic::dim).
Definition ions_move_sd.h:50
Ions_Move_SD()
Definition ions_move_sd.cpp:11
std::vector< double > pos_saved
Definition ions_move_sd.h:54
double get_energy_saved() const
Energy of the last accepted step.
Definition ions_move_sd.h:46
std::vector< double > grad_saved
Definition ions_move_sd.h:55
~Ions_Move_SD()=default
Definition matrix.h:15
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition ions_move_sd.h:14
void cal_tradius_sd(const int istep, std::vector< double > &etot_info, const std::string &out_level)
Update the steepest-descent trust radius from the energy history.
Definition ions_move_sd.cpp:86
INPUT-derived settings that the relaxation algorithms need.
Definition relax_criteria.h:19
iclock::time_point start
Definition test_partition.cpp:22