/* From "COMPUTATIONAL PHYSICS", 3rd Ed, Enlarged Python eTextBook by RH Landau, MJ Paez, and CC Bordeianu Copyright Wiley-VCH Verlag GmbH & Co. KGaA, Berlin; Copyright R Landau, Oregon State Unv, MJ Paez, Univ Antioquia, C Bordeianu, Univ Bucharest, 2015. Support by National Science Foundation laplace.c * comment: Output data is saved in 3D grid format used by gnuplot * ************************************************************************ */ #include #define max 40 /* number of grid points */ main() { double x, p[max][max]; int i, j, iter, y; FILE *output; /* save data in laplace.dat */ output = fopen("laplace.dat","w"); for(i=0; i