ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ions_move_basic.h
Go to the documentation of this file.
1#ifndef IONS_MOVE_BASIC_H
2#define IONS_MOVE_BASIC_H
3
6
8{
9extern int dim; // dimension of the free variables,
10extern bool converged; // converged force or not,
11extern double largest_grad; // largest gradient among the forces,
12extern int update_iter; // number of sucesfully updated iterations,
13extern int istep; // index of ionic steps,
14extern double ediff; // energy difference compared to last step,
15extern double etot; // total energy of this step,
16extern double etot_p; // total energy of last step,
17
18extern double trust_radius; // trust radius now,
19extern double trust_radius_old; // old trust radius,
20extern double relax_bfgs_rmax; // max value of trust radius,
21extern double relax_bfgs_rmin; // min value of trust radius,
22extern double relax_bfgs_init; // initial value of trust radius,
23extern double best_xxx; // the last step length of cg , we use it as bfgs`s initial step length
24extern std::string relax_method; // relaxation method,
25extern int out_stru; // output the structure or not
26// funny way to pass this parameter, but nevertheless
27
28//----------------------------------------------------------------------------
29// setup the gradient, all the same for any geometry optimization methods.
30//----------------------------------------------------------------------------
31void setup_gradient(const UnitCell &ucell, const ModuleBase::matrix &force, double *pos, double *grad);
32
33//----------------------------------------------------------------------------
34// move the atom positions, considering the periodic boundary condition.
35//----------------------------------------------------------------------------
36void move_atoms(UnitCell &ucell, double *move, double *pos);
37
38//----------------------------------------------------------------------------
39// check the converged conditions ( if largest gradient is smaller than
40// the threshold)
41//----------------------------------------------------------------------------
42void check_converged(const UnitCell &ucell, const double *grad);
43
44//----------------------------------------------------------------------------
45// terminate the geometry optimization.
46//----------------------------------------------------------------------------
47void terminate(const UnitCell &ucell);
48
49//----------------------------------------------------------------------------
50// setup the total energy, keep the new energy or not.
51//----------------------------------------------------------------------------
52void setup_etot(const double &energy_in, const bool judgement);
53
54double dot_func(const double *a, const double *b, const int &dim);
55
56//----------------------------------------------------------------------------
57// third order interpolation scheme,
58//----------------------------------------------------------------------------
60
61} // namespace Ions_Move_Basic
62#endif
Definition matrix.h:19
Definition unitcell.h:16
Definition ions_move_basic.h:8
double etot
Definition ions_move_basic.cpp:15
double trust_radius
Definition ions_move_basic.cpp:18
void move_atoms(UnitCell &ucell, double *move, double *pos)
Definition ions_move_basic.cpp:65
bool converged
Definition ions_move_basic.cpp:9
double trust_radius_old
Definition ions_move_basic.cpp:19
std::string relax_method
Definition ions_move_basic.cpp:26
int out_stru
Definition for_testing_input_conv.h:103
void setup_etot(const double &energy_in, const bool judgement)
Definition ions_move_basic.cpp:224
double best_xxx
Definition ions_move_basic.cpp:23
double relax_bfgs_rmin
Definition for_testing_input_conv.h:101
int update_iter
Definition ions_move_basic.cpp:11
double ediff
Definition ions_move_basic.cpp:14
void setup_gradient(const UnitCell &ucell, const ModuleBase::matrix &force, double *pos, double *grad)
Definition ions_move_basic.cpp:28
double dot_func(const double *a, const double *b, const int &dim)
Definition ions_move_basic.cpp:264
double etot_p
Definition ions_move_basic.cpp:16
double relax_bfgs_rmax
Definition for_testing_input_conv.h:100
void terminate(const UnitCell &ucell)
Definition ions_move_basic.cpp:190
int dim
Definition ions_move_basic.cpp:8
double largest_grad
Definition ions_move_basic.cpp:10
void check_converged(const UnitCell &ucell, const double *grad)
Definition ions_move_basic.cpp:120
double relax_bfgs_init
Definition for_testing_input_conv.h:102
int istep
Definition ions_move_basic.cpp:12