Beispiel #1
0
def makegrid(xs):

    xzpairs = [
        (x1, -3200),  # left edge
        (-xs, -3200),  # start of continental slope
        (xs, -200),  # start of continental shelf
        (x2, -200)
    ]  # right edge

    topo_fcn = nonuniform_grid_tools.make_pwlin_topo_fcn(xzpairs)

    mx = 5000  # number of grid cells
    hmin = 50.  # mininum depth for varying cell widths

    nonuniform_grid_tools.make_celledges_cfl(x1,
                                             x2,
                                             mx,
                                             topo_fcn,
                                             hmin=hmin,
                                             fname='celledges.data',
                                             plot_topo=True)
Beispiel #2
0
from pylab import *
from clawpack.geoclaw_1d import nonuniform_grid_tools

xzpairs = [
    (0e3, -4000),  # left edge
    (20e3, -4000),  # start of continental slope
    (25e3, -100),  # start of continental shelf
    (50e3, -100),  # start of beach
    (60e3, 0),  # shore
    (64e3, 40)
]  # right edge

topo_fcn = nonuniform_grid_tools.make_pwlin_topo_fcn(xzpairs)

mx = 8000
hmin = 80.

nonuniform_grid_tools.make_celledges_cfl(0,
                                         64e3,
                                         mx,
                                         topo_fcn,
                                         hmin,
                                         fname='celledges.txt',
                                         plot_topo=True)
Beispiel #3
0
"""
Make piecewise linear topography for wave tank.
"""

from pylab import *
from clawpack.geoclaw_1d import nonuniform_grid_tools

xlower = -160.8
xupper = 40.

xzpairs = [
    (-160.8, -4),  # left edge
    (-125.5, -4),  # start of first slope
    (-90, -0.45),  # start of beach
    (0, 0),  # shore
    (40, 2)
]  # right edge

topo_fcn = nonuniform_grid_tools.make_pwlin_topo_fcn(xzpairs)

mx = 8000
hmin = 0.05  # use uniform grid in shallower water

nonuniform_grid_tools.make_celledges_cfl(xlower,
                                         xupper,
                                         mx,
                                         topo_fcn,
                                         hmin,
                                         fname='celledges.data',
                                         plot_topo=True)
Beispiel #4
0
near shore and onshore where the water depth is less than `hmin`.
"""

from pylab import *
from clawpack.geoclaw_1d import nonuniform_grid_tools

x1 = -100e3
x2 = 1e3

xzpairs = [
    (-100e3, -4000),  # left edge
    (-70e3, -4000),  # start of continental slope
    (-20e3, -200),  # start of continental shelf
    (-2e3, -200),  # start of beach
    (0, 0),  # shoreline
    (1e3, 100)
]  # right edge

topo_fcn = nonuniform_grid_tools.make_pwlin_topo_fcn(xzpairs)

mx = 5000  # number of grid cells
hmin = 20.  # mininum depth for varying cell widths

nonuniform_grid_tools.make_celledges_cfl(x1,
                                         x2,
                                         mx,
                                         topo_fcn,
                                         hmin=hmin,
                                         fname='celledges.data',
                                         plot_topo=True)