next up previous contents
Next: Debugging Up: Packaging Previous: Debugging

``getphi''

void getphi(double phi[], double Rho[], double r[], double dr[], int N)

Output:

Input:

Package your previous Poisson solver program into a routine of the above prototype. Be sure to use ``interpolate'' to find the values on the odd grid points after you have done the Runge-Kutta integration, but before dividing Phi[k] by r[k]. Finally, because your input is now Rho[k] tex2html_wrap_inline391 4*pi*r[k]*r[k]*rho[k] instead of just rho[k], you must modify ``derivs_Poisson'' so that it now contains a code fragment of the form

            .
            .
  dydx[1]=y[2]*dr[k];
  dydx[2]=-Rho[k]/r[k]*dr[k];
            .
            .




Tomas Arias
Fri Mar 3 11:23:54 EST 2000