forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathesolver_fp.h
More file actions
94 lines (69 loc) · 2.77 KB
/
esolver_fp.h
File metadata and controls
94 lines (69 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef ESOLVER_FP_H
#define ESOLVER_FP_H
#include "esolver.h"
#ifndef __MPI
#include <chrono>
#endif
#include "source_basis/module_pw/pw_basis.h" // plane wave basis
#include "source_cell/module_symmetry/symmetry.h" // symmetry analysis
#include "source_estate/elecstate.h" // electronic states
#include "source_estate/module_charge/charge_extra.h" // charge extrapolation
#include "source_hamilt/module_surchem/surchem.h" // solvation model
#include "source_pw/module_pwdft/VL_in_pw.h" // local pseudopotential
#include "source_pw/module_pwdft/structure_factor.h" // structure factor
#include <fstream>
//! The First-Principles (FP) Energy Solver Class
/**
* This class represents components that needed in
* first-principles energy solver, such as the plane
* wave basis, the structure factors, and the k points.
*
*/
namespace ModuleESolver
{
class ESolver_FP: public ESolver
{
public:
ESolver_FP();
virtual ~ESolver_FP();
//! Initialize of the first-principels energy solver
virtual void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
virtual void after_all_runners(UnitCell& ucell) override;
protected:
virtual void before_scf(UnitCell& ucell, const int istep);
virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver);
virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool &conv_esolver);
//! These pointers will be deleted in the free_pointers() function every ion step.
elecstate::ElecState* pelec = nullptr; ///< Electronic states
//! K points in Brillouin zone
K_Vectors kv;
//! Electorn charge density
Charge<double> chr;
//! pw_rho: Plane-wave basis set for charge density
//! pw_rhod: same as pw_rho for NCPP. Here 'd' stands for 'dense',
//! dense grid for for uspp, used for ultrasoft augmented charge density.
//! charge density and potential are defined on dense grids,
//! but effective potential needs to be interpolated on smooth grids in order to compute Veff|psi>
ModulePW::PW_Basis* pw_rho;
ModulePW::PW_Basis* pw_rhod; //! dense grid for USPP
ModulePW::PW_Basis_Big* pw_big; ///< [temp] pw_basis_big class
//! parallel for rho grid
Parallel_Grid Pgrid;
//! Structure factors that used with plane-wave basis set
Structure_Factor sf;
//! local pseudopotentials
pseudopot_cell_vl locpp;
//! charge extrapolation method
Charge_Extra CE;
//! solvent model
surchem solvent;
bool pw_rho_flag = false; ///< flag for pw_rho, 0: not initialized, 1: initialized
//! the start time of scf iteration
#ifdef __MPI
double iter_time;
#else
std::chrono::system_clock::time_point iter_time;
#endif
};
} // namespace ModuleESolver
#endif