void evalG(Complex (*func)(d3vec,double),double dparam)Input:
- func: function to be evaluated for all G-vectors
- dparam: parameter to be passed to the function
Output:
- dat[i][j][k]: set to values of func(G,dparam) evaluated on coefficient-space point G corresponding to [i][j][k], taking proper account of aliasing and setting the values of dat for the Nyquist frequencies (where i=N.x/2, j=N.y/2 or k=N.z/2) to zero. (This is because G isn't clearly defined at these Nyquist frequencies.)
To be able to compute J(rhonuc), add a function of the above prototype
to your definition of the pvector class.
Hint: The general structure of this function is the same as the
evalr() function which you wrote for HW#7, but, rather than passing
real-space points
where
,
to func, this routine passes G-vectors as defined in class with
proper aliasing,
where
means take whichever value of x or y
has the least absolute value, while maintaining the sign of the
number. (I.e.,
and
.) Note that these
G-vectors use the same contruction as you followed in making the L()
and Linv() operators.