Skip to content

Commit

Permalink
Decrease P86C fudge factor from 1e-12 to DBL_EPSILON. (#162)
Browse files Browse the repository at this point in the history
* Decrease P86 fudge factor from 1e-12 to DBL_EPSILON.

* Missed an instance of broken text in a previous commit
  • Loading branch information
susilehtola authored May 2, 2022
1 parent 5eb0419 commit 6c82faa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/functionals/p86c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "constants.hpp"
#include "functional.hpp"
#include "pz81c.hpp"
#include <cfloat>

template <typename num> static num Cg(const num & r) {
parameter Cx = 0.001667;
Expand All @@ -26,7 +27,7 @@ template <typename num> static num Cg(const num & r) {
template <typename num> static num Pg(const densvars<num> & d) {
parameter Fg = 0.11;
parameter Cinf = 0.004235;
parameter fudge = 1e-12; // Avoid instability at d.gnn = 0
parameter fudge = DBL_EPSILON; // Avoid instability at d.gnn = 0
#ifndef INEXACT_PI
parameter pi_expr = pow(9 * M_PI, 1.0 / 6.0);
#else
Expand All @@ -52,8 +53,8 @@ template <typename num> static num p86c_corr(const densvars<num> & d) {

FUNCTIONAL(XC_P86C) = {
"P86C GGA correlation",
"J.P. Density-functional approximation for the correlation energy\n"
"of the inhomogeneous electron , Phys. Rev. B, 33(12):8822gasPerdew,\n"
"J. P. Perdew, Density-functional approximation for the correlation energy\n"
"of the inhomogeneous electron, Phys. Rev. B 33, 8822 (1986).\n"
"Implemented by Ulf Ekstrom.\n"
"Reference data from ftp://ftp.dl.ac.uk/qcg/dft_library/data_pt_c_p86.html",
XC_DENSITY | XC_GRADIENT,
Expand Down

0 comments on commit 6c82faa

Please sign in to comment.