コード例 #1
0
def main():
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('--n-loads', type=int, default=16,
                        help='Number of loads to apply')
    parser.add_argument('--shape', type=int, default=200,
                        help='Number rows and columns')
    parser.add_argument('--spacing', type=int, default=5e3,
                        help='Spading between rows and columns (m)')
    parser.add_argument('--n-procs', type=int, default=1,
                        help='Number of processors to use')
    parser.add_argument('--plot', action='store_true', default=False,
                        help='Plot an image of the total deflection')

    args = parser.parse_args()

    shape = (args.shape, args.shape)
    spacing = (args.spacing, args.spacing)

    load_locs = get_random_load_locations(shape, args.n_loads)
    load_sizes = get_random_load_magnitudes(args.n_loads)

    grid = RasterModelGrid(shape[0], shape[1], spacing[0])

    flex = Flexure(grid, method='flexure')

    put_loads_on_grid(grid, load_locs, load_sizes)

    flex.update(n_procs=args.n_procs)

    if args.plot:
        grid.imshow('node', 'lithosphere_surface__elevation_increment',
                    symmetric_cbar=False, cmap='spectral', show=True)
コード例 #2
0
def main():
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('--shape', type=int, default=200,
                        help='Number rows and columns')
    parser.add_argument('--spacing', type=int, default=5e3,
                        help='Spading between rows and columns (m)')
    parser.add_argument('--n-procs', type=int, default=1,
                        help='Number of processors to use')
    parser.add_argument('--plot', action='store_true', default=False,
                        help='Plot an image of the total deflection')

    args = parser.parse_args()

    shape = (args.shape, args.shape)
    spacing = (args.spacing, args.spacing)

    load_sizes = get_random_load_magnitudes(args.shape * args.shape)

    grid = RasterModelGrid(shape[0], shape[1], spacing[0])

    flex = Flexure(grid, method='flexure')

    put_loads_on_grid(grid, load_sizes)

    flex.update(n_procs=args.n_procs)

    if args.plot:
        grid.imshow('node', 'lithosphere_surface__elevation_increment',
                    symmetric_cbar=False, cmap='spectral', show=True)
コード例 #3
0
def main():
    (n_rows, n_cols) = (100, 100)
    (dy, dx) = (10e3, 10e3)

    grid = RasterModelGrid(n_rows, n_cols, dx)

    flex = Flexure(grid, method="flexure")

    add_load_to_middle_of_grid(grid, 1e7)

    flex.update()

    grid.imshow("node", "lithosphere__elevation_increment", symmetric_cbar=True, show=True)
コード例 #4
0
def main():
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument("--n-loads",
                        type=int,
                        default=16,
                        help="Number of loads to apply")
    parser.add_argument("--shape",
                        type=int,
                        default=200,
                        help="Number rows and columns")
    parser.add_argument("--spacing",
                        type=int,
                        default=5e3,
                        help="Spading between rows and columns (m)")
    parser.add_argument("--n-procs",
                        type=int,
                        default=1,
                        help="Number of processors to use")
    parser.add_argument(
        "--plot",
        action="store_true",
        default=False,
        help="Plot an image of the total deflection",
    )

    args = parser.parse_args()

    shape = (args.shape, args.shape)
    spacing = (args.spacing, args.spacing)

    load_locs = get_random_load_locations(shape, args.n_loads)
    load_sizes = get_random_load_magnitudes(args.n_loads)

    grid = RasterModelGrid(shape[0], shape[1], spacing[0])

    flex = Flexure(grid, method="flexure")

    put_loads_on_grid(grid, load_locs, load_sizes)

    flex.update(n_procs=args.n_procs)

    if args.plot:
        grid.imshow(
            "node",
            "lithosphere_surface__elevation_increment",
            symmetric_cbar=False,
            cmap="spectral",
            show=True,
        )
コード例 #5
0
def main():

    grid = RasterModelGrid(SHAPE[0], SHAPE[1], SPACING[0])

    create_lithosphere_elevation_with_bulge(grid)

    flex = Flexure(grid, method='flexure')

    put_two_point_loads_on_grid(grid)

    flex.update()

    grid.at_node['lithosphere_surface__elevation'] += grid.at_node['lithosphere_surface__elevation_increment']
    grid.imshow('node', 'lithosphere_surface__elevation',
                symmetric_cbar=False, show=True)
コード例 #6
0
def main():
    (n_rows, n_cols) = (100, 100)
    (dy, dx) = (10e3, 10e3)

    grid = RasterModelGrid(n_rows, n_cols, dx)

    flex = Flexure(grid, method='flexure')

    add_load_to_middle_of_grid(grid, 1e7)

    flex.update()

    grid.imshow('node',
                'lithosphere_surface__elevation_increment',
                symmetric_cbar=True,
                show=True)
コード例 #7
0
def main():

    grid = RasterModelGrid(SHAPE[0], SHAPE[1], SPACING[0])

    create_lithosphere_elevation_with_bulge(grid)

    flex = Flexure(grid, method="flexure")

    put_two_point_loads_on_grid(grid)

    flex.update()

    grid.at_node["lithosphere_surface__elevation"] += grid.at_node[
        "lithosphere_surface__elevation_increment"
    ]
    grid.imshow(
        "node", "lithosphere_surface__elevation", symmetric_cbar=False, show=True
    )
コード例 #8
0
def main():

    grid = RasterModelGrid(SHAPE[0], SHAPE[1], SPACING[0])

    create_lithosphere_elevation_with_bulge(grid)

    flex = Flexure(grid, method='flexure')

    put_two_point_loads_on_grid(grid)

    flex.update()

    grid.at_node['lithosphere__elevation'] += grid.at_node[
        'lithosphere__elevation_increment']
    grid.imshow('node',
                'lithosphere__elevation',
                symmetric_cbar=False,
                show=True)
コード例 #9
0
def main():
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--shape", type=int, default=200, help="Number rows and columns"
    )
    parser.add_argument(
        "--spacing", type=int, default=5e3, help="Spading between rows and columns (m)"
    )
    parser.add_argument(
        "--n-procs", type=int, default=1, help="Number of processors to use"
    )
    parser.add_argument(
        "--plot",
        action="store_true",
        default=False,
        help="Plot an image of the total deflection",
    )

    args = parser.parse_args()

    shape = (args.shape, args.shape)
    spacing = (args.spacing, args.spacing)

    load_sizes = get_random_load_magnitudes(args.shape * args.shape)

    grid = RasterModelGrid(shape[0], shape[1], spacing[0])

    flex = Flexure(grid, method="flexure")

    put_loads_on_grid(grid, load_sizes)

    flex.update(n_procs=args.n_procs)

    if args.plot:
        grid.imshow(
            "node",
            "lithosphere_surface__elevation_increment",
            symmetric_cbar=False,
            cmap="spectral",
            show=True,
        )
コード例 #10
0
# ## Add some loading
# We will add loads to the grid. As we saw above, for this component, the name of the variable that hold the applied loads is call, `lithosphere__overlying_pressure`. We add loads of random magnitude at every node of the grid.

load = np.random.normal(0, 100 * 2650. * 9.81, grid.number_of_nodes)
grid.at_node['lithosphere__overlying_pressure_increment'] = load

imshow_grid(grid,
            'lithosphere__overlying_pressure_increment',
            symmetric_cbar=True,
            cmap='spectral',
            show=True)

# ## Update the component to solve for deflection
# If you have more than one processor on your machine you may want to use several of them.

flex.update(n_procs=4)

# As we saw above, the flexure component creates an output field (`lithosphere_surface__elevation_increment`) that contains surface deflections for the applied loads.

# # Plot the output

# We now plot these deflections with the `imshow` method, which is available to all landlab components.

imshow_grid(grid,
            'lithosphere_surface__elevation_increment',
            symmetric_cbar=True,
            cmap='spectral',
            show=True)

# Maintain the same loading distribution but double the effective elastic thickness.