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#include <vector>
6
9#include "source_base/timer.h"
11
18{
19 public:
21 {
22 this->stress.create(3, 3);
23 }
24 ~KEDF_ExtWT() = default;
25
26 void set_para(double dV,
27 double alpha,
28 double beta,
29 double nelec,
30 double tf_weight,
31 double vw_weight,
32 double of_extwt_kappa,
33 ModulePW::PW_Basis* pw_rho);
34
35 void update_rho0(const double* const* prho,
36 ModulePW::PW_Basis* pw_rho);
37 void cal_kernel(double tf_weight,
38 double vw_weight,
39 double rho0,
40 ModulePW::PW_Basis* pw_rho);
41
42 void update_dkernel_deta(const double &vw_weight, ModulePW::PW_Basis* pw_rho);
43
44 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
45 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
46 void tau_extwt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_extwt);
47 void extwt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
48 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, double vw_weight);
49 double extwt_energy = 0.;
51
52 double rho0_ = 0.; // average rho
53
54 private:
55 double extwt_kernel(double eta, double tf_weight, double vw_weight);
56 double diff_linhard(double eta, double vw_weight);
57 void multi_kernel(const double* const* prho, const double* kernel, double** rkernel_rho, double exponent, ModulePW::PW_Basis* pw_rho);
58 void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis* pw_rho);
59
60 double dV_ = 0.;
61 double kf_ = 0.; // Fermi vector kF = (3 pi^2 rho)^(1/3)
62 double tkf_ = 0.; // 2 * kF
63 double alpha_ = 5. / 6.;
64 double beta_ = 5. / 6.;
65 // double weightWT = 1.;
66 const double c_tf_
67 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
68 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
69 double wt_coef_ = 0.; // coefficient of WT kernel
70 std::vector<double> kernel_;
71 std::vector<double> dkernel_deta_; // \partial w/ \partial rho0 = coef * ((alpha + beta - 5/3)F(eta) + 1/3 eta F'(eta))
72 double sum_rho_kappa_ = 0.;
74 double kappa_ = 1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0);
75};
76#endif
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:264
KEDF_ExtWT()
Definition kedf_extwt.h:20
double sum_rho_kappa_
Definition kedf_extwt.h:72
double extwt_energy
Definition kedf_extwt.h:49
double kf_
Definition kedf_extwt.h:61
double alpha_
Definition kedf_extwt.h:63
std::vector< double > dkernel_deta_
Definition kedf_extwt.h:71
~KEDF_ExtWT()=default
double sum_rho_kappa_plus_one_
Definition kedf_extwt.h:73
double rho0_
Definition kedf_extwt.h:52
double diff_linhard(double eta, double vw_weight)
The derivative of the WT kernel.
Definition kedf_extwt.cpp:460
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:393
const double c_tf_
Definition kedf_extwt.h:67
void update_dkernel_deta(const double &vw_weight, ModulePW::PW_Basis *pw_rho)
Fill the dkernel_deta (this->dkernel_deta_).
Definition kedf_extwt.cpp:132
double kappa_
Definition kedf_extwt.h:74
double get_energy(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Get the energy of ext-WT KEDF.
Definition kedf_extwt.cpp:154
double tkf_
Definition kedf_extwt.h:62
double beta_
Definition kedf_extwt.h:64
ModuleBase::matrix stress
Definition kedf_extwt.h:50
std::vector< double > kernel_
Definition kedf_extwt.h:70
double wt_coef_
Definition kedf_extwt.h:69
double extwt_kernel(double eta, double tf_weight, double vw_weight)
Calculate the WT kernel according to Lindhard response function.
Definition kedf_extwt.cpp:406
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:228
void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis *pw_rho)
Fill the kernel (this->kernel_).
Definition kedf_extwt.cpp:524
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:491
void cal_kernel(double tf_weight, double vw_weight, double rho0, ModulePW::PW_Basis *pw_rho)
Definition kedf_extwt.cpp:98
void update_rho0(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Definition kedf_extwt.cpp:69
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:203
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:60
Definition matrix.h:15
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:60