landlab

landlab.ca.boundaries package

Submodules

landlab.ca.boundaries.hex_lattice_tectonicizer module

hex_lattice_tectonicizer.py.

Models discrete normal-fault offset on a 2D hex lattice with a rectangular shape and with one orientation of the nodes being vertical.

The intention here is to use a particle (LCA) model to represent the evolution of a 2D hillslope, with the hex_lattice_tectonicizer serving to shift the nodes either upward (simple vertical uplift relative to baselevel), or up and sideways (representing motion on a fault plane).

Created on Mon Nov 17 08:01:49 2014

@author: gtucker

class HexLatticeTectonicizer(grid=None, node_state=None, propid=None, prop_data=None, prop_reset_value=None)[source]

Bases: object

Handles tectonics and baselevel for CellLab-CTS models.

This is the base class from which classes to represent particular baselevel/fault geometries are derived.

Examples

>>> hlt = HexLatticeTectonicizer()
>>> hlt.grid.number_of_nodes
25
>>> hlt.nr
5
>>> hlt.nc
5

Create and initialize a HexLatticeTectonicizer.

Examples

>>> from landlab import HexModelGrid
>>> hg = HexModelGrid(6, 6, shape='rect')
>>> hlt = HexLatticeTectonicizer()
>>> hlt.grid.number_of_nodes
25
>>> hlt.nr
5
>>> hlt.nc
5
class LatticeNormalFault(fault_x_intercept=0.0, grid=None, node_state=None, propid=None, prop_data=None, prop_reset_value=None)[source]

Bases: landlab.ca.boundaries.hex_lattice_tectonicizer.HexLatticeTectonicizer

Handles normal-fault displacement in CellLab-CTS models.

Represents a 60 degree, left-dipping normal fault, and handles discrete offsets for a hex grid that has vertical columns and a rectangular shape.

Examples

>>> import numpy as np
>>> from landlab import HexModelGrid
>>> from landlab.ca.boundaries.hex_lattice_tectonicizer import LatticeNormalFault
>>> pid = np.arange(25, dtype=int)
>>> pdata = np.arange(25)
>>> ns = np.arange(25, dtype=int)
>>> grid = HexModelGrid(5, 5, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.first_fw_col
1
>>> lnf.num_fw_rows
array([0, 1, 3, 4, 5])
>>> lnf.incoming_node
array([1, 3, 4, 6])
>>> lnf.outgoing_node
array([12, 17, 19, 22])
>>> pid = arange(16, dtype=int)
>>> ns = arange(16, dtype=int)
>>> pdata = arange(16)
>>> grid = HexModelGrid(4, 4, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.num_fw_rows
array([0, 1, 3, 4])
>>> lnf.incoming_node
array([1, 2, 5])
>>> lnf.outgoing_node
array([ 7, 11, 15])
>>> lnf.do_offset(rock_state=16)
>>> ns
array([ 0, 16, 16, 16,  4, 16,  6,  1,  8,  2, 10,  5, 12, 13, 14,  9])
>>> lnf.propid
array([ 0,  7, 11,  3,  4, 15,  6,  1,  8,  2, 10,  5, 12, 13, 14,  9])
>>> pid = arange(20, dtype=int)
>>> ns = arange(20, dtype=int)
>>> pdata = arange(20)
>>> grid = HexModelGrid(4, 5, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.incoming_node
array([1, 3, 4, 6])
>>> lnf.outgoing_node
array([12, 14, 17, 19])
>>> lnf.do_offset(rock_state=20)
>>> ns
array([ 0, 20, 20, 20, 20,  5, 20, 20,  8,  1, 10,  3,  4, 13,  6, 15, 16,
        9, 18, 11])
>>> lnf.propid
array([ 0, 12,  2, 14, 17,  5, 19,  7,  8,  1, 10,  3,  4, 13,  6, 15, 16,
        9, 18, 11])

Create and initialize a LatticeNormalFault object.

Examples

>>> import numpy as np
>>> from landlab import HexModelGrid
>>> from landlab.ca.boundaries.hex_lattice_tectonicizer import LatticeNormalFault
>>> pid = np.arange(25, dtype=int)
>>> pdata = np.arange(25)
>>> ns = np.arange(25, dtype=int)
>>> grid = HexModelGrid(5, 5, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(-0.01, grid, ns, pid, pdata, 0.0)
>>> lnf.first_fw_col
0
>>> lnf.num_fw_rows
array([1, 2, 4, 5, 5])
>>> lnf.incoming_node
array([0, 1, 3, 4, 6])
>>> lnf.outgoing_node
array([12, 17, 19, 22, 24])
>>> pid = np.arange(16, dtype=int)
>>> pdata = np.arange(16)
>>> ns = np.arange(16, dtype=int)
>>> grid = HexModelGrid(4, 4, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.first_fw_col
1
>>> lnf.num_fw_rows
array([0, 1, 3, 4])
>>> lnf.incoming_node
array([1, 2, 5])
>>> lnf.outgoing_node
array([ 7, 11, 15])
>>> pid = np.arange(45, dtype=int)
>>> pdata = np.arange(45)
>>> ns = np.arange(45, dtype=int)
>>> grid = HexModelGrid(5, 9, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.first_fw_col
1
>>> lnf.num_fw_rows
array([0, 1, 3, 4, 5, 5, 5, 5, 5])
>>> lnf.incoming_node
array([ 1,  2,  3,  5,  6,  7,  8, 10, 11, 12])
>>> lnf.outgoing_node
array([22, 31, 33, 34, 35, 38, 39, 40, 43, 44])
do_offset(rock_state=1)[source]

Apply 60-degree normal-fault offset.

Offset is applied to a hexagonal grid with vertical node orientation and rectangular arrangement of nodes.

Parameters:

rock_state : int

State code to apply to new cells introduced along bottom row.

Examples

>>> import numpy as np
>>> from landlab.ca.boundaries.hex_lattice_tectonicizer import LatticeNormalFault
>>> from landlab import HexModelGrid
>>> pid = np.arange(25, dtype=int)
>>> pdata = np.arange(25)
>>> ns = np.arange(25, dtype=int)
>>> grid = HexModelGrid(5, 5, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(0.0, grid, ns, pid, pdata, 0.0)
>>> lnf.do_offset(rock_state=25)
>>> ns
array([ 0, 25, 25, 25, 25,  5, 25, 25,  8,  1, 10,  3,  4, 13,  6, 15, 16,
        9, 18, 11, 20, 21, 14, 23, 24])
>>> lnf.propid
array([ 0, 12,  2, 17, 19,  5, 22,  7,  8,  1, 10,  3,  4, 13,  6, 15, 16,
        9, 18, 11, 20, 21, 14, 23, 24])

Set up array with link IDs for shifting link data up and right.

Examples

>>> from landlab.ca.boundaries.hex_lattice_tectonicizer import LatticeNormalFault
>>> from landlab import HexModelGrid
>>> pid = np.arange(25, dtype=int)
>>> pdata = np.arange(25)
>>> ns = np.arange(25, dtype=int)
>>> grid = HexModelGrid(5, 5, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lnf = LatticeNormalFault(-0.01, grid, ns, pid, pdata, 0.0)
>>> lnf.setup_link_offsets()
>>> lnf.link_offset_id
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
class LatticeUplifter(grid=None, node_state=None, propid=None, prop_data=None, prop_reset_value=None, opt_block_layer=False, block_ID=9, block_layer_dip_angle=0.0, block_layer_thickness=1.0, layer_left_x=0.0, y0_top=0.0)[source]

Bases: landlab.ca.boundaries.hex_lattice_tectonicizer.HexLatticeTectonicizer

Handles vertical uplift of interior (not edges) for a hexagonal lattice with vertical node orientation and rectangular node arrangement.

Create and initialize a LatticeUplifter

Examples

>>> lu = LatticeUplifter()
>>> lu.inner_base_row_nodes
array([1, 3, 4])
>>> hg = HexModelGrid(5, 6, 1.0, orientation='vertical', shape='rect', reorient_links=True)
>>> lu = LatticeUplifter(grid=hg)
>>> lu.inner_base_row_nodes
array([1, 2, 3, 4])

Applies uplift to links and transitions.

For each link that lies above the y = 1.5 cells line, assign the properties of the link one row down.

Examples

>>> from landlab import HexModelGrid
>>> from landlab.ca.oriented_hex_cts import OrientedHexCTS
>>> from landlab.ca.celllab_cts import Transition
>>> import numpy as np
>>> mg = HexModelGrid(4, 3, 1.0, orientation='vertical', shape='rect')
>>> nsd = {0 : 'yes', 1 : 'no'}
>>> xnlist = []
>>> xnlist.append(Transition((0,0,0), (1,1,0), 1.0, 'frogging'))
>>> xnlist.append(Transition((0,0,1), (1,1,1), 1.0, 'frogging'))
>>> xnlist.append(Transition((0,0,2), (1,1,2), 1.0, 'frogging'))
>>> nsg = mg.add_zeros('node', 'node_state_grid')
>>> ohcts = OrientedHexCTS(mg, nsd, xnlist, nsg)
>>> ohcts.link_state[mg.active_links]
array([0, 4, 8, 8, 4, 0, 4, 8, 8, 4, 0])
>>> ohcts.next_trn_id[mg.active_links]
array([0, 1, 2, 2, 1, 0, 1, 2, 2, 1, 0])
>>> lu = LatticeUplifter(grid=mg)
>>> nu = ohcts.next_update
>>> np.round(nu[mg.active_links], 2)
array([ 0.8 ,  1.26,  0.92,  0.79,  0.55,  1.04,  0.58,  2.22,  3.31,
        0.48,  1.57])
>>> pq = ohcts.priority_queue
>>> pq._queue[0][2]  # link for first event = 20, not shifted
20
>>> round(pq._queue[0][0], 2)  # transition scheduled for t = 0.48
0.48
>>> pq._queue[2][2]  # this event scheduled for link 15...
15
>>> round(pq._queue[2][0], 2)  # ...transition scheduled for t = 0.58
0.58
>>> lu.shift_link_and_transition_data_upward(ohcts, 0.0)
>>> np.round(nu[mg.active_links], 2)  # note new events lowest 5 links
array([ 0.75,  0.84,  2.6 ,  0.07,  0.09,  0.8 ,  0.02,  1.79,  1.51,
        2.04,  3.85])
>>> pq._queue[0][2]  # new soonest event
15
>>> pq._queue[9][2]  # was previously 7, now shifted up...
14
>>> round(pq._queue[9][0], 2)  # ...but still scheduled for t = 0.80
0.8
uplift_interior_nodes(ca, current_time, rock_state=1)[source]

Simulate ‘vertical’ displacement by shifting contents of node_state

Examples

>>> from landlab import HexModelGrid
>>> from landlab.ca.hex_cts import HexCTS
>>> from landlab.ca.celllab_cts import Transition
>>> mg = HexModelGrid(5, 5, 1.0, orientation='vertical', shape='rect')
>>> nsd = {}
>>> for i in range(26):
...     nsd[i] = i
>>> xnlist = []
>>> xnlist.append(Transition((0,0,0), (1,1,0), 1.0, 'frogging', True))
>>> nsg = mg.add_zeros('node', 'node_state_grid')
>>> ca = HexCTS(mg, nsd, xnlist, nsg)
>>> pd = mg.add_zeros('node', 'propdata')
>>> lu = LatticeUplifter(propid=ca.propid, prop_data=pd)
>>> lu.node_state[:] = arange(len(lu.node_state))
>>> lu.uplift_interior_nodes(ca, rock_state=25, current_time=0.0)
>>> lu.node_state 
array([ 0, 25,  2, 25, 25,
        5,  1,  7,  3,  4,
       10,  6, 12,  8,  9,
       15, 11, 17, 13, 14,
       20, 16, 22, 18, 19])
>>> lu.propid 
array([ 0, 21,  2, 23, 24, 
        5,  1,  7,  3,  4,
       10,  6, 12,  8,  9,
       15, 11, 17, 13, 14,
       20, 16, 22, 18, 19])
uplift_property_ids()[source]

Shift property IDs upward by one row

Module contents