Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
681e017
Merge pull request #11 from shankar1729/master
benrich37 Mar 24, 2026
3cbd96e
copy-paste of VanDerWaalsD3 code + edits for BJ damping
benrich37 Mar 24, 2026
bcd9c8c
Citation for the BJ form
benrich37 Mar 24, 2026
49559bd
Updates
benrich37 Mar 24, 2026
ddfe25d
unsure about how mapping to XC names works for LibXC
benrich37 Mar 24, 2026
f6389f9
Changing to be integrated into the pre-existing D3 module
benrich37 Mar 25, 2026
405f11c
adding VDW_D3BJ as a "VDWstyle"
benrich37 Mar 25, 2026
49f7ec4
Changing to check a boolean class attribute for triggering BJ damping…
benrich37 Mar 25, 2026
f5b51b8
fixes
benrich37 Mar 25, 2026
b7e3ac4
commenting out for now in case this is source of the issue
benrich37 Mar 25, 2026
c2c60f1
for debug
benrich37 Mar 25, 2026
3a4395d
debugging
benrich37 Mar 25, 2026
31bc000
no trailing commas
benrich37 Mar 25, 2026
12de918
adding back with correction
benrich37 Mar 25, 2026
31ce009
define first
benrich37 Mar 25, 2026
7412cc9
Currently compiles but throws a lot of warnings about term6/8_r being…
benrich37 Mar 25, 2026
eec3f7e
see what this does
benrich37 Mar 25, 2026
73aa5d1
missing else
benrich37 Mar 25, 2026
21a3562
more accurate log statements
benrich37 Mar 25, 2026
ae38c62
Adding back the scan functionals for testing now that pbe is working
benrich37 Mar 26, 2026
7fb58d9
separated out xc mapping into shared, zero-exclusive, or bj-exclusive…
benrich37 Mar 30, 2026
62f4454
Merge pull request #12 from shankar1729/master
benrich37 Mar 30, 2026
52325aa
Removing functionals that don't appear to be supported, fixed some na…
benrich37 Mar 30, 2026
09905e5
Removing more unsupported functionals, fixing some naming
benrich37 Mar 30, 2026
3d1f38c
Removing trailing comma
benrich37 Mar 30, 2026
95605ce
removing unsupported functionals
benrich37 Mar 30, 2026
4093caa
Making line length more consistent
benrich37 Mar 30, 2026
9a2b91b
previously had values for "revPBE" under "RPBE"
benrich37 Mar 30, 2026
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
6 changes: 6 additions & 0 deletions jdftx/commands/elec_ex_corr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ struct CommandVanDerWaals : public Command
{ e.iInfo.vdWstyle = VDW_D3;
e.iInfo.vdWscale = 0.; //not used for D3
}
else if(key == "D3BJ")
{ e.iInfo.vdWstyle = VDW_D3BJ;
e.iInfo.vdWscale = 0.; //not used for D3BJ
}
else
{ e.iInfo.vdWstyle = VDW_D2;
pl.rewind(); //so that scale can be read instead of key above
Expand All @@ -313,6 +317,8 @@ struct CommandVanDerWaals : public Command
void printStatus(Everything& e, int iRep)
{ if(e.iInfo.vdWstyle == VDW_D3)
logPrintf("D3");
else if(e.iInfo.vdWstyle == VDW_D3BJ)
logPrintf("D3BJ");
else if(e.iInfo.vdWscale)
logPrintf("%lg", e.iInfo.vdWscale);
}
Expand Down
1 change: 1 addition & 0 deletions jdftx/electronic/Everything.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void Everything::setup()
{ switch(iInfo.vdWstyle)
{ case VDW_D2: { vanDerWaals = std::make_shared<VanDerWaalsD2>(*this); break; }
case VDW_D3: { vanDerWaals = std::make_shared<VanDerWaalsD3>(*this); break; }
case VDW_D3BJ: { vanDerWaals = std::make_shared<VanDerWaalsD3>(*this); break; }
}
}
//--- for fluid (must be D2):
Expand Down
2 changes: 1 addition & 1 deletion jdftx/electronic/IonInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static EnumStringMap<ForcesOutputCoords> forcesOutputCoordsMap(
enum coreOverlapCheck { additive, vector, none };

//! Style of vdW correction
enum VDWstyle { VDW_D2, VDW_D3 };
enum VDWstyle { VDW_D2, VDW_D3, VDW_D3BJ };


//! Container class for ionic system: collection of species, each with several atoms
Expand Down
60 changes: 51 additions & 9 deletions jdftx/electronic/VanDerWaalsD3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,29 @@ namespace D3

//----- Implementation of class VanDerWaalsD3 -----

VanDerWaalsD3::VanDerWaalsD3(const Everything& e) : VanDerWaals(e)
VanDerWaalsD3::VanDerWaalsD3(const Everything& e)
: VanDerWaals(e), useBJDamping(e.iInfo.vdWstyle == VDW_D3BJ)
{
logPrintf("\nInitializing DFT-D3 calculator:\n");
if (useBJDamping)
{
logPrintf("\nInitializing DFT-D3(BJ) calculator:\n");
}
else {
logPrintf("\nInitializing DFT-D3 calculator:\n");
}

//Get parameters for exchange-correlation functional
string xcName = e.exCorr.getName();
D3::setXCscale(xcName, s6, sr6, s8, sr8);
D3::setXCscale(xcName, useBJDamping, s6, sr6, s8, sr8);
logPrintf("\tParameters set for %s functional\n", xcName.c_str());
logPrintf("\ts6: %6.3lf s_r6: %6.3lf\n", s6, sr6);
logPrintf("\ts8: %6.3lf s_r8: %6.3lf\n", s8, sr8);
if (useBJDamping)
{
logPrintf("\ts6: %6.3lf s8: %6.3lf\n", s6, s8);
logPrintf("\ta1: %6.3lf a2: %6.3lf\n", sr6, sr8);
} else {
logPrintf("\ts6: %6.3lf s_r6: %6.3lf\n", s6, sr6);
logPrintf("\ts8: %6.3lf s_r8: %6.3lf\n", s8, sr8);
}

//Get per-atom parameters:
logPrintf("\tPer-atom parameters loaded for:\n");
Expand All @@ -123,7 +136,11 @@ VanDerWaalsD3::VanDerWaalsD3(const Everything& e) : VanDerWaals(e)
pairParams[iSp1][iSp2] = D3::getPairParams(atomParams[iSp1], atomParams[iSp2]);
}

Citations::add("DFT-D3 dispersion correction", "S. Grimme, J. Antony, S. Ehrlich and H. Krieg, J. Chem. Phys. 132, 154104 (2010)");
if (useBJDamping) {
Citations::add("DFT-D3(BJ) dispersion correction", "S. Grimme, S. Ehrlich and L. Goerigk, J. Comp. Chem. 32, 1456 (2011)");
} else {
Citations::add("DFT-D3 dispersion correction", "S. Grimme, J. Antony, S. Ehrlich and H. Krieg, J. Chem. Phys. 132, 154104 (2010)");
}
}


Expand All @@ -149,6 +166,18 @@ template<int n, int alpha_n> double vdWpotential(double invr, double R0, double&
return pot * damp;
}

//! Return r^-n pair-potential energy and set its derivative E_r for the BJ-damping form.
template<int n> double vdWpotentialBJ(double r, double R0, double a1, double a2, double& E_r)
{ //Main r^-n potential (and r derivative):
double subcdamp = a1*R0 + a2; // eqn 6 of Grimme 2011
double cdamp = pow(subcdamp, n); // raised to n (constant wrt r)
double rn = pow(r, n);
double E = 1 / (rn + cdamp);
E_r = -n * pow(r, n-1) * E * E;
return E;
}



double VanDerWaalsD3::energyAndGrad(std::vector<Atom>& atoms, const double scaleFac, matrix3<>* E_RRTptr) const
{ static StopWatch watch("VanDerWaalsD3::energyAndGrad"); watch.start();
Expand Down Expand Up @@ -181,6 +210,9 @@ double VanDerWaalsD3::energyAndGrad(std::vector<Atom>& atoms, const double scale
double ratio8by6 = 3. * ap1.sqrtQ * ap2.sqrtQ;
double C6 = trace(transpose(L1) * pp.C6 * L2).real();
double C8 = C6 * ratio8by6;
double R0 = pp.R0;
if(useBJDamping)
R0 = sqrt(C8/C6); //BJ damping uses C8/C6 to get R0
if(c1 == c2) diagC6[c1] = C6; //only for reporting

//Sum energy, force and stress contributions over periodic images:
Expand All @@ -191,10 +223,18 @@ double VanDerWaalsD3::energyAndGrad(std::vector<Atom>& atoms, const double scale
double rSq = e.gInfo.RTR.metric_length_squared(x);
if(rSq and rSq<=rCutSq)
{ double r = sqrt(rSq);
double invr = 1./r;
double cellWeight = (iR[2] ? 1. : 0.5); //account for double-counting in half-space cut plane
double term6_r; double term6 = (vdWpotential<6, D3::alpha6>(invr, sr6 * pp.R0, term6_r));
double term8_r; double term8 = (vdWpotential<8, D3::alpha8>(invr, sr8 * pp.R0, term8_r));
double invr = 1./r;
// double term6_r; double term6 = (vdWpotential<6, D3::alpha6>(invr, sr6 * R0, term6_r));
// double term8_r; double term8 = (vdWpotential<8, D3::alpha8>(invr, sr8 * R0, term8_r));
double term6_r; double term6; double term8_r; double term8;
if(useBJDamping) {
term6 = (vdWpotentialBJ<6>(r, R0, sr6, sr8, term6_r));
term8 = (vdWpotentialBJ<8>(r, R0, sr6, sr8, term8_r));
} else {
term6 = (vdWpotential<6, D3::alpha6>(invr, sr6 * R0, term6_r));
term8 = (vdWpotential<8, D3::alpha8>(invr, sr8 * R0, term8_r));
}
E12_C6 -= cellWeight * s6 * term6;
E12_C8 -= cellWeight * s8 * term8;
//Colect forces and/or stresses:
Expand Down Expand Up @@ -240,6 +280,8 @@ double VanDerWaalsD3::energyAndGrad(std::vector<Atom>& atoms, const double scale
}




//Compute local coordination number
void VanDerWaalsD3::computeCN(const std::vector<Atom>& atoms, std::vector<double>& CN) const
{ const double rCut = 50., rCutSq=rCut*rCut; //Damping factor in CN calculation drops off more quickly than dispersion term
Expand Down
1 change: 1 addition & 0 deletions jdftx/electronic/VanDerWaalsD3.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class VanDerWaalsD3 : public VanDerWaals
virtual double energyAndGrad(std::vector<Atom>& atoms, const double scaleFac, matrix3<>* E_RRTptr=0) const;

private:
const bool useBJDamping; //whether to use BJ damping instead of zero-damping
double s6, s8; //scale factors for r^-6 and r^-8 terms corresponding to e.exCorr
double sr6, sr8; //factors in damping of r^-6 and r^-8 terms corresponding to e.exCorr
std::vector<D3::AtomParams> atomParams; //!< parameters per atom type
Expand Down
216 changes: 163 additions & 53 deletions jdftx/electronic/VanDerWaalsD3_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,62 @@ namespace D3
3.57788113, 5.06446567, 4.56053862, 4.20778980, 3.98102289,
3.82984466, 3.85504098, 3.88023730, 3.90543362};

//! List of supported functionals
enum XC { XC_LDA, XC_PBE, XC_PBESOL, XC_RPBE, XC_SSB, XC_HCTH_120,
XC_TPSS, XC_M06_L, XC_HF, XC_PBE0, XC_PBE38, XC_HSE06,
XC_B3PW91, XC_B3LYP, XC_CAM_B3LYP, XC_PW6B95, XC_TPSS0,
XC_TPSSH, XC_PWB6K, XC_MPW1B95, XC_MPWB1K, XC_BMK, XC_LC_WPBE,
XC_M05, XC_M05_2X, XC_M06, XC_M06_2X, XC_M06_HF};
//! List of functionals grouped by currently active D3 support
enum XC {
// Supported for both zero-damping and BJ damping:
XC_PBE, XC_PBESOL, XC_RPBE, XC_SSB, XC_TPSS,
XC_HF, XC_PBE0, XC_PBE38, XC_HSE06, XC_B3PW91, XC_B3LYP, XC_CAM_B3LYP, XC_PW6B95,
XC_TPSS0, XC_TPSSH, XC_PWB6K, XC_MPW1B95, XC_MPWB1K, XC_BMK, XC_LC_WPBE,

// Supported only for zero-damping:
XC_LDA, XC_HCTH_120, XC_M06_L, XC_M05, XC_M05_2X, XC_M06, XC_M06_2X, XC_M06_HF,

// Supported only for BJ damping:
XC_R2SCAN, XC_RSCAN,

// Declared (maps/parameters present), but not currently active in either damping switch:
XC_B97_D, XC_BOP, XC_HSE03, XC_BHLYP, XC_B1B95, XC_XLYP, XC_HCTH_407, XC_PW91, XC_revTPSS, XC_tHCTH,
XC_B3P86, XC_B1LYP, XC_MPW1PW91, XC_MPW1KCIS, XC_MPWKCIS1K, XC_PBE1KCIS, XC_X3LYP, XC_O3LYP, XC_B97_1,
XC_B97_2, XC_B98, XC_revTPSSh, XC_TPSS1KCIS, XC_M11, XC_N12SX, XC_MN12SX, XC_MN12L, XC_MN15, XC_SCAN
};

// Shared aliases used by both zero-damping and BJ-damping maps:
#define D3_XC_COMMON_MAP_ENTRIES \
XC_PBE, "gga-PBE", XC_PBESOL, "gga-PBEsol", XC_RPBE, "gga-RPBE", XC_SSB, "gga-SSB", XC_TPSS, "mgga-TPSS", \
XC_HF, "hartree-fock", XC_PBE0, "hyb-PBE0", XC_PBE38, "hyb-PBE38", XC_HSE06, "hyb-HSE06", \
XC_B3PW91, "hyb-B3PW91", XC_B3LYP, "hyb-B3LYP", XC_CAM_B3LYP, "hyb-CAM-B3LYP", XC_PW6B95, "hyb-PW6B95", \
XC_TPSS0, "hyb-TPSS0", XC_TPSSH, "hyb-TPSSH", XC_PWB6K, "hyb-PWB6K", XC_MPW1B95, "hyb-MPW1B95", \
XC_MPWB1K, "hyb-MPWB1K", XC_BMK, "hyb-BMK", XC_LC_WPBE, "hyb-LC-PBE", XC_LC_WPBE, "hyb-LC-wPBE"

//! Map XC onto shortened names:
EnumStringMap<XC> xcMap(
XC_LDA, "lda", XC_PBE, "gga-PBE", XC_PBESOL, "gga-PBEsol",
XC_RPBE, "gga-RPBE", XC_SSB, "gga-SSB", XC_HCTH_120, "gga-HCTH-120",
XC_TPSS, "mgga-TPSS", XC_M06_L, "mgga-M06-L",
XC_HF, "hartree-fock", XC_PBE0, "hyb-PBE0", XC_PBE38, "hyb-PBE38",
XC_HSE06, "hyb-HSE06", XC_B3PW91, "hyb-B3PW91", XC_B3LYP, "hyb-B3LYP",
XC_CAM_B3LYP, "hyb-CAM-B3LYP", XC_PW6B95, "hyb-PW6B95",
XC_TPSS0, "hyb-TPSS0", XC_TPSSH, "hyb-TPSSH", XC_PWB6K, "hyb-PWB6K",
XC_MPW1B95, "hyb-MPW1B95", XC_MPWB1K, "hyb-MPW1BK", XC_BMK, "hyb-BMK",
XC_LC_WPBE, "hyb-LC-PBE", XC_M05, "hyb-M05", XC_M05_2X, "hyb-M05-2X",
XC_M06, "hyb-M06", XC_M06_2X, "hyb-M06-2X", XC_M06_HF, "hyb-M06-HF");
// Supported for both zero-damping and BJ damping:
D3_XC_COMMON_MAP_ENTRIES,

// Supported only for zero-damping:
XC_LDA, "lda", XC_HCTH_120, "gga-HCTH-120", XC_M06_L, "mgga-M06-L",
XC_M05, "hyb-M05", XC_M05_2X, "hyb-M05-2X", XC_M06, "hyb-M06", XC_M06_2X, "hyb-M06-2X", XC_M06_HF, "hyb-M06-HF");

//! Map XC onto shortened names:
EnumStringMap<XC> BJxcMap(
// Supported for both zero-damping and BJ damping:
D3_XC_COMMON_MAP_ENTRIES,

// Supported only for BJ damping:
XC_R2SCAN, "mgga-r2scan", XC_RSCAN, "mgga-rscan",

// // Declared aliases not currently active in BJ switch:
XC_BOP, "hyb-lc-bop", XC_B97_D, "gga-b97-d", XC_XLYP, "gga-xlyp", XC_HCTH_407, "gga-hcth-407",
XC_PW91, "gga-PW91", XC_tHCTH, "mgga-tau-hcth", XC_revTPSS, "mgga-revtpss", XC_HSE03, "hyb-hse03",
XC_BHLYP, "hyb-bhandh", XC_B3P86, "hyb-b3p86", XC_B1LYP, "hyb-b1lyp", XC_MPW1PW91, "hyb-mpw1pw",
XC_MPW1KCIS, "hyb-mpw1kcis", XC_MPWKCIS1K, "hyb-mpwkcis1k", XC_PBE1KCIS, "hyb-pbe1kcis", XC_X3LYP, "hyb-x3lyp",
XC_O3LYP, "hyb-o3lyp", XC_B97_1, "hyb-b97-1", XC_B97_2, "hyb-b97-2", XC_B98, "hyb-b98",
XC_revTPSSh, "hyb-revtpssh", XC_TPSS1KCIS, "hyb-tpss1kcis", XC_M11, "hyb-m11", XC_N12SX, "hyb-n12-sx",
XC_MN12SX, "hyb-mn12-sx", XC_MN12L, "hyb-mn12-l", XC_MN15, "hyb-mn15", XC_SCAN, "mgga-scan",
XC_B1B95, "hyb-b88b95" // (not a typo, b88bp5 commonly called b1b95)
);

#undef D3_XC_COMMON_MAP_ENTRIES

//Replace first occurence of target in s with replacement
inline void string_replace(string& s, string target, string replacement)
Expand All @@ -110,7 +147,7 @@ namespace D3

//! Set scale parameters s6, s8 and damping parameters sr6, sr8 for r^-6, r^-8 terms by name of XC functional xcName.
//! Note that xcName is canonicalized upon return, especially for LibXC functionals, to unify internal and LibXC names.
void setXCscale(string& xcName, double& s6, double& sr6, double& s8, double& sr8)
void setXCscale(string& xcName, bool useBJDamping, double& s6, double& sr6, double& s8, double& sr8)
{ //Canonicalize name:
if(xcName.substr(0, 3) == "lda") xcName = "lda"; //remove LDA suffixes
#ifdef LIBXC_ENABLED
Expand All @@ -130,43 +167,116 @@ namespace D3
#endif
//Find XC functional in supported list:
XC xc;
if(not xcMap.getEnum(xcName.c_str(), xc))
die("\nDFT-D3 parameterization not available for %s functional.\n\n", xcName.c_str());
if(useBJDamping)
{ if(not BJxcMap.getEnum(xcName.c_str(), xc))
die("\nDFT-D3(BJ) parameterization not available for %s functional.\n\n", xcName.c_str());
}
else
{ if(not xcMap.getEnum(xcName.c_str(), xc))
die("\nDFT-D3 parameterization not available for %s functional.\n\n", xcName.c_str());
}
//Set parameters:
s6 = 1.;
sr8 = 1.;
switch(xc)
{ case XC_LDA: { sr6 =0.999; s8 =-1.957; sr8=0.697; break; }
//GGAs:
case XC_PBE: { sr6=1.217; s8=0.722; break; }
case XC_PBESOL: { sr6=1.345; s8=0.612; break; }
case XC_RPBE: { sr6=0.872; s8=0.514; break; }
case XC_SSB: { sr6=1.215; s8=0.663; break; }
case XC_HCTH_120: { sr6=1.221; s8=1.206; break; }
//mGGAs:
case XC_TPSS: { sr6=1.166; s8=1.105; break; }
//Hybrids:
case XC_HF: { sr6=1.158; s8=1.746; break; }
case XC_PBE0: { sr6=1.287; s8=0.928; break; }
case XC_PBE38: { sr6=1.333; s8=0.998; break; }
case XC_HSE06: { sr6=1.129; s8=0.109; break; }
case XC_B3PW91: { sr6=1.176; s8=1.775; break; }
case XC_B3LYP: { sr6=1.261; s8=1.703; break; }
case XC_PW6B95: { sr6=1.532; s8=0.862; break; }
case XC_TPSS0: { sr6=1.252; s8=1.242; break; }
case XC_TPSSH: { sr6=1.223; s8=1.219; break; }
case XC_PWB6K: { sr6=1.660; s8=0.550; break; }
case XC_MPW1B95: { sr6=1.605; s8=1.118; break; }
case XC_MPWB1K: { sr6=1.671; s8=1.061; break; }
case XC_BMK: { sr6=1.931; s8=2.168; break; }
case XC_CAM_B3LYP: { sr6=1.378; s8=1.217; break; }
case XC_LC_WPBE: { sr6=1.355; s8=1.279; break; }
case XC_M05: { sr6=1.373; s8=0.595; break; }
case XC_M05_2X: { sr6=1.417; s8=0.000; break; }
case XC_M06_L: { sr6=1.581; s8=0.000; break; }
case XC_M06: { sr6=1.325; s8=0.000; break; }
case XC_M06_2X: { sr6=1.619; s8=0.000; break; }
case XC_M06_HF: { sr6=1.446; s8=0.000; break; }
//Note that for DFT-D3(BJ), sr6 and sr8 are actually a1/a2
if(useBJDamping) {
// s6 = 0.5;
s6 = 1.0;
switch(xc)
{
// GGAs:
// case XC_BOP: { s8=3.2950; sr6=0.4870; sr8=3.5043; break; } // 10.1039/C0CP02984J
case XC_PBE: { s8=0.7875; sr6=0.4289; sr8=4.4407; break; }
case XC_PBESOL: { s8=2.9491; sr6=0.4466; sr8=6.1742; break; } // 10.1039/C0CP02984J
// case XC_B97_D: { s8=2.2609; sr6=0.5545; sr8=3.2297; break; } // 10.1002/jcc.21759
// case XC_XLYP: { s8=1.5669; sr6=0.0809; sr8=5.3166; break; } // 10.1039/c7cp04913g
// case XC_HCTH_407: { s8=0.6490; sr6=0.0000; sr8=4.8162; break; } // 10.1039/c7cp04913g
// case XC_PW91: { s8=1.9598; sr6=0.6319; sr8=4.5718; break; } // 10.1073/pnas.1516984112
case XC_RPBE: { s8=0.8318; sr6=0.1820; sr8=4.0094; break; } // 10.1039/c7cp04913g
case XC_SSB: { s8=-0.1744; sr6=-0.0952; sr8=5.2170; break; } // 10.1039/C0CP02984J
// mGGAs:
case XC_TPSS: { s8=1.9435; sr6=0.4535; sr8=4.4752; break; } // 10.1002/jcc.21759
// case XC_revTPSS: { s8=1.4023; sr6=0.4426; sr8=4.4723; break; } // 10.1039/c7cp04913g
// case XC_tHCTH: { s8=1.2626; sr6=0.0000; sr8=5.6162; break; } // 10.1039/c7cp04913g
// case XC_SCAN: { s8=0.0; sr6=0.538; sr8=5.4200; break; } // 10.1103/physrevb.94.115144
case XC_R2SCAN: { s8=0.7898; sr6=0.4948; sr8=5.7308; break; } // 10.1063/5.0041008
case XC_RSCAN: { s8=1.0886; sr6=0.4702; sr8=5.7341; break; } // 10.1063/5.0041008
// Hybrids:
case XC_PBE0: { s8=1.2177 ; sr6=0.4145; sr8=4.8593; break; } // 10.1002/jcc.21759
case XC_PBE38: { s8=1.4623; sr6=0.3995; sr8=5.1405; break; } // 10.1039/C0CP02984J
// case XC_HSE03: { s8=1.1243; sr6=0.0000; sr8=6.8889; break; } // 10.1039/c7cp04913g
case XC_HSE06: { s8=2.3100; sr6=0.3830; sr8=5.6850; break; } // 10.1021/jp501237c
case XC_B3PW91: { s8=2.8524; sr6=0.4312; sr8=4.4693; break; } // 10.1039/C0CP02984J
// case XC_B3P86: { s8=3.3211; sr6=0.4601; sr8=4.9294; break; } // 10.1039/c7cp04913g
case XC_B3LYP: { s8=1.9889; sr6=0.3981; sr8=4.4211; break; } // 10.1002/jcc.21759
// case XC_B1LYP: { s8=2.1167; sr6=0.1986; sr8=5.3875; break; } // 10.1039/c7cp04913g
// case XC_MPW1PW91: { s8=1.8744; sr6=0.3342; sr8=4.9819; break; } // 10.1039/c7cp04913g
// case XC_MPW1KCIS: { s8=1.0893; sr6=0.0576; sr8=5.5314; break; } // 10.1039/c7cp04913g
// case XC_MPWKCIS1K: { s8=1.2875; sr6=0.0855; sr8=5.8961; break; } // 10.1039/c7cp04913g
// case XC_PBE1KCIS: { s8=0.7688; sr6=0.0000; sr8=6.2794; break; } // 10.1039/c7cp04913g
// case XC_X3LYP: { s8=1.5744; sr6=0.2022; sr8=5.4184; break; } // 10.1039/c7cp04913g
// case XC_O3LYP: { s8=1.8171; sr6=0.0963; sr8=5.9940; break; } // 10.1039/c7cp04913g
// case XC_B97_1: { s8=0.4814; sr6=0.0000; sr8=6.2279; break; } // 10.1039/c7cp04913g
// case XC_B97_2: { s8=0.9448; sr6=0.0000; sr8=5.4603; break; } // 10.1039/c7cp04913g
// case XC_B98: { s8=0.7086; sr6=0.0000; sr8=6.0672; break; } // 10.1039/c7cp04913g
// case XC_BHLYP: { s8=1.0354; sr6=0.2793; sr8=4.9615; break; } // 10.1039/C0CP02984J
case XC_CAM_B3LYP: { s8=2.0674; sr6=0.3708; sr8=5.4743; break; } // 10.1039/C0CP02984J
case XC_PW6B95: { s8=0.7257; sr6=0.2076; sr8=6.3750; break; } // 10.1002/jcc.21759
case XC_TPSS0: { s8=1.2576; sr6=0.3768; sr8=4.5865; break; } // 10.1002/jcc.21759
// case XC_TPSS1KCIS: { s8=1.0542; sr6=0.0000; sr8=6.0201; break; } // 10.1039/c7cp04913g
case XC_TPSSH: { s8=0.4243; sr6=0.00; sr8=5.5253; break; } // 10.1039/C0CP02984J
// case XC_revTPSSh: { s8=1.4076; sr6=0.2660; sr8=5.3761; break; } // 10.1039/c7cp04913g
// case XC_M11: { s8=2.8112; sr6=0.0000; sr8=10.1389; break; } // 10.1021/acs.jpclett.5b01591
// case XC_N12SX: { s8=2.4900; sr6=0.3283; sr8=5.7898; break; } // 10.1021/acs.jpclett.5b01591
// case XC_MN12SX: { s8=1.1674; sr6=0.0983; sr8=8.0259; break; } // 10.1021/acs.jpclett.5b01591
// case XC_MN12L: { s8=2.2674; sr6=0.0000; sr8=9.1494; break; } // 10.1021/acs.jpclett.5b01591
// case XC_MN15: { s8=0.7862; sr6=2.0971; sr8=7.5923; break; } // 10.1039/c7cp04913g
case XC_PWB6K: { s8=0.9383; sr6=0.1805; sr8=7.7627; break; } // 10.1039/C0CP02984J
case XC_MPW1B95: { s8=1.0508; sr6=0.1955; sr8=6.4177; break; } // 10.1039/C0CP02984J
case XC_MPWB1K: { s8=0.9499; sr6=0.1474; sr8=6.6223; break; } // 10.1039/C0CP02984J
case XC_BMK: { s8=2.0860; sr6=0.1940; sr8=5.9197; break; } // 10.1039/C0CP02984J
// case XC_B1B95: { s8=1.4507; sr6=0.2092; sr8=5.5545; break; } // 10.1039/C0CP02984J
case XC_LC_WPBE: { s8=1.8541; sr6=0.3919; sr8=5.0897; break; } // 10.1039/C0CP02984J
case XC_HF: { s8=0.9171; sr6=0.3385; sr8=2.883; break; } // 10.1002/jcc.21759
default:
die("\nDFT-D3(BJ) not currently supported for %s functional. Please use zero-damping form. \n\n", xcName.c_str());
}
} else {
s6 = 1.;
sr8 = 1.;
switch(xc)
{ case XC_LDA: { sr6 =0.999; s8 =-1.957; sr8=0.697; break; }
//GGAs:
case XC_PBE: { sr6=1.217; s8=0.722; break; }
case XC_PBESOL: { sr6=1.345; s8=0.612; break; }
case XC_RPBE: { sr6=0.872; s8=0.514; break; }
case XC_SSB: { sr6=1.215; s8=0.663; break; }
case XC_HCTH_120: { sr6=1.221; s8=1.206; break; }
//mGGAs:
case XC_TPSS: { sr6=1.166; s8=1.105; break; }
//Hybrids:
case XC_HF: { sr6=1.158; s8=1.746; break; }
case XC_PBE0: { sr6=1.287; s8=0.928; break; }
case XC_PBE38: { sr6=1.333; s8=0.998; break; }
case XC_HSE06: { sr6=1.129; s8=0.109; break; }
case XC_B3PW91: { sr6=1.176; s8=1.775; break; }
case XC_B3LYP: { sr6=1.261; s8=1.703; break; }
case XC_PW6B95: { sr6=1.532; s8=0.862; break; }
case XC_TPSS0: { sr6=1.252; s8=1.242; break; }
case XC_TPSSH: { sr6=1.223; s8=1.219; break; }
case XC_PWB6K: { sr6=1.660; s8=0.550; break; }
case XC_MPW1B95: { sr6=1.605; s8=1.118; break; }
case XC_MPWB1K: { sr6=1.671; s8=1.061; break; }
case XC_BMK: { sr6=1.931; s8=2.168; break; }
case XC_CAM_B3LYP: { sr6=1.378; s8=1.217; break; }
case XC_LC_WPBE: { sr6=1.355; s8=1.279; break; }
case XC_M05: { sr6=1.373; s8=0.595; break; }
case XC_M05_2X: { sr6=1.417; s8=0.000; break; }
case XC_M06_L: { sr6=1.581; s8=0.000; break; }
case XC_M06: { sr6=1.325; s8=0.000; break; }
case XC_M06_2X: { sr6=1.619; s8=0.000; break; }
case XC_M06_HF: { sr6=1.446; s8=0.000; break; }
default:
die("\nDFT-D3 not currently supported for %s functional. Please use BJ-damping form. \n\n", xcName.c_str());
}
}
}

Expand Down