ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
kedf_wt.h
Go to the documentation of this file.
1#ifndef KEDF_WT_H
2#define KEDF_WT_H
3#include <cmath>
4#include <cstdio>
5
9#include "source_base/timer.h"
11
18{
19 public:
21 {
22 this->stress.create(3, 3);
23 }
25 {
26 delete[] this->kernel_;
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_wt_rho0,
36 bool of_hold_rho0,
37 bool read_kernel,
38 std::string kernel_file,
39 ModulePW::PW_Basis* pw_rho);
40
41 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
42 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
43 void tau_wt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_wt);
44 void wt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
45 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, double vw_weight);
46 double wt_energy = 0.;
48
49 private:
50 double wt_kernel(double eta, double tf_weight, double vw_weight);
51 double diff_linhard(double eta, double vw_weight);
52 void multi_kernel(const double* const* prho, double** rkernel_rho, double exponent, ModulePW::PW_Basis* pw_rho);
53 void read_kernel(std::string file_name, ModulePW::PW_Basis* pw_rho);
54 void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis* pw_rho);
55
56 double dV_ = 0.;
57 double rho0_ = 0.; // average rho
58 bool hold_rho0_ = false;
59 double kf_ = 0.; // Fermi vector kF = (3 pi^2 rho)^(1/3)
60 double tkf_ = 0.; // 2 * kF
61 double alpha_ = 5. / 6.;
62 double beta_ = 5. / 6.;
63 // double weightWT = 1.;
64 const double c_tf_
65 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
66 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
67 double wt_coef_ = 0.; // coefficient of WT kernel
68 double* kernel_ = nullptr;
69};
70#endif
A class which calculates the kinetic energy, potential, and stress with Wang-Teter (WT) KEDF....
Definition kedf_wt.h:18
double alpha_
Definition kedf_wt.h:61
const double c_tf_
Definition kedf_wt.h:65
bool hold_rho0_
Definition kedf_wt.h:58
void set_para(double dV, double alpha, double beta, double nelec, double tf_weight, double vw_weight, double of_wt_rho0, bool of_hold_rho0, bool read_kernel, std::string kernel_file, ModulePW::PW_Basis *pw_rho)
Set the parameters of WT KEDF, and initialize kernel.
Definition kedf_wt.cpp:25
double diff_linhard(double eta, double vw_weight)
The derivative of the WT kernel.
Definition kedf_wt.cpp:426
double * kernel_
Definition kedf_wt.h:68
double wt_energy
Definition kedf_wt.h:46
ModuleBase::matrix stress
Definition kedf_wt.h:47
double tkf_
Definition kedf_wt.h:60
void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis *pw_rho)
Fill the kernel (this->kernel_)
Definition kedf_wt.cpp:489
void tau_wt(const double *const *prho, ModulePW::PW_Basis *pw_rho, double *rtau_wt)
Get the kinetic energy of WT KEDF, and add it onto rtau_wt.
Definition kedf_wt.cpp:152
double wt_coef_
Definition kedf_wt.h:67
void read_kernel(std::string file_name, ModulePW::PW_Basis *pw_rho)
Read the kernel from file.
Definition kedf_wt.cpp:506
void wt_potential(const double *const *prho, ModulePW::PW_Basis *pw_rho, ModuleBase::matrix &rpotential)
Get the potential of WT KEDF, and add it into rpotential, and the WT energy will be calculated and st...
Definition kedf_wt.cpp:189
double dV_
Definition kedf_wt.h:56
double get_energy(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Get the energy of WT KEDF.
Definition kedf_wt.cpp:76
KEDF_WT()
Definition kedf_wt.h:20
~KEDF_WT()
Definition kedf_wt.h:24
void get_stress(const double *const *prho, ModulePW::PW_Basis *pw_rho, double vw_weight)
Get the stress of WT KEDF, and store it into this->stress.
Definition kedf_wt.cpp:256
double kf_
Definition kedf_wt.h:59
double wt_kernel(double eta, double tf_weight, double vw_weight)
Calculate the WT kernel according to Lindhard response function.
Definition kedf_wt.cpp:372
double get_energy_density(const double *const *prho, int is, int ir, ModulePW::PW_Basis *pw_rho)
Get the energy density of LKT KEDF.
Definition kedf_wt.cpp:126
double rho0_
Definition kedf_wt.h:57
double beta_
Definition kedf_wt.h:62
void multi_kernel(const double *const *prho, double **rkernel_rho, double exponent, ModulePW::PW_Basis *pw_rho)
Calculate \int{W(r-r')rho^{exponent}(r') dr'}.
Definition kedf_wt.cpp:457
Definition matrix.h:19
void create(const int nrow, const int ncol, const bool flag_zero=true)
Definition matrix.cpp:122
A class which can convert a function of "r" to the corresponding linear superposition of plane waves ...
Definition pw_basis.h:56