ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
kedf_extwt.h
Go to the documentation of this file.
1#ifndef KEDF_EXTWT_H
2#define KEDF_EXTWT_H
3#include <cmath>
4#include <cstdio>
5
8#include "source_base/timer.h"
10
17{
18 public:
20 {
21 this->stress.create(3, 3);
22 }
24 {
25 delete[] this->kernel_;
26 delete[] this->dkernel_deta_;
27 }
28
29 void set_para(double dV,
30 double alpha,
31 double beta,
32 double nelec,
33 double tf_weight,
34 double vw_weight,
35 double of_extwt_kappa,
36 ModulePW::PW_Basis* pw_rho);
37
38 void update_rho0(const double* const* prho,
39 ModulePW::PW_Basis* pw_rho);
40 void cal_kernel(double tf_weight,
41 double vw_weight,
42 double rho0,
43 ModulePW::PW_Basis* pw_rho);
44
45 void update_dkernel_deta(const double &vw_weight, ModulePW::PW_Basis* pw_rho);
46
47 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
48 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
49 void tau_extwt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_extwt);
50 void extwt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
51 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, double vw_weight);
52 double extwt_energy = 0.;
54
55 double rho0_ = 0.; // average rho
56
57 private:
58 double extwt_kernel(double eta, double tf_weight, double vw_weight);
59 double diff_linhard(double eta, double vw_weight);
60 void multi_kernel(const double* const* prho, const double* kernel, double** rkernel_rho, double exponent, ModulePW::PW_Basis* pw_rho);
61 void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis* pw_rho);
62
63 double dV_ = 0.;
64 double kf_ = 0.; // Fermi vector kF = (3 pi^2 rho)^(1/3)
65 double tkf_ = 0.; // 2 * kF
66 double alpha_ = 5. / 6.;
67 double beta_ = 5. / 6.;
68 // double weightWT = 1.;
69 const double c_tf_
70 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
71 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
72 double wt_coef_ = 0.; // coefficient of WT kernel
73 double* kernel_ = nullptr;
74 double* dkernel_deta_ = nullptr; // \partial w/ \partial rho0 = coef * ((alpha + beta - 5/3)F(eta) + 1/3 eta F'(eta))
75 double sum_rho_kappa_ = 0.;
77 double kappa_ = 1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0);
78};
79#endif
A class which calculates the kinetic energy, potential, and stress with extended Wang-Teter (ext-WT) ...
Definition kedf_extwt.h:17
double * kernel_
Definition kedf_extwt.h:73
void extwt_potential(const double *const *prho, ModulePW::PW_Basis *pw_rho, ModuleBase::matrix &rpotential)
Get the potential of ext-WT KEDF, and add it into rpotential, and the ext-WT energy will be calculate...
Definition kedf_extwt.cpp:266
KEDF_ExtWT()
Definition kedf_extwt.h:19
double sum_rho_kappa_
Definition kedf_extwt.h:75
double extwt_energy
Definition kedf_extwt.h:52
double kf_
Definition kedf_extwt.h:64
double alpha_
Definition kedf_extwt.h:66
double * dkernel_deta_
Definition kedf_extwt.h:74
double sum_rho_kappa_plus_one_
Definition kedf_extwt.h:76
double rho0_
Definition kedf_extwt.h:55
double diff_linhard(double eta, double vw_weight)
The derivative of the WT kernel.
Definition kedf_extwt.cpp:461
void get_stress(const double *const *prho, ModulePW::PW_Basis *pw_rho, double vw_weight)
Get the stress of ext-WT KEDF, and store it into this->stress.
Definition kedf_extwt.cpp:394
const double c_tf_
Definition kedf_extwt.h:70
~KEDF_ExtWT()
Definition kedf_extwt.h:23
void update_dkernel_deta(const double &vw_weight, ModulePW::PW_Basis *pw_rho)
Fill the dkernel_deta (this->dkernel_deta_)
Definition kedf_extwt.cpp:134
double kappa_
Definition kedf_extwt.h:77
double get_energy(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Get the energy of ext-WT KEDF.
Definition kedf_extwt.cpp:156
double tkf_
Definition kedf_extwt.h:65
double beta_
Definition kedf_extwt.h:67
ModuleBase::matrix stress
Definition kedf_extwt.h:53
double wt_coef_
Definition kedf_extwt.h:72
double extwt_kernel(double eta, double tf_weight, double vw_weight)
Calculate the WT kernel according to Lindhard response function.
Definition kedf_extwt.cpp:407
void tau_extwt(const double *const *prho, ModulePW::PW_Basis *pw_rho, double *rtau_extwt)
Get the kinetic energy of ext-WT KEDF, and add it onto rtau_extwt.
Definition kedf_extwt.cpp:230
void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis *pw_rho)
Fill the kernel (this->kernel_)
Definition kedf_extwt.cpp:525
void multi_kernel(const double *const *prho, const double *kernel, double **rkernel_rho, double exponent, ModulePW::PW_Basis *pw_rho)
Calculate \int{W(r-r')rho^{exponent}(r') dr'}.
Definition kedf_extwt.cpp:492
void cal_kernel(double tf_weight, double vw_weight, double rho0, ModulePW::PW_Basis *pw_rho)
Definition kedf_extwt.cpp:100
void update_rho0(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Definition kedf_extwt.cpp:71
double get_energy_density(const double *const *prho, int is, int ir, ModulePW::PW_Basis *pw_rho)
Get the energy density of ext-WT KEDF.
Definition kedf_extwt.cpp:205
void set_para(double dV, double alpha, double beta, double nelec, double tf_weight, double vw_weight, double of_extwt_kappa, ModulePW::PW_Basis *pw_rho)
Set the parameters of ext-WT KEDF, and initialize kernel.
Definition kedf_extwt.cpp:27
double dV_
Definition kedf_extwt.h:63
Definition matrix.h:18
void create(const int nrow, const int ncol, const bool flag_zero=true)
Definition matrix.cpp:125
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:56