ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
lattice_change_basic.h
Go to the documentation of this file.
1#ifndef LATTICE_CHANGE_BASIC_H
2#define LATTICE_CHANGE_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 int stress_step; // index of stress step
15extern double ediff; // energy difference compared to last step,
16extern double etot; // total energy of this step,
17extern double etot_p; // total energy of last step,
18
19extern double lattice_change_ini; // initial value of trust radius,
20extern std::string fixed_axes; // convert from INPUT.fixed_axes
21
22//----------------------------------------------------------------------------
23// setup the gradient, all the same for any geometry optimization methods.
24//----------------------------------------------------------------------------
25void setup_gradient(const UnitCell &ucell, double *lat, double *grad, ModuleBase::matrix &stress);
26
27//----------------------------------------------------------------------------
28// move the atom positions, considering the periodic boundary condition.
29//----------------------------------------------------------------------------
30void change_lattice(UnitCell &ucell, double *move, double *lat);
31
32//----------------------------------------------------------------------------
33// check the converged conditions ( if largest gradient is smaller than
34// the threshold)
35//----------------------------------------------------------------------------
36void check_converged(const UnitCell &ucell, ModuleBase::matrix &stress, double *grad);
37
38//----------------------------------------------------------------------------
39// terminate the geometry optimization.
40//----------------------------------------------------------------------------
41void terminate(void);
42
43//----------------------------------------------------------------------------
44// setup the total energy, keep the new energy or not.
45//----------------------------------------------------------------------------
46void setup_etot(const double &energy_in, const bool judgement);
47} // namespace Lattice_Change_Basic
48#endif
Definition matrix.h:19
Definition unitcell.h:16
Definition lattice_change_basic.h:8
void terminate(void)
Definition lattice_change_basic.cpp:248
int stress_step
Definition lattice_change_basic.cpp:13
void setup_etot(const double &energy_in, const bool judgement)
Definition lattice_change_basic.cpp:278
void check_converged(const UnitCell &ucell, ModuleBase::matrix &stress, double *grad)
Definition lattice_change_basic.cpp:164
double etot_p
Definition lattice_change_basic.cpp:17
int update_iter
Definition lattice_change_basic.cpp:11
int istep
Definition lattice_change_basic.cpp:12
double etot
Definition lattice_change_basic.cpp:16
bool converged
Definition lattice_change_basic.cpp:9
double lattice_change_ini
Definition lattice_change_basic.cpp:20
void setup_gradient(const UnitCell &ucell, double *lat, double *grad, ModuleBase::matrix &stress)
Definition lattice_change_basic.cpp:23
int dim
Definition lattice_change_basic.cpp:8
double ediff
Definition lattice_change_basic.cpp:15
std::string fixed_axes
Definition for_testing_input_conv.h:105
double largest_grad
Definition lattice_change_basic.cpp:10
void change_lattice(UnitCell &ucell, double *move, double *lat)
Definition lattice_change_basic.cpp:71