Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/PBEFunctional.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#include <vector>
using namespace std;

PBEFunctional::PBEFunctional(const vector<vector<double> > &rhoe,
PBEFunctional::PBEFunctional(const vector<vector<double> > &rhoe, bool sol,
double x_coeff, double c_coeff)
: sol(sol),
um(sol ? 10./81 : 0.2195149727645171),
bet(sol ? 0.046 : 0.06672455060314922)
{
x_coeff_ = x_coeff;
c_coeff_ = c_coeff;
Expand Down Expand Up @@ -171,15 +174,13 @@ void PBEFunctional::excpbe(double rho, double grad,
const double third = 1.0 / 3.0;
const double third4 = 4.0 / 3.0;
const double ax = -0.7385587663820224058; /* -0.75*pow(3.0/pi,third) */
const double um = 0.2195149727645171;
const double uk = 0.804;
const double ul = um / uk;
const double pi32third = 3.09366772628014; /* (3*pi^2 ) ^(1/3) */
const double alpha = 1.91915829267751; /* pow(9.0*pi/4.0, third)*/
const double seven_sixth = 7.0 / 6.0;
const double four_over_pi = 1.27323954473516;
const double gamma = 0.03109069086965489; /* gamma = (1-ln2)/pi^2 */
const double bet = 0.06672455060314922; /* see [a] (4) */
const double delt = bet / gamma;

double rtrs,fk,twoks,rs,t,h,
Expand Down Expand Up @@ -290,7 +291,6 @@ void PBEFunctional::excpbe_sp(double rho_up, double rho_dn,
const double third4 = 4.0 / 3.0;
const double sixthm = -1.0 / 6.0;
const double ax = -0.7385587663820224058; /* -0.75*pow(3.0/pi,third) */
const double um = 0.2195149727645171;
const double uk = 0.804;
const double ul = um / uk;
const double pi32third = 3.09366772628014; /* (3*pi^2 ) ^(1/3) */
Expand All @@ -300,7 +300,6 @@ void PBEFunctional::excpbe_sp(double rho_up, double rho_dn,
const double gam = 0.5198420997897463; /* gam = 2^(4/3) - 2 */
const double fzz = 8.0 / ( 9.0 * gam );
const double gamma = 0.03109069086965489; /* gamma = (1-ln2)/pi^2 */
const double bet = 0.06672455060314922; /* see [a] (4) */
const double delt = bet / gamma;
const double eta = 1.e-12; // small number to avoid blowup as |zeta|->1

Expand Down
8 changes: 5 additions & 3 deletions src/PBEFunctional.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

class PBEFunctional : public XCFunctional
{
const bool sol; //!< PBEsol, if true
const double um, bet; //!< only constants that change between PBE and PBEsol
double x_coeff_, c_coeff_;
std::vector<double> _exc, _exc_up, _exc_dn;
std::vector<double> _vxc1, _vxc1_up, _vxc1_dn,
Expand All @@ -46,12 +48,12 @@ class PBEFunctional : public XCFunctional
public:

// constructor with variable coefficients for exchange and correlation
// with default values 1.0
PBEFunctional(const std::vector<std::vector<double> > &rhoe,
// with default values 1.0, and sol = true/false switches between PBE and PBEsol
PBEFunctional(const std::vector<std::vector<double> > &rhoe, bool sol,
double x_coeff=1.0, double c_coeff=1.0);

bool isGGA() const { return true; };
std::string name() const { return "PBE"; };
std::string name() const { return (sol ? "PBEsol" : "PBE"); };
void setxc(void);
};
#endif
1 change: 1 addition & 0 deletions src/XCOperator.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ XCOperator::XCOperator(Sample& s, const ChargeDensity& cd) :cd_(cd)
if ( ( functional_name == "LDA" ) ||
( functional_name == "VWN" ) ||
( functional_name == "PBE" ) ||
( functional_name == "PBEsol" ) ||
( functional_name == "BLYP" ) )
{
// create only an xc potential
Expand Down
8 changes: 6 additions & 2 deletions src/XCPotential.C
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ XCPotential::XCPotential(const ChargeDensity& cd, const string functional_name,
}
else if ( functional_name == "PBE" )
{
xcf_ = new PBEFunctional(rhototal_r_);
xcf_ = new PBEFunctional(rhototal_r_, false);
}
else if ( functional_name == "PBEsol" )
{
xcf_ = new PBEFunctional(rhototal_r_, true);
}
else if ( functional_name == "BLYP" )
{
Expand All @@ -58,7 +62,7 @@ XCPotential::XCPotential(const ChargeDensity& cd, const string functional_name,
{
const double x_coeff = 1.0 - ctrl.alpha_PBE0;
const double c_coeff = 1.0;
xcf_ = new PBEFunctional(rhototal_r_,x_coeff,c_coeff);
xcf_ = new PBEFunctional(rhototal_r_,false,x_coeff,c_coeff);
}
else if ( functional_name == "HSE" )
{
Expand Down
3 changes: 2 additions & 1 deletion src/Xc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Xc : public Var
if ( !( v == "LDA" ||
v == "VWN" ||
v == "PBE" ||
v == "PBEsol" ||
v == "BLYP" ||
v == "HF" ||
v == "PBE0" ||
Expand All @@ -56,7 +57,7 @@ class Xc : public Var
v == "BHandHLYP" ) )
{
if ( ui->onpe0() )
cout << " xc must be LDA, VWN, PBE, BLYP, "
cout << " xc must be LDA, VWN, PBE, PBEsol, BLYP, "
<< "HF, PBE0, HSE, RSH, B3LYP or BHandHLYP" << endl;
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/testXCFunctional.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char **argv)

XCFunctional *xcf_list[2];
xcf_list[0] = new LDAFunctional(rh);
xcf_list[1] = new PBEFunctional(rh);
xcf_list[1] = new PBEFunctional(rh, false);

for ( int ixcf = 0; ixcf < 2; ixcf++ )
{
Expand Down