Skip to content

Commit

Permalink
Merge pull request clawpack#74 from rjleveque/chap13
Browse files Browse the repository at this point in the history
fvmbook/chap13/collide example update to 5.4.0
  • Loading branch information
rjleveque committed Feb 24, 2017
2 parents 9d65840 + 4d362bf commit 353f0ad
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 101 deletions.
33 changes: 18 additions & 15 deletions fvmbook/chap12/efix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,38 @@ SETPLOT_FILE = setplot.py # File containing function to set plots
PLOTDIR = _plots # Directory for plots

OVERWRITE ?= True # False ==> make a copy of OUTDIR first
RESTART ?= False # Should = clawdata.restart in setrun

# Environment variable FC should be set to fortran compiler, e.g. gfortran

# Compiler flags can be specified here or set as an environment variable
FFLAGS ?=

# ---------------------------------
# List of sources for this program:
# package sources for this program:
# ---------------------------------

include $(CLAW)/classic/src/1d/Makefile.classic_1d

# ---------------------------------------
# package sources specifically to exclude
# (i.e. if a custom replacement source
# under a different name is provided)
# ---------------------------------------

EXCLUDE_MODULES = \

EXCLUDE_SOURCES = \

# ----------------------------------------
# List of custom sources for this program:
# ----------------------------------------

MODULES = \

SOURCES = \
qinit.f \
rp1_burgers.f90 \
$(CLAW)/classic/src/1d/setprob.f90 \
$(CLAW)/classic/src/1d/setaux.f90 \
$(CLAW)/classic/src/1d/bc1.f \
$(CLAW)/classic/src/1d/b4step1.f90 \
$(CLAW)/classic/src/1d/driver.f90 \
$(CLAW)/classic/src/1d/claw1ez.f \
$(CLAW)/classic/src/1d/claw1.f \
$(CLAW)/classic/src/1d/copyq1.f \
$(CLAW)/classic/src/1d/inlinelimiter.f90 \
$(CLAW)/classic/src/1d/opendatafile.f \
$(CLAW)/classic/src/1d/out1.f \
$(CLAW)/classic/src/1d/src1.f90 \
$(CLAW)/classic/src/1d/step1.f90


#-------------------------------------------------------------------
# Include Makefile containing standard definitions and make options:
Expand Down
2 changes: 1 addition & 1 deletion fvmbook/chap12/efix/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Example [book/chap12/efix] to accompany the book
<http://www.clawpack.org/book.html>`_
by R. J. LeVeque.

Converted to Clawpack 5.0 form in 2013.
Converted to Clawpack 5.4.0 form in 2017.

Burgers' equation with a transonic rarefaction wave.

Expand Down
33 changes: 18 additions & 15 deletions fvmbook/chap13/collide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,40 @@ SETPLOT_FILE = setplot.py # File containing function to set plots
PLOTDIR = _plots # Directory for plots

OVERWRITE ?= True # False ==> make a copy of OUTDIR first
RESTART ?= False # Should = clawdata.restart in setrun

# Environment variable FC should be set to fortran compiler, e.g. gfortran

# Compiler flags can be specified here or set as an environment variable
FFLAGS ?=

# ---------------------------------
# List of sources for this program:
# package sources for this program:
# ---------------------------------

LIB = $(CLAW)/classic/src/1d
include $(CLAW)/classic/src/1d/Makefile.classic_1d

# ---------------------------------------
# package sources specifically to exclude
# (i.e. if a custom replacement source
# under a different name is provided)
# ---------------------------------------

EXCLUDE_MODULES = \

EXCLUDE_SOURCES = \

# ----------------------------------------
# List of custom sources for this program:
# ----------------------------------------

MODULES = \

SOURCES = \
qinit.f \
setprob.f \
$(CLAW)/riemann/src/rp1_shallow_roe_with_efix.f90 \
$(CLAW)/classic/src/1d/setaux.f90 \
$(CLAW)/classic/src/1d/bc1.f \
$(CLAW)/classic/src/1d/b4step1.f90 \
$(CLAW)/classic/src/1d/driver.f90 \
$(CLAW)/classic/src/1d/claw1ez.f \
$(CLAW)/classic/src/1d/claw1.f \
$(CLAW)/classic/src/1d/copyq1.f \
$(CLAW)/classic/src/1d/inlinelimiter.f90 \
$(CLAW)/classic/src/1d/opendatafile.f \
$(CLAW)/classic/src/1d/out1.f \
$(CLAW)/classic/src/1d/src1.f90 \
$(CLAW)/classic/src/1d/step1.f90



#-------------------------------------------------------------------
# Include Makefile containing standard definitions and make options:
Expand Down
4 changes: 2 additions & 2 deletions fvmbook/chap13/collide/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ which collide and produce a 1-rarefaction and 2-shock.
Example [book/chap13/collide] to accompany the book
`Finite Volume Methods for Hyperbolic Problems
<http://www.clawpack.org/book.html>`_
by R. J. LeVeque.
by R. J. LeVeque. This illustrates the solution shown in Figure 13.19.

Converted to Clawpack 5.0 form in 2013.
Converted to Clawpack 5.4 form in 2017.


48 changes: 0 additions & 48 deletions fvmbook/chap13/collide/claw.data

This file was deleted.

28 changes: 16 additions & 12 deletions fvmbook/chap13/collide/setplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"""

from __future__ import absolute_import
from __future__ import print_function

#--------------------------
def setplot(plotdata):
#--------------------------
Expand All @@ -18,40 +21,41 @@ def setplot(plotdata):
"""

if plotdata is None:
from clawpack.visclaw.data import ClawPlotData
plotdata = ClawPlotData()

plotdata.clearfigures() # clear any old figures,axes,items data



# Figure for q[0]
plotfigure = plotdata.new_plotfigure(name='q[0]', figno=0)
# Figure with both components
plotfigure = plotdata.new_plotfigure(name='h and hu', figno=0)
plotfigure.kwargs = {'figsize':(6,8)}

# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.axescmd = 'subplot(2,1,1)'
plotaxes.xlimits = 'auto'
plotaxes.ylimits = [0., 4.5]
plotaxes.title = 'q[0]'
plotaxes.title = 'depth h'

# Set up for item on these axes:
plotitem = plotaxes.new_plotitem(plot_type='1d')
plotitem.plot_var = 0
plotitem.plotstyle = '-o'
plotitem.plotstyle = '-'
plotitem.color = 'b'
plotitem.show = True # show on plot?


# Figure for q[1]
plotfigure = plotdata.new_plotfigure(name='q[1]', figno=1)

# Set up for axes in this figure:
plotaxes = plotfigure.new_plotaxes()
plotaxes.axescmd = 'subplot(2,1,2)'
plotaxes.xlimits = 'auto'
plotaxes.ylimits = [-2., 6.]
plotaxes.title = 'q[1]'
plotaxes.title = 'momentum hu'

# Set up for item on these axes:
plotitem = plotaxes.new_plotitem(plot_type='1d')
plotitem.plot_var = 1
plotitem.plotstyle = '-o'
plotitem.plotstyle = '-'
plotitem.color = 'b'
plotitem.show = True # show on plot?

Expand Down
7 changes: 0 additions & 7 deletions fvmbook/chap13/collide/setprob.data

This file was deleted.

2 changes: 1 addition & 1 deletion fvmbook/chap13/collide/setrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def setrun(claw_pkg='classic'):
clawdata.dt_max = 1.000000e+99

# Desired Courant number if variable dt used
clawdata.cfl_desired = 0.900000
clawdata.cfl_desired = 0.800000
# max Courant number to allow without retaking step with a smaller dt:
clawdata.cfl_max = 1.000000

Expand Down

0 comments on commit 353f0ad

Please sign in to comment.