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