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 // BLYPFunctional.h 16 // 17 //////////////////////////////////////////////////////////////////////////////// 18 #ifndef BLYPFUNCTIONAL_H 19 #define BLYPFUNCTIONAL_H 20 21 #include "XCFunctional.h" 22 #include <vector> 23 24 class BLYPFunctional : public XCFunctional 25 { 26 BLYPFunctional(); 27 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 public: 34 35 BLYPFunctional(const std::vector<std::vector<double> > &rhoe); 36 37 static void exb88(double rho, double grad, 38 double *ex, double *vx1, double *vx2); 39 static void eclyp(double rho, double grad, 40 double *ec, double *vc1, double *vc2); 41 42 static void exb88_sp(double rho_up, double rho_dn, 43 double grad_up2, double grad_dn2, double grad_up_grad_dn, 44 double *ex_up, double *ex_dn, double *vx1_up, double *vx1_dn, 45 double *vx2_upup, double *vx2_dndn, double *vx2_updn, double *vx2_dnup); 46 static void eclyp_sp(double rho_up, double rho_dn, 47 double grad_up2, double grad_dn2, double grad_up_grad_dn, 48 double *ec_up, double *ec_dn, double *vc1_up, double *vc1_dn, 49 double *vc2_upup, double *vc2_dndn, double *vc2_updn, double *vc2_dnup); 50 isGGA()51 bool isGGA() const { return true; }; name()52 std::string name() const { return "BLYP"; }; 53 void setxc(void); 54 }; 55 #endif 56