from IPython.core.display import HTML
css_file = '../style/style.css'
HTML(open(css_file, "r").read())
The objective of this workshop is to work on simple cases that may allow the student to experience some example applications of the GeoClaw software, completely functional in a virtual machine, and that may serve as starting point to model more complex scenarios.
GeoClaw is a part of ClawPack, a free open source software developed by the University of Washington. It consists of several packages that by means of numerical methods integrate a family of partial differential equations often called conservation laws, and hence the name: ClawPack = Conservation Laws Package. Geoclaw specializes at solving geophysical problems, as tsunamis, storm-surges amongst others.
In our case, it allows us to solve the initial boundary value problem (IBVP) of the Non Linear Shallow Water Equations including strong variations in topography, bottom friction and handling shock waves (discontinuities) by solving a ** Riemann problem** between each cell's interface. Also, to improve the performance of the computations it employes adaptive grids, that allow to vary the grid size (say $\Delta x$) both in space and time.
In case you do not understand some of the words in bold, I suggest you to investigate. There exists excelent material for studying on the internet, for example that of the PASI-TSUNAMI course that took place the year 2013 at the Federico Santa María university in Valparaíso, Chile.
The (excelent) documentation, license information, contribution guidelines (in case you are interested in cooperating as developer), and other topics can be found in the official site.
Jupyter notebooks are documents that can be edited using a web-based user interface. As they describe it
The Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text
They split their content in cells, which can contain code or formatted text, and you can also write/append its content to a file. At the begining you will probably only work with the toolbar and menus at the top of the page, but what I recommend the most is to memorize some keyboard shortcuts. At least the ones I use are:
When out of edit mode, select a cell and use the following
You can find more in the dropdown menu Help > Keyboard Shortcuts
We will simulate a partial dambreak over a horizontal rectangular channel. First we shall see how to define the topography, including the vertical wall that defines the dam. Also we will see that the initial condition can be defined in a very similar way. Later we will examine some parameters in the setrun.py file that will set the simulation run!, and also the output we want to generate. To run the simulation we will make use of some make commands in the Makefile file. Finally, with the setplot.py file we will set how our figures shall look like, and we will see that output we configured before.
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
Here we are interested in defining the data of the topography and initial condition of the water, and writing it to files that will be read-able by GeoClaw.
The topography consists of a horizontal channel of 200 meter width, that contains a dam behind a wall of 15m height. The water height is 10m in the dam and 5m in the channel. More concretelly, our computational domain will consist of the sets of points
$$(x,y)\in[-100,100]\times[-100,100]$$and the wall by
$$(x,y): |x-2.0|<2.5, y\in[-100,-70]\cup[5,100]$$One way of defining the topography is by creating a function that receives two numpy.ndarrays $x,y$ and returns an array $z$ with the respective values for the floor elevation.
def topofunction(x,y):
"""
The topography: flat floor everywhere
except for the reservoir walls
"""
z = np.zeros(x.shape)
z = np.where( (np.abs(x-2.)<2.5)*(y<-70.), 15., z)
z = np.where( (np.abs(x-2.)<2.5)*(y>5.), 15.,z)
return z+1e-10 #+1e-10 to avoid a bug in the plotting functions later
Notice that we made use of the numpy where function. You can see its docstring by executing the following cell.
np.where?
We will sample this function using $100$ points in each horizontal direction, and for this, we will use the topotools.topo2writer predefined GeoClaw function, that will write this data in GeoClaw number 2 topography format. You can see an accurate description of this data format here.
from clawpack.geoclaw import topotools
def maketopo():
"""
topo2 format for topography
"""
xupper = 100.
yupper = 100.
xlower = -100.
ylower = -100.
nxpoints= 100
nypoints= 100
outfile= "channel.topotype2"
topotools.topo2writer(outfile,topofunction,xlower,xupper,ylower,yupper,nxpoints,nypoints)
maketopo();
And to be sure that everything worked well, we will ask GeoClaw to plot the data we just wrote.
topo = topotools.Topography('channel.topotype2',topo_type=2)
topo.plot()
/home/jose/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_base.py:1215: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if aspect == 'normal': /home/jose/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_base.py:1220: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal elif aspect in ('equal', 'auto'):
<matplotlib.axes._subplots.AxesSubplot at 0x7f4977de9e10>
Now we do the same with the initial condition by setting only the free surface elevation.
You can see here that what will actually be defining is a perturbation on the default value of the free surface, which is 0. Also you will notice that later in the setrun.py we will pass this data to geoclaw, indicating what kind of initial condition this is (if depth, free surface, xmomentum or ymomentum perturbation).
def qinitfunction(x,y):
"""
Dry above the walls. 10 m height in the left side
5m in the right side.
"""
z = np.zeros(x.shape)
z = np.where( (np.abs(x-2.)<2.5)*(y<-70.), 15., z)
z = np.where( (np.abs(x-2.)<2.5)*(y>5.), 15.,z)
h = np.zeros_like(z)
h = np.where( x<=-0,10.,5.)
h = np.where( z>0.,0.,h)
return h
def makeqinit():
"""
topo1 format for qinit
"""
xupper = 100.
yupper = 100.
xlower = -100.
ylower = -100.
nxpoints= 100
nypoints= 100
outfile= "qinit.topotype1"
topotools.topo1writer(outfile,qinitfunction,xlower,xupper,ylower,yupper,nxpoints,nypoints)
makeqinit()
from clawpack.visclaw import colormaps
qinit = topotools.Topography('qinit.topotype1',topo_type=1)
qinit.plot(cmap=colormaps.blue_white_red)
<matplotlib.axes._subplots.AxesSubplot at 0x7f4975840b10>
To run a simulation we need to define a python script called setrun.py file. Also it is mandatory to have in the same folder a file called Makefile which you won't need to edit, but only to make sure it is there: this is the one responsible for gathering and translating all the code into a machine executable file. On the other side, through the setrun.py we will define all the parameters such as simulation final time, and link the topography and initial condition data files we created before.
You will see the setrun.py is quite long, but there is only a few sections we are commonly interested on editing.
GeoClaw asks you to define refinement regions that define the extent in space and time, over which you want to allow it to use finer grids. What you have to define beforehand is:
A list of refinement ratios (integer numbers), say $r_x =[r_2,...,r_l]$, with $l$ the number of refinement levels in the simulation, such that $$\dfrac{\Delta x_{1}}{\Delta x_{2}} = r_1, \dfrac{\Delta x_{2}}{\Delta x_{3}} = r_2$$, and so on. Notice that $\Delta x_1$ is the cell size of the coarsest level, which covers the full domain.
(optional) A list of refinement regions with min and max level of refinement level allowed in a rectangle inside the domain, for a given time interval of the simulation.
Given the restrictions in 2., GeoClaw will try to refine up to the highest level defined in 1, when a specific criteria is satisfied. If you don't define 2., GeoClaw will assume you allow the maximum level of refinement everywhere. The criteria of refinement is when the amplitude of the wave, with respect to the default sea-level is greater than a defined tolerance (of course, the tolerance is also defined in the setrun.py).
This is the most important file, and all of its fields are well explained in detail here. Those which are of most interest to us can be found in the following sections:
Extent of the computational domain, and resolution of the coarser level.
# ---------------
# Spatial domain:
# ---------------
...
Simulation instants when you want to save the whole simulation state to a file. Be careful with this, since it can grow large very easily.
# -------------
# Output times:
#--------------
...
Time step configuration of the simulation. Normally you will only edit the "CFL_..." parameters, when the computation misteriously "blows up".
# --------------
# Time stepping:
# --------------
...
Boundary conditions: There is only "closed" (reflective) and "open" (extrapolation) boundaries. More complex boundary conditions must be programed in fortran by the user.
# --------------------
# Boundary conditions:
# --------------------
...
Adaptive Refinement parameters and output virtual gauges location.
# ---------------
# AMR parameters:
# ---------------
...
Other geophysical related parameters such as the wave_tolerance for adaptive refinement, bottom friction, coordinate sistem (lat-lon or cartesian), amongst others.
#-------------------
def setgeo(rundata):
#-------------------
...
I suggest you to read the setrun.py carefully once, but then just "ctrl+f" the section enclosed in "#-----" that is of your interest
We will use the ipython %%writefile magic function, this will allow us to write all the content in a cell (except for the first line) in the specified file.
If you are wondering, I just copy-pasted an existing setrun.py file from the geoclaw examples directory, and then modified its content to fulfill this requirements of this example.
You can execute
%%writefile?
to see its docstring.
We will configure this file with the domain extent we already defined at the begining, and set it carefully to use the topography and initial condition files we created before. We will also set the following
We will use a total of 3 refinement levels and regions. We want 1 that covers the whole domain that ensures the coarsest level is used outside the region of interest, and other 2 downstream. The refinement ratios are $r_2 = 4$ and $r_3 = 4$ (which means the coarsest grid will have 16 times the width of the finest). The regions will be:
We will produce 'snapshot' output files every 1 second in the simulation up to 30 seconds.
We want to store virtual gauges at the following locations
0: [-50.,0.]
1: [0.,0.]
2: [40.,0]
3: [75.,0.]
4: [75.,-30.]
%%writefile setrun.py
# %load setrun.py
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#------------------------------
def setrun(claw_pkg='geoclaw'):
#------------------------------
"""
Define the parameters used for running Clawpack.
INPUT:
claw_pkg expected to be "geoclaw" for this setrun.
OUTPUT:
rundata - object of class ClawRunData
"""
from clawpack.clawutil import data
assert claw_pkg.lower() == 'geoclaw', "Expected claw_pkg = 'geoclaw'"
num_dim = 2
rundata = data.ClawRunData(claw_pkg, num_dim)
#------------------------------------------------------------------
# GeoClaw specific parameters:
#------------------------------------------------------------------
rundata = setgeo(rundata)
#------------------------------------------------------------------
# Standard Clawpack parameters to be written to claw.data:
# (or to amr2ez.data for AMR)
#------------------------------------------------------------------
clawdata = rundata.clawdata # initialized when rundata instantiated
# Set single grid parameters first.
# See below for AMR parameters.
# ---------------
# Spatial domain:
# ---------------
# Number of space dimensions:
clawdata.num_dim = num_dim
# Lower and upper edge of computational domain:
clawdata.lower[0] = -100.0
clawdata.upper[0] = 100.0
clawdata.lower[1] = -100.0
clawdata.upper[1] = 100.0
# Number of grid cells: Coarsest grid
clawdata.num_cells[0] = 20
clawdata.num_cells[1] = 20
# ---------------
# Size of system:
# ---------------
# Number of equations in the system:
clawdata.num_eqn = 3
# Number of auxiliary variables in the aux array (initialized in setaux)
clawdata.num_aux = 1
# Index of aux array corresponding to capacity function, if there is one:
clawdata.capa_index = 0
# -------------
# Initial time:
# -------------
clawdata.t0 = 0.0
# Restart from checkpoint file of a previous run?
# Note: If restarting, you must also change the Makefile to set:
# RESTART = True
# If restarting, t0 above should be from original run, and the
# restart_file 'fort.chkNNNNN' specified below should be in
# the OUTDIR indicated in Makefile.
clawdata.restart = False # True to restart from prior results
clawdata.restart_file = 'fort.chk00006' # File to use for restart data
# -------------
# Output times:
#--------------
# Specify at what times the results should be written to fort.q files.
# Note that the time integration stops after the final output time.
# The solution at initial time t0 is always written in addition.
clawdata.output_style = 1
if clawdata.output_style == 1:
# Output nout frames at equally spaced times up to tfinal:
clawdata.num_output_times = 30
clawdata.tfinal = 30.
clawdata.output_t0 = True # output at initial (or restart) time?
elif clawdata.output_style == 2:
# Specify a list of output times.
clawdata.output_times = [0.5, 1.0]
elif clawdata.output_style == 3:
# Output every iout timesteps with a total of ntot time steps:
clawdata.output_step_interval = 1
clawdata.total_steps = 1
clawdata.output_t0 = True
clawdata.output_format = 'ascii' # 'ascii' or 'netcdf'
clawdata.output_q_components = 'all' # could be list such as [True,True]
clawdata.output_aux_components = 'none' # could be list
clawdata.output_aux_onlyonce = True # output aux arrays only at t0
# ---------------------------------------------------
# Verbosity of messages to screen during integration:
# ---------------------------------------------------
# The current t, dt, and cfl will be printed every time step
# at AMR levels <= verbosity. Set verbosity = 0 for no printing.
# (E.g. verbosity == 2 means print only on levels 1 and 2.)
clawdata.verbosity = 0
# --------------
# Time stepping:
# --------------
# if dt_variable==1: variable time steps used based on cfl_desired,
# if dt_variable==0: fixed time steps dt = dt_initial will always be used.
clawdata.dt_variable = True
# Initial time step for variable dt.
# If dt_variable==0 then dt=dt_initial for all steps:
clawdata.dt_initial = 0.0001
# Max time step to be allowed if variable dt used:
clawdata.dt_max = 1e+99
# Desired Courant number if variable dt used, and max to allow without
# retaking step with a smaller dt:
clawdata.cfl_desired = 0.75
clawdata.cfl_max = 0.85
# Maximum number of time steps to allow between output times:
clawdata.steps_max = 5000
# ------------------
# Method to be used:
# ------------------
# Order of accuracy: 1 => Godunov, 2 => Lax-Wendroff plus limiters
clawdata.order = 2
# Use dimensional splitting? (not yet available for AMR)
clawdata.dimensional_split = 'unsplit'
# For unsplit method, transverse_waves can be
# 0 or 'none' ==> donor cell (only normal solver used)
# 1 or 'increment' ==> corner transport of waves
# 2 or 'all' ==> corner transport of 2nd order corrections too
clawdata.transverse_waves = 2
# Number of waves in the Riemann solution:
clawdata.num_waves = 3
# List of limiters to use for each wave family:
# Required: len(limiter) == num_waves
# Some options:
# 0 or 'none' ==> no limiter (Lax-Wendroff)
# 1 or 'minmod' ==> minmod
# 2 or 'superbee' ==> superbee
# 3 or 'mc' ==> MC limiter
# 4 or 'vanleer' ==> van Leer
clawdata.limiter = ['mc', 'mc', 'mc']
clawdata.use_fwaves = True # True ==> use f-wave version of algorithms
# Source terms splitting:
# src_split == 0 or 'none' ==> no source term (src routine never called)
# src_split == 1 or 'godunov' ==> Godunov (1st order) splitting used,
# src_split == 2 or 'strang' ==> Strang (2nd order) splitting used, not recommended.
clawdata.source_split = 'godunov'
# --------------------
# Boundary conditions:
# --------------------
# Number of ghost cells (usually 2)
clawdata.num_ghost = 2
# Choice of BCs at xlower and xupper:
# 0 => user specified (must modify bcN.f to use this option)
# 1 => extrapolation (non-reflecting outflow)
# 2 => periodic (must specify this at both boundaries)
# 3 => solid wall for systems where q(2) is normal velocity
clawdata.bc_lower[0] = 3
clawdata.bc_upper[0] = 1
clawdata.bc_lower[1] = 3
clawdata.bc_upper[1] = 3
# Specify when checkpoint files should be created that can be
# used to restart a computation.
clawdata.checkpt_style = 0
if clawdata.checkpt_style == 0:
# Do not checkpoint at all
pass
elif clawdata.checkpt_style == 1:
# Checkpoint only at tfinal.
pass
elif clawdata.checkpt_style == 2:
# Specify a list of checkpoint times.
clawdata.checkpt_times = [0.1,0.15]
elif clawdata.checkpt_style == 3:
# Checkpoint every checkpt_interval timesteps (on Level 1)
# and at the final time.
clawdata.checkpt_interval = 5
# ---------------
# AMR parameters:
# ---------------
amrdata = rundata.amrdata
# max number of refinement levels:
amrdata.amr_levels_max = 2
# List of refinement ratios at each level (length at least mxnest-1)
amrdata.refinement_ratios_x = [4,4]
amrdata.refinement_ratios_y = [4,4]
amrdata.refinement_ratios_t = [2,6]
# Specify type of each aux variable in amrdata.auxtype.
# This must be a list of length maux, each element of which is one of:
# 'center', 'capacity', 'xleft', or 'yleft' (see documentation).
amrdata.aux_type = ['center']
# Flag using refinement routine flag2refine rather than richardson error
amrdata.flag_richardson = False # use Richardson?
amrdata.flag2refine = True
# steps to take on each level L between regriddings of level L+1:
amrdata.regrid_interval = 3
# width of buffer zone around flagged points:
# (typically the same as regrid_interval so waves don't escape):
amrdata.regrid_buffer_width = 3
# clustering alg. cutoff for (# flagged pts) / (total # of cells refined)
# (closer to 1.0 => more small grids may be needed to cover flagged cells)
amrdata.clustering_cutoff = 0.700000
# print info about each regridding up to this level:
amrdata.verbosity_regrid = 0
# ----- For developers -----
# Toggle debugging print statements:
amrdata.dprint = False # print domain flags
amrdata.eprint = False # print err est flags
amrdata.edebug = False # even more err est flags
amrdata.gprint = False # grid bisection/clustering
amrdata.nprint = False # proper nesting output
amrdata.pprint = False # proj. of tagged points
amrdata.rprint = False # print regridding summary
amrdata.sprint = False # space/memory output
amrdata.tprint = False # time step reporting each level
amrdata.uprint = False # update/upbnd reporting
# More AMR parameters can be set -- see the defaults in pyclaw/data.py
# == setregions.data values ==
regions = rundata.regiondata.regions
# to specify regions of refinement append lines of the form
regions.append([1,1,0.,1e10,-100.,100.,-100.,100.])
regions.append([2,2,0.,1e10,-10.,10.,-100.,100.])
regions.append([1,10,0.,1e10,50,100.,-80.,-25])
# regions.append([0,10,0.,1e10,-10.,100.,-30.,30.])
# [minlevel,maxlevel,t1,t2,x1,x2,y1,y2]
# == setgauges.data values ==
# for gauges append lines of the form [gaugeno, x, y, t1, t2]
rundata.gaugedata.gauges.append([0,-50.,0.,0,1e10])
rundata.gaugedata.gauges.append([1,0.,0.,0,1e10])
rundata.gaugedata.gauges.append([2,40.,0.,0,1e10])
rundata.gaugedata.gauges.append([3,75.,0.,0,1e10])
rundata.gaugedata.gauges.append([4,75.,-30.,0,1e10])
return rundata
# end of function setrun
# ---------------------- amrdata.refinement_ratios_x = [4,4]
amrdata.refinement_ratios_y = [4,4]
amrdata.refinement_ratios_t = [2,6]
#-------------------
def setgeo(rundata):
#-------------------
"""
Set GeoClaw specific runtime parameters.
For documentation see ....
"""
try:
geo_data = rundata.geo_data
except:
print "*** Error, this rundata has no geo_data attribute"
raise AttributeError("Missing geo_data attribute")
# == Physics ==
geo_data.gravity = 9.81
geo_data.coordinate_system = 1
geo_data.earth_radius = 6367.5e3
# == Forcing Options
geo_data.coriolis_forcing = False
# == Algorithm and Initial Conditions ==
geo_data.sea_level = 0.
geo_data.dry_tolerance = 1.e-2
geo_data.friction_forcing = False
geo_data.manning_coefficient = 0.0
geo_data.friction_depth = 1.e6
# Refinement data
refinement_data = rundata.refinement_data
refinement_data.wave_tolerance = 5.
refinement_data.deep_depth = 1e2
refinement_data.max_level_deep = 3
refinement_data.variable_dt_refinement_ratios = False
# == settopo.data values ==
topo_data = rundata.topo_data
# for topography, append lines of the form
# [topotype, minlevel, maxlevel, t1, t2, fname]
topo_data.topofiles.append([2, 0, 10,0.,1e10, 'channel.topotype2'])
# == setdtopo.data values ==
dtopo_data = rundata.dtopo_data
# for moving topography, append lines of the form : (<= 1 allowed for now!)
# [topotype, minlevel,maxlevel,fname]
# == setqinit.data values ==
rundata.qinit_data.qinit_type = 4
rundata.qinit_data.qinitfiles = []
# for qinit perturbations, append lines of the form: (<= 1 allowed for now!)
# [minlev, maxlev, fname]
rundata.qinit_data.qinitfiles.append([0,10,'qinit.topotype1'])
# == setfixedgrids.data values ==
fixedgrids = rundata.fixed_grid_data
# for fixed grids append lines of the form
# [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\
# ioutarrivaltimes,ioutsurfacemax]
#fixedgrids.fixedgrids.append([0.,60.,60,-100.,100.,-100.,100.0,100,100,\
# 0,0])
# == fgmax.data values ==
fgmax_files = rundata.fgmax_data.fgmax_files
# for fixed grids append to this list names of any fgmax input files
return rundata
# end of function setgeo
# ----------------------
if __name__ == '__main__':
# Set up run-time parameters and write all data files.
import sys
rundata = setrun(*sys.argv[1:])
rundata.write()
Overwriting setrun.py
Once the setrun.py is ready we will use some commands defined in the Makefile, that should be in the same folder as this notebook. The Makefile will compile the Fortran source code and create an executable that will also be called from the Makefile command.
You can see which commands are defined in the Makefile by executing from a terminal
make help
or simply put a "!" before in an ipython cell, to run as if it was from the terminal
!make help
Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' "make .objs" to compile object files "make .exe" to create executable "make .data" to create data files using setrun.py "make .output" to run code "make output" to run code with no dependency checking "make .plots" to produce plots "make plots" to produce plots with no dependency checking "make .htmls" to produce html versions of files "make .program" to produce single program file "make new" to remove all objs and then make .exe "make clean" to clean up compilation and html files "make clobber" to also clean up output and plot files "make help" to print this message
The following cell will delete any precompiled files with the
make clean
command, and compile the code again and execute it with
make .output
You can write the magic
%%capture out
if you find the screen output too annoying, and save it in the "out" variable.
Now sit back, and wait for those results.
!make clean
!make .output
Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' rm -f xgeoclaw setplot.py.html setrun.py.html amr.data.html claw.data.html dtopo.data.html fgmax.data.html fixed_grids.data.html friction.data.html gauges.data.html geoclaw.data.html qinit.data.html refinement.data.html regions.data.html surge.data.html topo.data.html Makefile.html rm -f .data .output .plots .htmls Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' gfortran /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/utility_module.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/amr_module.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/regions_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/geoclaw_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/gauges_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/topo_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/qinit_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/refinement_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fixedgrids_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/surge/holland_storm_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/surge/stommel_storm_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/surge/constant_storm_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/surge/storm_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/friction_module.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/qinit.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/setprob.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/topo_update.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/cellgridintegrate2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/topointegral.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/bilinearintegral.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/stepgrid.o /home/jose/Downloads/clawpack-5.3.1//riemann/src/rpn2_geoclaw.o /home/jose/Downloads/clawpack-5.3.1//riemann/src/rpt2_geoclaw.o /home/jose/Downloads/clawpack-5.3.1//riemann/src/geoclaw_riemann_utils.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/src2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/src1d.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/step2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/flux2fw.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/qad.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/valout.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/filval.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/filpatch.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/prefilp.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/trimbd.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/bound.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/intfil.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/bc2amr.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/update.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/setaux.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/flag2refine2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/allowflag.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/flagregions2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/b4step2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/upbnd.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/tick.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/setgrd.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/gfixup.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/ginit.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/getmaxspeed.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/advanc.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/amr2.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_read.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_frompatch.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_interpolate.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_values.o /home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/fgmax_finalize.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/quick_sort1.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/estdt.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/check4nans.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/spest2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/init_iflags.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/igetsp.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/reclam.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/birect.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/cleanup.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/colate2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/errest.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/prepregstep.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/prepbigstep.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/bufnst2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/flagger.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/flagregions.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/errf1.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/fixcapaq.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/flglvl2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/fluxad.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/fluxsv.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/grdfit2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/moment.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/nestck2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/prepc.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/prepf.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/projec2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/signs.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/findcut.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/smartbis.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/putnod.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/putsp.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/regrid.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/setuse.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/stst1.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/nodget.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/basic.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/outval.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/copysol.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/outvar.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/outmsh.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/outtre.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domain.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/cellave.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/fdisc.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/fss.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/zeroin.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/setflags.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/shiftset2.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/conck.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domshrink.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domprep.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domup.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domcopy.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/setdomflags.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/setIndices.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/coarseGridFlagSet.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/addflags.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/baseCheck.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/drivesort.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/flagcheck.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/domgrid.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/setPhysBndryFlags.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/griddomup.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/griddomcopy.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/griddomshrink.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/coarsen.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/auxcoarsen.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/intcopy.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/preintcopy.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/icall.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/preicall.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/inlinelimiter.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/cstore.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/saveqc.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/check.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/restrt.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/opendatafile.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/init_alloc.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/restrt_alloc.o /home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/resize_alloc.o -I/home/jose/Downloads/clawpack-5.3.1//amrclaw/src/2d/ -I/home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/ -I/home/jose/Downloads/clawpack-5.3.1//geoclaw/src/2d/shallow/surge/ -L/home/jose/github/tsunami_workshop/en/dambreak/ -o xgeoclaw make data -f Makefile /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common make[1]: Entering directory `/home/jose/github/tsunami_workshop/en/dambreak' Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' rm -f .data python setrun.py geoclaw touch .data make[1]: Nothing to be done for `/home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common'. make[1]: Leaving directory `/home/jose/github/tsunami_workshop/en/dambreak' make output -f Makefile /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common make[1]: Entering directory `/home/jose/github/tsunami_workshop/en/dambreak' Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' rm -f .output python /home/jose/Downloads/clawpack-5.3.1//clawutil/src/python/clawutil/runclaw.py xgeoclaw _output \ True False . False False None ==> runclaw: Will take data from /home/jose/github/tsunami_workshop/en/dambreak ==> runclaw: Will write output to /home/jose/github/tsunami_workshop/en/dambreak/_output ==> runclaw: Removing all old fort files in /home/jose/github/tsunami_workshop/en/dambreak/_output ==> Running with command: /home/jose/github/tsunami_workshop/en/dambreak/xgeoclaw Reading data file: claw.data first 5 lines are comments and will be skipped Reading data file: amr.data first 5 lines are comments and will be skipped Reading data file: regions.data first 5 lines are comments and will be skipped Reading data file: gauges.data first 5 lines are comments and will be skipped Reading data file: fgmax.data first 5 lines are comments and will be skipped Running amrclaw ... Reading data file: geoclaw.data first 5 lines are comments and will be skipped Reading data file: refinement.data first 5 lines are comments and will be skipped Reading data file: dtopo.data first 5 lines are comments and will be skipped Reading data file: topo.data first 5 lines are comments and will be skipped Reading topography file /home/jose/github/tsunami_workshop/en/dambreak/channel.topotype2 Reading data file: qinit.data first 5 lines are comments and will be skipped Reading qinit data from file /home/jose/github/tsunami_workshop/en/dambreak/qinit.topotype1 Reading data file: fixed_grids.data first 5 lines are comments and will be skipped Reading data file: surge.data first 5 lines are comments and will be skipped Reading data file: friction.data first 5 lines are comments and will be skipped Storage allocated... there are 1 grids with 400 cells at level 1 max threads set to 1 Done reading data, starting computation ... Total mass at initial time: 292856.74594794645 AMRCLAW: Frame 0 output files done at time t = 0.000000D+00 *** WARNING *** Courant number = 0.1853D+01 is larger than input cfl_max = 0.8500D+00 on grid 4 level 2 ***adjusting timestep for level 2 at t = 0.825498D+00 old ntogo dt 1 8.7250750629402796E-002 new ntogo dt 2 4.3625375314701398E-002 AMRCLAW: Frame 1 output files done at time t = 0.100000D+01 AMRCLAW: Frame 2 output files done at time t = 0.200000D+01 AMRCLAW: Frame 3 output files done at time t = 0.300000D+01 AMRCLAW: Frame 4 output files done at time t = 0.400000D+01 AMRCLAW: Frame 5 output files done at time t = 0.500000D+01 AMRCLAW: Frame 6 output files done at time t = 0.600000D+01 AMRCLAW: Frame 7 output files done at time t = 0.700000D+01 AMRCLAW: Frame 8 output files done at time t = 0.800000D+01 AMRCLAW: Frame 9 output files done at time t = 0.900000D+01 AMRCLAW: Frame 10 output files done at time t = 0.100000D+02 AMRCLAW: Frame 11 output files done at time t = 0.110000D+02 AMRCLAW: Frame 12 output files done at time t = 0.120000D+02 AMRCLAW: Frame 13 output files done at time t = 0.130000D+02 AMRCLAW: Frame 14 output files done at time t = 0.140000D+02 AMRCLAW: Frame 15 output files done at time t = 0.150000D+02 AMRCLAW: Frame 16 output files done at time t = 0.160000D+02 AMRCLAW: Frame 17 output files done at time t = 0.170000D+02 AMRCLAW: Frame 18 output files done at time t = 0.180000D+02 AMRCLAW: Frame 19 output files done at time t = 0.190000D+02 AMRCLAW: Frame 20 output files done at time t = 0.200000D+02 AMRCLAW: Frame 21 output files done at time t = 0.210000D+02 AMRCLAW: Frame 22 output files done at time t = 0.220000D+02 AMRCLAW: Frame 23 output files done at time t = 0.230000D+02 AMRCLAW: Frame 24 output files done at time t = 0.240000D+02 AMRCLAW: Frame 25 output files done at time t = 0.250000D+02 AMRCLAW: Frame 26 output files done at time t = 0.260000D+02 AMRCLAW: Frame 27 output files done at time t = 0.270000D+02 AMRCLAW: Frame 28 output files done at time t = 0.280000D+02 AMRCLAW: Frame 29 output files done at time t = 0.290000D+02 AMRCLAW: Frame 30 output files done at time t = 0.300000D+02 Done integrating to time 30.000000000000000 ============================== Timing Data ============================== Integration Time (stepgrid + BC + overhead) Level Wall Time (seconds) CPU Time (seconds) Total Cell Updates 1 0.339 0.140 0.524E+05 2 6.150 6.392 0.114E+07 total 6.489 6.532 0.119E+07 All levels: stepgrid 6.364 6.488 BC/ghost cells 0.120 0.044 Regridding 0.027 0.012 Output (valout) 0.819 0.000 Total time: 7.361 7.348 Using 1 thread(s) Note: The CPU times are summed over all threads. Total time includes more than the subroutines listed above ========================================================================= ==> runclaw: Finished executing ==> runclaw: Done executing /home/jose/github/tsunami_workshop/en/dambreak/xgeoclaw via clawutil.runclaw.py ==> runclaw: Output is in /home/jose/github/tsunami_workshop/en/dambreak/_output make[1]: Nothing to be done for `/home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common'. make[1]: Leaving directory `/home/jose/github/tsunami_workshop/en/dambreak'
In case you wandered, all the results were saved in the folder
_output
inside this directory.
To easily generate some nice figures we have to configure the setplot.py file. Then, all figures will be generated in the folder
./_plots
We shall proceed just as with the setrun.py file.
%%writefile setplot.py
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to be plotted at each frame.
Input: plotdata, an instance of pyclaw.plotters.data.ClawPlotData.
Output: a modified version of plotdata.
"""
from clawpack.visclaw import colormaps, geoplot
plotdata.clearfigures() # clear any old figures,axes,items data
def addgauges(current_data):
from clawpack.visclaw import gaugetools
gaugetools.plot_gauge_locations(current_data.plotdata, \
gaugenos='all', format_string='ko', add_labels=True)
def set_drytol(current_data):
# The drytol parameter is used in masking land and water and
# affects what color map is used for cells with small water depth h.
# The cell will be plotted as dry if h < drytol.
# The best value to use often depends on the application and can
# be set here (measured in meters):
current_data.user["drytol"] = 1.e-3
plotdata.beforeframe = set_drytol
#-----------------------------------------
# Figure for pcolor plot
#-----------------------------------------
plotfigure = plotdata.new_plotfigure(name='pcolor', figno=0)
# Set up for axes in this figure:F
plotaxes = plotfigure.new_plotaxes('pcolor')
plotaxes.title = 'Surface'
plotaxes.scaled = True
# Water
plotitem = plotaxes.new_plotitem(plot_type='2d_pcolor')
plotitem.plot_var = geoplot.surface
plotitem.pcolor_cmap = geoplot.tsunami_colormap
plotitem.pcolor_cmin = 0.
plotitem.pcolor_cmax = 10.
plotitem.add_colorbar = True
plotitem.amr_celledges_show = [1,0,0]
plotitem.patchedges_show = [1,1,1]
# Land
plotitem = plotaxes.new_plotitem(plot_type='2d_pcolor')
plotitem.plot_var = geoplot.land
plotitem.pcolor_cmap = geoplot.land_colors
plotitem.pcolor_cmin = 0.0
plotitem.pcolor_cmax = 20.
plotitem.add_colorbar = False
plotitem.amr_celledges_show = [1,0,0]
plotitem.patchedges_show = [1,0,0]
plotaxes.xlimits = [-100,100]
plotaxes.ylimits = [-100,100]
plotaxes.afteraxes = addgauges
#-----------------------------------------
# Figures for gauges
#-----------------------------------------
plotfigure = plotdata.new_plotfigure(name='Surface at gauges', figno=200, \
type='each_gauge')
plotfigure.clf_each_gauge = True
# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.xlimits = 'auto'
plotaxes.ylimits = [0,12]
plotaxes.title = 'Surface'
# Plot surface as blue curve:
plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
plotitem.plot_var = 3
plotitem.plotstyle = 'b-'
# Plot topo as green curve:
plotitem = plotaxes.new_plotitem(plot_type='1d_plot')
plotitem.show = False
def gaugetopo(current_data):
q = current_data.q
h = q[0,:]
eta = q[3,:]
topo = eta - h
return topo
plotitem.plot_var = gaugetopo
plotitem.plotstyle = 'g-'
#-----------------------------------------
# Parameters used only when creating html and/or latex hardcopy
# e.g., via pyclaw.plotters.frametools.printframes:
plotdata.printfigs = True # print figures
plotdata.print_format = 'png' # file format
plotdata.print_framenos = 'all' # list of frames to print
plotdata.print_gaugenos = 'all' # list of gauges to print
plotdata.print_fignos = 'all' # list of figures to print
plotdata.html = True # create html files of plots?
plotdata.html_homelink = '../README.html' # pointer for top of index
plotdata.latex = True # create latex file of plots?
plotdata.latex_figsperline = 2 # layout of plots
plotdata.latex_framesperline = 1 # layout of plots
plotdata.latex_makepdf = False # also run pdflatex?
return plotdata
Overwriting setplot.py
And again, we will use the make plots command from the Makefile to generate the figures defined in the setplot.py file.
!make plots
Makefile:186: warning: overriding commands for target `all' /home/jose/Downloads/clawpack-5.3.1//clawutil/src/Makefile.common:259: warning: ignoring old commands for target `all' rm -f .plots python /home/jose/Downloads/clawpack-5.3.1//visclaw/src/python/visclaw/plotclaw.py _output _plots setplot.py Importing setplot.setplot from /home/jose/github/tsunami_workshop/en/dambreak. Executed setplot successfully Will plot 31 frames numbered: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] Will make 1 figure(s) for each frame, numbered: [0] ----------------------------------- Creating html pages for figures... Directory '/home/jose/github/tsunami_workshop/en/dambreak/_plots' already exists, files may be overwritten Now making png files for all figures... Reading Frame 0 at t = 0 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 0 at time t = 0.0 Reading Frame 1 at t = 1 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 1 at time t = 1.0 Reading Frame 2 at t = 2 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 2 at time t = 2.0 Reading Frame 3 at t = 3 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 3 at time t = 3.0 Reading Frame 4 at t = 4 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 4 at time t = 4.0 Reading Frame 5 at t = 5 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 5 at time t = 5.0 Reading Frame 6 at t = 6 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 6 at time t = 6.0 Reading Frame 7 at t = 7 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 7 at time t = 7.0 Reading Frame 8 at t = 8 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 8 at time t = 8.0 Reading Frame 9 at t = 9 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 9 at time t = 9.0 Reading Frame 10 at t = 10 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 10 at time t = 10.0 Reading Frame 11 at t = 11 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 11 at time t = 11.0 Reading Frame 12 at t = 12 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 12 at time t = 12.0 Reading Frame 13 at t = 13 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 13 at time t = 13.0 Reading Frame 14 at t = 14 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 14 at time t = 14.0 Reading Frame 15 at t = 15 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 15 at time t = 15.0 Reading Frame 16 at t = 16 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 16 at time t = 16.0 Reading Frame 17 at t = 17 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 17 at time t = 17.0 Reading Frame 18 at t = 18 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 18 at time t = 18.0 Reading Frame 19 at t = 19 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 19 at time t = 19.0 Reading Frame 20 at t = 20 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 20 at time t = 20.0 Reading Frame 21 at t = 21 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 21 at time t = 21.0 Reading Frame 22 at t = 22 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 22 at time t = 22.0 Reading Frame 23 at t = 23 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 23 at time t = 23.0 Reading Frame 24 at t = 24 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 24 at time t = 24.0 Reading Frame 25 at t = 25 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 25 at time t = 25.0 Reading Frame 26 at t = 26 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 26 at time t = 26.0 Reading Frame 27 at t = 27 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 27 at time t = 27.0 Reading Frame 28 at t = 28 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 28 at time t = 28.0 Reading Frame 29 at t = 29 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 29 at time t = 29.0 Reading Frame 30 at t = 30 from outdir = /home/jose/github/tsunami_workshop/en/dambreak/_output Frame 30 at time t = 30.0 Reading gauge data from /home/jose/github/tsunami_workshop/en/dambreak/_output/fort.gauge In fort.gauge file, found gauge numbers [0, 1, 2, 3, 4] Read in gauges [0 1 2 3 4] Found data for Gauge 0 Found data for Gauge 1 Found data for Gauge 2 Found data for Gauge 3 Found data for Gauge 4 ----------------------------------- Creating latex file... Directory '/home/jose/github/tsunami_workshop/en/dambreak/_plots' already exists, files may be overwritten Latex file created: /home/jose/github/tsunami_workshop/en/dambreak/_plots/plots.tex Use pdflatex to create pdf file Created JSAnimation for figure 0 -------------------------------------------------------- Point your browser to: file:///home/jose/github/tsunami_workshop/en/dambreak/_plots/_PlotIndex.html
We can call the web browser to see a list of all generated plots
!google-chrome _plots/_PlotIndex.html
Created new window in existing browser session.
But we can try to append some of them here.
For example an animation
from IPython.display import IFrame
IFrame("_plots/movieframe_allframesfig0.html", width=700, height=600)
Or some screenshots
from IPython.display import Image
Image('_plots/frame0009fig0.png',width=400)
And gauge time series.
Image('_plots/gauge0001fig200.png',width=400)
Image('_plots/gauge0003fig300.png',width=400)