next up previous contents
Next: Debugging Up: Exchange-correlation energy Previous: Debugging

``getVxc'' and ``getDepsxc''

getVxc(double Vxc[], double Rho[], double r[], double dr[], int N)

getDepsxc(double Depsxc[], double Rho[], double r[], double dr[], int N)
Output: Input:

Write routines of the above prototypes which (a) loop over all grid points k, (b) convert our variable Rho[] to the true value of the density, (c) evaluate rs, (d) call upon excPZ and excpPZ, and (e) evaluate tex2html_wrap_inline406 and tex2html_wrap_inline408 according to Eqs. (1,2). There are two special cases to consider to avoid NaNs corrupting your data. At the origin (k=0), n=Rho[0]/r[0] gives NaN, and, at infinity, (k=N), Rho=0. Thus, if either k=0 or Rho<SMALL, your routine should set Vxc=0 and Depsxc=0. (Recall that we #define SMALL 1e-300.)

Hint: In Eqs. (1,2) tex2html_wrap_inline412 refers to tex2html_wrap_inline414 , whereas ``excpPZ'' returns tex2html_wrap_inline380 . You therefore must multiply the return value of ``excpPZ'' by tex2html_wrap_inline418 to evaluate tex2html_wrap_inline412 in Eqs. (1,2).





Tomas Arias
Wed Mar 8 14:29:40 EST 2000