From 343349c7493a4aa1fd5c3ff92d1fa8f60fac9ba1 Mon Sep 17 00:00:00 2001
From: "W. Trevor King"
gcc poisson_2d.c -lm -o poisson_2d -./poisson_2d N Nx Ny | ./plot_image.py -s Nx Ny -t "2d Poisson" +./poisson_2d N Nx Ny | ./plot_image.py -s Nx,Ny -t "2d Poisson"
where N
, Nx
and Ny
are the
(arbitrary) maximum number of iterations and number of grid points
(image size) respectively. Good numbers to use could be 10000, 300,
-300. We
-introduced plot_image.py
-in Programming Strategies:
-Color Images.
The code stops once good convergence (parameter EPS
)
is obtained.
The Python -program display_frames_GTK.py +program display_frames_GTK.py accepts the image content for each frame in the movie. It uses the same notation for each frame as that of the previously -used plot_image.py +used plot_image.py for single image. It loops over the frames until the end of stream, at which point it crashes. The syntax to display the Game of Life above is:
diff --git a/content/programming_strategies/index.shtml.itex2MML b/content/programming_strategies/index.shtml.itex2MML index 3f7b4eb..622f099 100644 --- a/content/programming_strategies/index.shtml.itex2MML +++ b/content/programming_strategies/index.shtml.itex2MML @@ -193,10 +193,11 @@ must translate the function range to a color palette range. For our purpose, this tool must read in a 2-dimensional array containing the values of $f(x,y)$ on a 2-dimensional lattice and produce the color image. The Python script plot_image.py does precisely this. It is -based on matplotlib -(the tutorials, user's guide and examples found in the matplotlib site -are easier to read with some previous knowledge of plot_image.py does +precisely this. It is based on matplotlib (the +tutorials, user's guide and examples found in the matplotlib site are +easier to read with some previous knowledge of Python and Numerical Python). diff --git a/src/poisson_2d/P_2d.c b/src/poisson_2d/P_2d.c index d885818..e16928b 100644 --- a/src/poisson_2d/P_2d.c +++ b/src/poisson_2d/P_2d.c @@ -16,7 +16,7 @@ gcc poisson_2d.c -lm -o poisson_2d -./poisson_2d N N_x N_y | plot_image.py -s N_x N_y -t "2d Poisson" +./poisson_2d N N_x N_y | plot_image.py -s N_x,N_y -t "2d Poisson" */ diff --git a/src/poisson_2d/poisson_2d.c b/src/poisson_2d/poisson_2d.c index d885818..e16928b 100644 --- a/src/poisson_2d/poisson_2d.c +++ b/src/poisson_2d/poisson_2d.c @@ -16,7 +16,7 @@ gcc poisson_2d.c -lm -o poisson_2d -./poisson_2d N N_x N_y | plot_image.py -s N_x N_y -t "2d Poisson" +./poisson_2d N N_x N_y | plot_image.py -s N_x,N_y -t "2d Poisson" */ -- 2.26.2