ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
kedf_lkt.h
Go to the documentation of this file.
1#ifndef KEDF_LKT_H
2#define KEDF_LKT_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 }
26
27 void set_para(double dV, double lkt_a);
28
29 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
30 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
31 void tau_lkt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_lkt);
32 void lkt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
33 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho);
34
35 double lkt_energy = 0.; // LKT energy
37
38 private:
39 void nabla(const double* pinput, ModulePW::PW_Basis* pw_rho, double** routput);
40 void divergence(const double* const* pinput, ModulePW::PW_Basis* pw_rho, double* routput);
41 void get_as(const double* prho, const double* const* pnabla_rho, const int nrxx, double* as);
42
43 double dV_ = 0.; // volume element = V/nxyz
44 const double c_tf_
45 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
46 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
47 const double s_coef_
48 = 1.0 / (2. * std::pow(3 * std::pow(M_PI, 2.0), 1.0 / 3.0)); // coef of s, s=s_coef * |nabla rho|/rho^{4/3}
49 double lkt_a_ = 1.3;
50};
51#endif
A class which calculates the kinetic energy, potential, and stress with Luo-Karasiev-Trickey (LKT) KE...
Definition kedf_lkt.h:17
ModuleBase::matrix stress
Definition kedf_lkt.h:36
~KEDF_LKT()
Definition kedf_lkt.h:23
double get_energy(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Get the energy of LKT KEDF.
Definition kedf_lkt.cpp:22
double lkt_energy
Definition kedf_lkt.h:35
void lkt_potential(const double *const *prho, ModulePW::PW_Basis *pw_rho, ModuleBase::matrix &rpotential)
Get the potential of LKT KEDF, and add it into rpotential, and the LKT energy will be calculated and ...
Definition kedf_lkt.cpp:133
void tau_lkt(const double *const *prho, ModulePW::PW_Basis *pw_rho, double *rtau_lkt)
Definition kedf_lkt.cpp:91
void get_stress(const double *const *prho, ModulePW::PW_Basis *pw_rho)
Get the stress of LKT KEDF, and store it into this->stress.
Definition kedf_lkt.cpp:205
void nabla(const double *pinput, ModulePW::PW_Basis *pw_rho, double **routput)
Caculate routput = nabla(pinput)
Definition kedf_lkt.cpp:279
void divergence(const double *const *pinput, ModulePW::PW_Basis *pw_rho, double *routput)
Caculate routput = nabla dot pinput.
Definition kedf_lkt.cpp:306
const double c_tf_
Definition kedf_lkt.h:45
void set_para(double dV, double lkt_a)
Definition kedf_lkt.cpp:8
double dV_
Definition kedf_lkt.h:43
double lkt_a_
Definition kedf_lkt.h:49
KEDF_LKT()
Definition kedf_lkt.h:19
const double s_coef_
Definition kedf_lkt.h:48
void get_as(const double *prho, const double *const *pnabla_rho, const int nrxx, double *as)
Caculate as = lkt_a * s, s = c_s * |\nabla \rho|/\rho^{4/3}.
Definition kedf_lkt.cpp:332
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_lkt.cpp:68
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