ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_ks_pw.h
Go to the documentation of this file.
1#ifndef ESOLVER_KS_PW_H
2#define ESOLVER_KS_PW_H
3#include "./esolver_ks.h"
4#include "source_psi/setup_psi_pw.h" // mohan add 20251012
7
8#include <memory>
10
11namespace ModuleESolver
12{
13
14template <typename T, typename Device = base_device::DEVICE_CPU>
16{
17 private:
18 using Real = typename GetTypeReal<T>::type;
19
20 public:
22
24
25 void before_all_runners(BaseCell &basecell, const Input_para &inp) override;
26
27 double cal_energy() override;
28
29 void cal_force(BaseCell &basecell, ModuleBase::matrix &force) override;
30
31 void cal_stress(BaseCell &basecell, ModuleBase::matrix &stress) override;
32
33 void after_all_runners(BaseCell &basecell) override;
34
36
37 protected:
38 virtual void before_scf(UnitCell &ucell, const int istep) override;
39
40 virtual void iter_init(UnitCell &ucell, const int istep, const int iter) override;
41
42 virtual void iter_finish(
43 UnitCell &ucell,
44 const int istep,
45 int &iter,
46 bool &conv_esolver) override;
47
48 virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override;
49
50 virtual void others(BaseCell &basecell, const int istep) override;
51
52 virtual void hamilt2rho_single(
53 UnitCell &ucell,
54 const int istep,
55 const int iter,
56 const double ethr) override;
57
58 virtual void allocate_hamilt(const UnitCell &ucell);
59
62 virtual void prepare_init_hamilt(const UnitCell &ucell);
63
64 // Last ionic step executed; used by after_all_runners outputs that are
65 // written once after all runners have finished.
66 int istep_ = 0;
67
68 // Electronic wave function psi
70
71 // DFT-1/2 method
72 VSep *vsep_cell = nullptr;
73};
74} // namespace ModuleESolver
75#endif
Definition basecell.h:9
Definition exx_helper_base.h:12
Definition matrix.h:15
void before_all_runners(BaseCell &basecell, const Input_para &inp) override
Initialize of the first-principels energy solver.
Definition esolver_ks_pw.cpp:75
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Definition esolver_ks_pw.cpp:240
void cal_stress(BaseCell &basecell, ModuleBase::matrix &stress) override
calcualte stress of given cell
Definition esolver_ks_pw.cpp:431
virtual void iter_finish(UnitCell &ucell, const int istep, int &iter, bool &conv_esolver) override
Something to do after hamilt2rho function in each iter loop.
Definition esolver_ks_pw.cpp:291
virtual void prepare_init_hamilt(const UnitCell &ucell)
Let RT-TDDFT bind its endpoint field before wavefunction initialization uses H; ordinary DFT does not...
Definition esolver_ks_pw.cpp:200
void after_all_runners(BaseCell &basecell) override
perform post processing calculations
Definition esolver_ks_pw.cpp:458
Exx_HelperBase * exx_helper
Definition esolver_ks_pw.h:35
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Something to do after SCF iterations when SCF is converged or comes to the max iter step.
Definition esolver_ks_pw.cpp:382
double cal_energy() override
calculate total energy of a given system
Definition esolver_ks_pw.cpp:406
virtual void allocate_hamilt(const UnitCell &ucell)
Definition esolver_ks_pw.cpp:68
int istep_
Definition esolver_ks_pw.h:66
typename GetTypeReal< T >::type Real
Definition esolver_ks_pw.h:18
VSep * vsep_cell
Definition esolver_ks_pw.h:72
Setup_Psi_pw stp
Definition esolver_ks_pw.h:69
~ESolver_KS_PW()
Definition esolver_ks_pw.cpp:44
virtual void others(BaseCell &basecell, const int istep) override
Definition pw_others.cpp:13
void cal_force(BaseCell &basecell, ModuleBase::matrix &force) override
calcualte forces for the atoms in the given cell
Definition esolver_ks_pw.cpp:412
virtual void iter_init(UnitCell &ucell, const int istep, const int iter) override
Something to do before hamilt2rho function in each iter loop.
Definition esolver_ks_pw.cpp:205
ESolver_KS_PW()
Definition esolver_ks_pw.cpp:35
virtual void before_scf(UnitCell &ucell, const int istep) override
Something to do before SCF iterations.
Definition esolver_ks_pw.cpp:136
ESolver_KS()
Constructor.
Definition esolver_ks.cpp:29
bool conv_esolver
Definition esolver.h:46
Definition setup_psi_pw.h:14
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition vsep_pw.h:12
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
T type
Definition macros.h:8
Definition input_parameter.h:13