Create topography files and data files
In [ ]:
%run make_topo.py
In [ ]:
%run make_data.py
Run code in serial mode (will work, even if code is compiled with MPI)
In [ ]:
!bowl
Or, run code in parallel mode (command may need to be customized, depending your on MPI installation.)
In [ ]:
#!mpirun -n 4 bowl
Create PNG files for web-browser viewing, or animation.
In [ ]:
%run make_plots.py
View PNG files in browser, using URL above, or create an animation of all PNG files, using code below.
In [ ]:
%pylab inline
In [ ]:
import glob
from matplotlib import image
from clawpack.visclaw.JSAnimation import IPython_display
from matplotlib import animation
def init():
im.set_data(image.imread(filenames[0]))
return im,
def animate(i):
image_i=image.imread(filenames[i])
im.set_data(image_i)
return im,
Plot figure 0, showing the entire solution. To see detailed plotting parameters, see file make_plots.py.
In [ ]:
figno = 0
fname = '_plots/*fig' + str(figno) + '.png'
filenames = sorted(glob.glob(fname))
fig = plt.figure()
im = plt.imshow(image.imread(filenames[0]))
animation.FuncAnimation(fig, animate, init_func=init,
frames=len(filenames), interval=500, blit=True)
Then plot figures 10 and 11 to compare the solution in the two refined regions.
In [ ]:
figno = 10
fname = '_plots/*fig' + str(figno) + '.png'
filenames = sorted(glob.glob(fname))
fig = plt.figure()
im = plt.imshow(image.imread(filenames[0]))
animation.FuncAnimation(fig, animate, init_func=init,
frames=len(filenames), interval=500, blit=True)