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
9
10#include <memory>
11#include <source_base/macros.h>
12
13namespace ModuleESolver
14{
15
16template <typename T, typename Device = base_device::DEVICE_CPU>
17class ESolver_KS_PW : public ESolver_KS<T, Device>
18{
19 private:
20 using Real = typename GetTypeReal<T>::type;
21
22 public:
24
26
27 void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
28
29 double cal_energy() override;
30
31 void cal_force(UnitCell& ucell, ModuleBase::matrix& force) override;
32
33 void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) override;
34
35 void after_all_runners(UnitCell& ucell) override;
36
38
39 protected:
40 virtual void before_scf(UnitCell& ucell, const int istep) override;
41
42 virtual void iter_init(UnitCell& ucell, const int istep, const int iter) override;
43
44 virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override;
45
46 virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override;
47
48 virtual void others(UnitCell& ucell, const int istep) override;
49
50 virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override;
51
52 virtual void allocate_hamilt(const UnitCell& ucell);
53 virtual void deallocate_hamilt();
54
55 // Electronic wave function psi
57
58 // DFT-1/2 method
59 VSep* vsep_cell = nullptr;
60
61 // for get_pchg and get_wf, use ctx as input of fft
62 Device* ctx = {};
63
64 // for device to host data transformation
66
67};
68} // namespace ModuleESolver
69#endif
Definition matrix.h:19
Definition esolver_ks_pw.h:18
Setup_Psi_pw< T, Device > stp
Definition esolver_ks_pw.h:56
base_device::AbacusDevice_t device
Definition esolver_ks_pw.h:65
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Definition esolver_ks_pw.cpp:188
Exx_Helper< T, Device > exx_helper
Definition esolver_ks_pw.h:37
virtual void others(UnitCell &ucell, const int istep) override
Definition pw_others.cpp:15
void cal_stress(UnitCell &ucell, ModuleBase::matrix &stress) override
calcualte stress of given cell
Definition esolver_ks_pw.cpp:397
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:263
Device * ctx
Definition esolver_ks_pw.h:62
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:351
void before_all_runners(UnitCell &ucell, const Input_para &inp) override
Initialize of the first-principels energy solver.
Definition esolver_ks_pw.cpp:72
double cal_energy() override
calculate total energy of a given system
Definition esolver_ks_pw.cpp:377
virtual void allocate_hamilt(const UnitCell &ucell)
Definition esolver_ks_pw.cpp:56
void cal_force(UnitCell &ucell, ModuleBase::matrix &force) override
calcualte forces for the atoms in the given cell
Definition esolver_ks_pw.cpp:383
typename GetTypeReal< T >::type Real
Definition esolver_ks_pw.h:20
virtual void deallocate_hamilt()
Definition esolver_ks_pw.cpp:62
VSep * vsep_cell
Definition esolver_ks_pw.h:59
~ESolver_KS_PW()
Definition esolver_ks_pw.cpp:43
void after_all_runners(UnitCell &ucell) override
perform post processing calculations
Definition esolver_ks_pw.cpp:418
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:159
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:104
Definition esolver_ks.h:16
bool conv_esolver
Definition esolver.h:47
Definition setup_psi_pw.h:16
Definition unitcell.h:17
Definition VSep_in_pw.h:11
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
AbacusDevice_t
Definition types.h:12
Definition exx_helper.h:13
T type
Definition macros.h:8
Definition input_parameter.h:13