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
9#include "source_base/timer.h"
11
18{
19 public:
21 {
22 this->stress.create(3, 3);
23 }
25 {
26 }
27
28 void set_para(double dV, double lkt_a);
29
30 double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho);
31 double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho);
32 void tau_lkt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_lkt);
33 void lkt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential);
34 void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho);
35
36 double lkt_energy = 0.; // LKT energy
38
39 private:
40 void nabla(const double* pinput, ModulePW::PW_Basis* pw_rho, double** routput);
41 void divergence(const double* const* pinput, ModulePW::PW_Basis* pw_rho, double* routput);
42 void get_as(const double* prho, const double* const* pnabla_rho, const int nrxx, double* as);
43
44 double dV_ = 0.; // volume element = V/nxyz
45 const double c_tf_
46 = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0)
47 * 2; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2)
48 const double s_coef_
49 = 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}
50 double lkt_a_ = 1.3;
51};
52#endif
A class which calculates the kinetic energy, potential, and stress with Luo-Karasiev-Trickey (LKT) KE...
Definition kedf_lkt.h:18
ModuleBase::matrix stress
Definition kedf_lkt.h:37
~KEDF_LKT()
Definition kedf_lkt.h:24
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:36
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:46
void set_para(double dV, double lkt_a)
Definition kedf_lkt.cpp:8
double dV_
Definition kedf_lkt.h:44
double lkt_a_
Definition kedf_lkt.h:50
KEDF_LKT()
Definition kedf_lkt.h:20
const double s_coef_
Definition kedf_lkt.h:49
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: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