1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2008 The Regents of the University of California
4 //
5 // This file is part of Qbox
6 //
7 // Qbox is distributed under the terms of the GNU General Public License
8 // as published by the Free Software Foundation, either version 2 of
9 // the License, or (at your option) any later version.
10 // See the file COPYING in the root directory of this distribution
11 // or <http://www.gnu.org/licenses/>.
12 //
13 ////////////////////////////////////////////////////////////////////////////////
14 //
15 // PBEFunctional.h
16 //
17 ////////////////////////////////////////////////////////////////////////////////
18 
19 #ifndef PBEFUNCTIONAL_H
20 #define PBEFUNCTIONAL_H
21 
22 #include "XCFunctional.h"
23 #include <vector>
24 
25 class PBEFunctional : public XCFunctional
26 {
27   double x_coeff_, c_coeff_;
28   std::vector<double> _exc, _exc_up, _exc_dn;
29   std::vector<double> _vxc1, _vxc1_up, _vxc1_dn,
30                  _vxc2, _vxc2_upup, _vxc2_updn, _vxc2_dnup, _vxc2_dndn;
31   std::vector<double> _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3];
32 
33   void gcor2(double a, double a1,
34     double b1, double b2, double b3,
35     double b4, double rtrs, double *gg, double *ggrs);
36 
37   void excpbe(double rho, double grad,
38     double *exc, double *vxc1, double *vxc2);
39 
40   void excpbe_sp(double rho_up, double rho_dn,
41     double grad_up, double grad_dn, double grad,
42     double *exc_up, double *exc_dn,
43     double *vxc1_up, double *vxc1_dn, double *vxc2_upup, double *vxc2_dndn,
44     double *vxc2_updn, double *vxc2_dnup);
45 
46   public:
47 
48   // constructor with variable coefficients for exchange and correlation
49   // with default values 1.0
50   PBEFunctional(const std::vector<std::vector<double> > &rhoe,
51                 double x_coeff=1.0, double c_coeff=1.0);
52 
isGGA()53   bool isGGA() const { return true; };
name()54   std::string name() const { return "PBE"; };
55   void setxc(void);
56 };
57 #endif
58