getVxc(double Vxc[], double Rho[], double r[], double dr[], int N) getDepsxc(double Depsxc[], double Rho[], double r[], double dr[], int N)Output:Input:
- Vxc[k]:
for all grid points r[k]
- Depsxc[k]:
for all grid points r[k]
- Rho[k]:
for all grid points r[k]
- r, dr, N: standard grid information
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
and
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)
refers to
, whereas ``excpPZ'' returns
. You therefore must
multiply the return value of ``excpPZ'' by
to
evaluate
in Eqs. (1,2).