ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
lattice_change_cg.h
Go to the documentation of this file.
1#ifndef LATTICE_CHANGE_CG_H
2#define LATTICE_CHANGE_CG_H
3
4#include "cg_base.h"
5#include "relax_criteria.h"
8
9#include <fstream>
10#include <vector>
11
13{
14
15 public:
17 ~Lattice_Change_CG() = default;
18
19 void allocate(void);
20 bool start(
21 UnitCell &ucell,
22 const ModuleBase::matrix &stress_in,
23 const double &etot,
24 std::ofstream &ofs,
25 std::vector<double> &etot_info,
26 const Relax_Criteria &criteria);
27
28 private:
29 // Unit tests need to inspect the saved previous-step state and to seed
30 // move0 in order to drive the trial/no-trial branches of start().
31 friend class LatticeChangeCGTest;
32
33 std::vector<double> lat0;
34 std::vector<double> grad0;
35 std::vector<double> cg_grad0;
36 std::vector<double> move0;
37 double e0 = 0.0;
38
39 bool sd = false;
40 bool trial = false;
41 int ncggrad = 0;
42 int nbrent = 0;
43 double fa = 0.0;
44 double fb = 0.0;
45 double fc = 0.0;
46 double xa = 0.0;
47 double xb = 0.0;
48 double xc = 0.0;
49 double xpt = 0.0;
50 double steplength = 0.0;
51 double fmax = 0.0;
52};
53
54#endif
Base class for conjugate gradient optimization algorithms.
Definition cg_base.h:13
friend class LatticeChangeCGTest
Definition lattice_change_cg.h:31
std::vector< double > lat0
Definition lattice_change_cg.h:33
std::vector< double > move0
Definition lattice_change_cg.h:36
double fa
Definition lattice_change_cg.h:43
int ncggrad
Definition lattice_change_cg.h:41
std::vector< double > cg_grad0
Definition lattice_change_cg.h:35
double xb
Definition lattice_change_cg.h:47
bool sd
Definition lattice_change_cg.h:39
double e0
Definition lattice_change_cg.h:37
double fmax
Definition lattice_change_cg.h:51
double xa
Definition lattice_change_cg.h:46
double steplength
Definition lattice_change_cg.h:50
~Lattice_Change_CG()=default
double fc
Definition lattice_change_cg.h:45
double xpt
Definition lattice_change_cg.h:49
double xc
Definition lattice_change_cg.h:48
int nbrent
Definition lattice_change_cg.h:42
double fb
Definition lattice_change_cg.h:44
void allocate(void)
Definition lattice_change_cg.cpp:13
Lattice_Change_CG()
Definition lattice_change_cg.cpp:11
std::vector< double > grad0
Definition lattice_change_cg.h:34
bool trial
Definition lattice_change_cg.h: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