Пример #1
0
    def generate(self, topo_func):
        from clawpack.geoclaw.topotools import Topography

        topography = Topography(topo_func=topo_func)
        topography.x = np.linspace(self.xlower, self.xupper, self.nxpoints)
        topography.y = np.linspace(self.ylower, self.yupper, self.nypoints)
        topography.write(self.outfile,
                         topo_type=self.topo_type,
                         Z_format="%22.15e")
Пример #2
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints=200
    nypoints=200
    xupper=2.e0
    yupper=2.e0
    xlower = -2.e0
    ylower = -2.e0
    outfile= "bowl.topotype2"
    topography = Topography(topo_func=topo)
    topography.x = linspace(xlower,xupper,nxpoints)
    topography.y = linspace(ylower,yupper,nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
Пример #3
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints = 200
    nypoints = 200
    xupper = 2.e0
    yupper = 2.e0
    xlower = -2.e0
    ylower = -2.e0
    outfile = "bowl.topotype2"
    topography = Topography(topo_func=topo)
    topography.x = linspace(xlower, xupper, nxpoints)
    topography.y = linspace(ylower, yupper, nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
Пример #4
0
def makeqinit():
    """
    Create qinit data file
    """
    nxpoints = 101
    nypoints = 101
    xlower = -100.e0
    xupper = 100.e0
    yupper = 100.e0
    ylower = -100.e0
    outfile= "hump.xyz"     

    topography = Topography(topo_func=qinit)
    topography.x = linspace(xlower,xupper,nxpoints)
    topography.y = linspace(ylower,yupper,nypoints)
    topography.write(outfile, topo_type=1)
Пример #5
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints = 201
    nypoints = 241
    xlower = 0.e0
    xupper = 100.e0
    ylower = 0.e0
    yupper = 50.e0
    outfile = "island.tt3"

    topography = Topography(topo_func=topo)
    topography.x = linspace(xlower, xupper, nxpoints)
    topography.y = linspace(ylower, yupper, nypoints)
    topography.write(outfile, topo_type=3, Z_format="%22.15e")
Пример #6
0
def makeqinit():
    """
    Create qinit data file
    """
    nxpoints = 101
    nypoints = 101
    xlower = -50.e0
    xupper = 50.e0
    yupper = 50.e0
    ylower = -50.e0
    outfile = "hump.xyz"

    topography = Topography(topo_func=qinit)
    topography.x = linspace(xlower, xupper, nxpoints)
    topography.y = linspace(ylower, yupper, nypoints)
    topography.write(outfile, topo_type=1)
Пример #7
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints=600
    nypoints=15
    xupper=domain_x
    yupper=domain_y/2.0
    xlower = 0.e0
    ylower = -domain_y/2.0
    outfile= "channel.topotype2"

    topography = Topography(topo_func=topo)
    topography.x = linspace(xlower,xupper,nxpoints)
    topography.y = linspace(ylower,yupper,nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
Пример #8
0
def maketopo2():
    """
    Another topo file for testing
    """
    nxpoints=21
    nypoints=51
    xlower = -0.5
    xupper= -0.3
    ylower = -0.1
    yupper= 0.4
    outfile= "topo2.topotype2"
    topography = Topography(topo_func=topo2)
    topography.x = numpy.linspace(xlower,xupper,nxpoints)
    topography.y = numpy.linspace(ylower,yupper,nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
    dx = (xupper-xlower)/(nxpoints-1)
    dy = (yupper-ylower)/(nypoints-1)
    print "==> topo2 has dx = %g, dy = %g" % (dx,dy)
Пример #9
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints=201
    nypoints=201
    xlower = -10e0
    xupper= 10e0
    ylower = -10e0
    yupper= 10e0
    outfile= "topo1.topotype2"
    topography = Topography(topo_func=topo)
    topography.x = numpy.linspace(xlower,xupper,nxpoints)
    topography.y = numpy.linspace(ylower,yupper,nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
    dx = (xupper-xlower)/(nxpoints-1)
    dy = (yupper-ylower)/(nypoints-1)
    print "==> topo1 has dx = %g, dy = %g" % (dx,dy)
Пример #10
0
def maketopo2():
    """
    Another topo file for testing
    """
    nxpoints = 21
    nypoints = 51
    xlower = -0.5
    xupper = -0.3
    ylower = -0.1
    yupper = 0.4
    outfile = "topo2.topotype2"
    topography = Topography(topo_func=topo2)
    topography.x = numpy.linspace(xlower, xupper, nxpoints)
    topography.y = numpy.linspace(ylower, yupper, nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
    dx = (xupper - xlower) / (nxpoints - 1)
    dy = (yupper - ylower) / (nypoints - 1)
    print("==> topo2 has dx = %g, dy = %g" % (dx, dy))
Пример #11
0
def maketopo():
    """
    Output topography file for the entire domain
    """
    nxpoints = 201
    nypoints = 201
    xlower = -10e0
    xupper = 10e0
    ylower = -10e0
    yupper = 10e0
    outfile = "topo1.topotype2"
    topography = Topography(topo_func=topo)
    topography.x = numpy.linspace(xlower, xupper, nxpoints)
    topography.y = numpy.linspace(ylower, yupper, nypoints)
    topography.write(outfile, topo_type=2, Z_format="%22.15e")
    dx = (xupper - xlower) / (nxpoints - 1)
    dy = (yupper - ylower) / (nypoints - 1)
    print("==> topo1 has dx = %g, dy = %g" % (dx, dy))