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
8#include "source_base/timer.h"
10
17{
18 public:
20 {
21 this->stress.create(3, 3);
22 }
24 {
25 delete[] this->kernel_;
26 }
27
28 void set_para(double dV,
29 double alpha,
30 double beta,
31 double nelec,
32 double tf_weight,
33 double vw_weight,
34 double of_wt_rho0,
35 bool of_hold_rho0,
36 bool read_kernel,
37 std::string kernel_file,
38 ModulePW::PW_Basis* pw_rho);
39
40 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
41 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
42 void tau_wt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_wt);
43 void wt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
44 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, double vw_weight);
45 double wt_energy = 0.;
47
48 private:
49 double wt_kernel(double eta, double tf_weight, double vw_weight);
50 double diff_linhard(double eta, double vw_weight);
51 void multi_kernel(const double* const* prho, double** rkernel_rho, double exponent, ModulePW::PW_Basis* pw_rho);
52 void read_kernel(std::string file_name, ModulePW::PW_Basis* pw_rho);
53 void fill_kernel(double tf_weight, double vw_weight, ModulePW::PW_Basis* pw_rho);
54
55 double dV_ = 0.;
56 double rho0_ = 0.; // average rho
57 bool hold_rho0_ = false;
58 double kf_ = 0.; // Fermi vector kF = (3 pi^2 rho)^(1/3)
59 double tkf_ = 0.; // 2 * kF
60 double alpha_ = 5. / 6.;
61 double beta_ = 5. / 6.;
62 // double weightWT = 1.;
63 const double c_tf_
64 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
65 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
66 double wt_coef_ = 0.; // coefficient of WT kernel
67 double* kernel_ = nullptr;
68};
69#endif
A class which calculates the kinetic energy, potential, and stress with Wang-Teter (WT) KEDF....
Definition kedf_wt.h:17
double alpha_
Definition kedf_wt.h:60
const double c_tf_
Definition kedf_wt.h:64
bool hold_rho0_
Definition kedf_wt.h:57
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:67
double wt_energy
Definition kedf_wt.h:45
ModuleBase::matrix stress
Definition kedf_wt.h:46
double tkf_
Definition kedf_wt.h:59
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:66
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:55
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:19
~KEDF_WT()
Definition kedf_wt.h:23
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:58
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:56
double beta_
Definition kedf_wt.h:61
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: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