ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ions_move_bfgs.h
Go to the documentation of this file.
1#ifndef IONS_MOVE_BFGS_H
2#define IONS_MOVE_BFGS_H
3
4#include "bfgs_basic.h"
5#include "relax_criteria.h"
8
9#include <fstream>
10#include <iostream>
11#include <vector>
13{
14 public:
17
18 void allocate(void);
19 void reset(void);
20 bool start(
21 UnitCell &ucell,
22 const ModuleBase::matrix &force,
23 const double &energy_in,
24 const int istep,
25 int &update_iter,
26 std::ofstream &ofs,
27 std::vector<double> &etot_info,
28 const Relax_Criteria &criteria);
29
30 //====================================================================
31 // Test seam; see the equivalent block in BFGS_Basic. Production code
32 // must keep using the private names directly.
33 //====================================================================
34
36 bool &get_init_done() { return init_done; }
38 bool &get_first_step() { return first_step; }
39
41 const double &lat0,
42 const int istep,
43 int &update_iter,
44 std::ofstream &ofs,
45 std::vector<double> &etot_info,
46 const std::string &out_level,
47 const int test_relax_method)
48 {
49 bfgs_routine(lat0, istep, update_iter, ofs, etot_info, out_level, test_relax_method);
50 }
52 const double &lat0,
53 int &update_iter,
54 std::ofstream &ofs,
55 const int test_relax_method)
56 {
57 restart_bfgs(lat0, update_iter, ofs, test_relax_method);
58 }
59
60 private:
62 void bfgs_routine(
63 const double &lat0,
64 const int istep,
65 int &update_iter,
66 std::ofstream &ofs,
67 std::vector<double> &etot_info,
68 const std::string &out_level,
69 const int test_relax_method);
70 void restart_bfgs(
71 const double &lat0,
72 int &update_iter,
73 std::ofstream &ofs,
74 const int test_relax_method);
75 bool first_step = true; // If it is the first step of the relaxation. The pos is only generated from ucell in the
76 // first step, and in the following steps, the pos is generated from the previous step.
77};
78
79#endif
BFGS_Basic()
Definition bfgs_basic.cpp:14
void restart_bfgs(const double &lat0, int &update_iter, std::ofstream &ofs, const int test_relax_method)
Definition ions_move_bfgs.cpp:105
bool & get_init_done()
whether allocate() has already run
Definition ions_move_bfgs.h:36
void restart_bfgs_for_testing(const double &lat0, int &update_iter, std::ofstream &ofs, const int test_relax_method)
Definition ions_move_bfgs.h:51
Ions_Move_BFGS()
Definition ions_move_bfgs.cpp:16
bool init_done
Definition ions_move_bfgs.h:61
void bfgs_routine_for_testing(const double &lat0, const int istep, int &update_iter, std::ofstream &ofs, std::vector< double > &etot_info, const std::string &out_level, const int test_relax_method)
Definition ions_move_bfgs.h:40
void bfgs_routine(const double &lat0, const int istep, int &update_iter, std::ofstream &ofs, std::vector< double > &etot_info, const std::string &out_level, const int test_relax_method)
Definition ions_move_bfgs.cpp:185
void allocate(void)
Definition ions_move_bfgs.cpp:24
~Ions_Move_BFGS()
Definition ions_move_bfgs.cpp:22
bool first_step
Definition ions_move_bfgs.h:75
bool & get_first_step()
whether this is the first step of the relaxation
Definition ions_move_bfgs.h:38
void reset(void)
Definition ions_move_bfgs.cpp:40
Definition matrix.h:15
Provide the basic information about unitcell.
Definition unitcell.h:16
INPUT-derived settings that the relaxation algorithms need.
Definition relax_criteria.h:19
iclock::time_point start
Definition test_partition.cpp:22