landlab.graph.structured_quad package#
Subpackages#
- landlab.graph.structured_quad.ext package
Submodules#
landlab.graph.structured_quad.dual_structured_quad module#
- class DualRectilinearGraph(node_y_and_x)[source]#
Bases:
DualGraph
,RectilinearGraph
Create a dual graph for a rectilinear grid.
Examples
>>> from landlab.graph import DualRectilinearGraph >>> graph = DualRectilinearGraph(([0, 1, 3], [0, 5, 15, 30])) >>> graph.x_of_corner array([ 2.5, 10. , 22.5, 2.5, 10. , 22.5]) >>> graph.y_of_corner array([ 0.5, 0.5, 0.5, 2. , 2. , 2. ]) >>> graph.number_of_cells == 2 True >>> graph.faces_at_cell array([[3, 5, 2, 0], [4, 6, 3, 1]])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
- class DualStructuredQuadGraph(node_y_and_x, shape=None, sort=True)[source]#
Bases:
DualGraph
,StructuredQuadGraph
Dual graph of a structured grid of quadrilaterals.
Examples
>>> from landlab.graph import DualStructuredQuadGraph >>> node_y = [-1, -2, -3, ... 0, 0, 0, ... 1, 2, 3] >>> node_x = [ 0, 1, 2, ... 0, 2, 3, ... 0, 1, 2] >>> graph = DualStructuredQuadGraph((node_y, node_x), shape=(3, 3), sort=True) >>> graph.number_of_corners == 4 True >>> graph.y_of_corner array([-1.25, -0.75, 0.75, 1.25]) >>> graph.x_of_corner array([ 2. , 0.75, 0.75, 2. ]) >>> graph.node_at_cell array([4])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- static get_node_at_cell(shape)[source]#
Set up an array that gives the node at each cell.
Examples
>>> from landlab.graph.structured_quad import DualStructuredQuadGraph >>> DualStructuredQuadGraph.get_node_at_cell((5, 6)) array([ 7, 8, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22])
- static get_nodes_at_face(shape)[source]#
Set up an array that gives the nodes on either side of each face.
Examples
>>> from landlab.graph.structured_quad import DualStructuredQuadGraph >>> DualStructuredQuadGraph.get_nodes_at_face((3, 4)) array([[ 1, 5], [ 2, 6], [ 4, 5], [ 5, 6], [ 6, 7], [ 5, 9], [ 6, 10]])
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
- class DualUniformRectilinearGraph(shape, spacing=1.0, origin=(0.0, 0.0))[source]#
Bases:
DualGraph
,UniformRectilinearGraph
Create a dual graph for a uniform rectilinear grid.
Examples
>>> from landlab.graph import DualUniformRectilinearGraph >>> graph = DualUniformRectilinearGraph((4, 3)) >>> graph.x_of_corner array([ 0.5, 1.5, 0.5, 1.5, 0.5, 1.5]) >>> graph.y_of_corner array([ 0.5, 0.5, 1.5, 1.5, 2.5, 2.5]) >>> graph.number_of_cells == 2 True >>> graph.faces_at_cell array([[2, 3, 1, 0], [5, 6, 4, 3]])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
landlab.graph.structured_quad.structured_quad module#
- class RectilinearGraph(nodes, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Graph of a rectlinear grid of nodes.
Examples
>>> from landlab.graph import RectilinearGraph >>> graph = RectilinearGraph(([0, 1, 2, 3], [1, 4, 8])) >>> graph.number_of_nodes 12 >>> graph.y_of_node array([ 0., 0., 0., 1., 1., 1., 2., 2., 2., 3., 3., 3.]) >>> graph.x_of_node array([ 1., 4., 8., 1., 4., 8., 1., 4., 8., 1., 4., 8.])
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- class StructuredQuadGraph(coords, shape=None, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- class StructuredQuadGraphExtras(node_y_and_x, sort=False)[source]#
Bases:
StructuredQuadGraphTopology
,Graph
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- property nodes_at_link#
Get nodes at either end of links.
Examples
>>> from landlab.graph import Graph >>> node_x, node_y = [0, 1, 2, 0, 1, 2, 0, 1, 2], [0, 0, 0, 1, 1, 1, 2, 2, 2] >>> links = ((0, 1), (1, 2), ... (0, 3), (1, 4), (2, 5), ... (3, 4), (4, 5), ... (3, 6), (4, 7), (5, 8), ... (6, 7), (7, 8)) >>> graph = Graph((node_y, node_x), links=links) >>> graph.nodes_at_link array([[0, 1], [1, 2], [0, 3], [1, 4], [2, 5], [3, 4], [4, 5], [3, 6], [4, 7], [5, 8], [6, 7], [7, 8]])
- class StructuredQuadGraphTopology(shape)[source]#
Bases:
object
- property corner_nodes#
- property horizontal_links#
- property link_dirs_at_node#
- property links_at_node#
- property nodes#
A shaped array of node ids.
- Returns:
Node IDs in an array shaped as number_of_node_rows by number_of_node_columns.
- Return type:
ndarray
- property nodes_at_bottom_edge#
- property nodes_at_corners_of_grid#
Nodes at corners of grid.
The nodes at at the corners of the grid. The nodes are returned counterclockwise starting with the upper-right.
Examples
>>> from landlab.graph import UniformRectilinearGraph >>> graph = UniformRectilinearGraph((4, 5)) >>> graph.nodes_at_corners_of_grid (19, 15, 0, 4)
- property nodes_at_left_edge#
- property nodes_at_link#
- property nodes_at_right_edge#
- property nodes_at_top_edge#
- property number_of_node_columns#
- property number_of_node_rows#
- property patches_at_link#
- property patches_at_node#
- property perimeter_nodes#
- property shape#
- property vertical_links#
- class StructuredQuadLayoutCython[source]#
Bases:
StructuredQuadLayout
- static links_at_patch(shape)[source]#
Get links that define patches for a raster grid.
Examples
>>> from landlab.graph.structured_quad.structured_quad import StructuredQuadLayoutCython >>> StructuredQuadLayoutCython.links_at_patch((3, 4)) array([[ 4, 7, 3, 0], [ 5, 8, 4, 1], [ 6, 9, 5, 2], [11, 14, 10, 7], [12, 15, 11, 8], [13, 16, 12, 9]])
- static nodes_at_link(shape)[source]#
Examples
>>> from landlab.graph.structured_quad.structured_quad import StructuredQuadLayoutCython >>> StructuredQuadLayoutCython.nodes_at_link((3, 4)) array([[ 0, 1], [ 1, 2], [ 2, 3], [ 0, 4], [ 1, 5], [ 2, 6], [ 3, 7], [ 4, 5], [ 5, 6], [ 6, 7], [ 4, 8], [ 5, 9], [ 6, 10], [ 7, 11], [ 8, 9], [ 9, 10], [10, 11]])
- class StructuredQuadLayoutPython[source]#
Bases:
StructuredQuadLayout
- class UniformRectilinearGraph(shape, spacing=1.0, origin=0.0, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Graph of a structured grid of quadrilaterals.
Examples
>>> from landlab.graph import UniformRectilinearGraph >>> graph = UniformRectilinearGraph((4, 3), spacing=(1, 2), origin=(-1, 0)) >>> graph.number_of_nodes 12 >>> graph.y_of_node array([-1., -1., -1., 0., 0., 0., 1., 1., 1., 2., 2., 2.]) >>> graph.x_of_node array([ 0., 2., 4., 0., 2., 4., 0., 2., 4., 0., 2., 4.]) >>> graph.links_at_node array([[ 0, 2, -1, -1], [ 1, 3, 0, -1], [-1, 4, 1, -1], [ 5, 7, -1, 2], [ 6, 8, 5, 3], [-1, 9, 6, 4], [10, 12, -1, 7], [11, 13, 10, 8], [-1, 14, 11, 9], [15, -1, -1, 12], [16, -1, 15, 13], [-1, -1, 16, 14]]) >>> graph.link_dirs_at_node array([[-1, -1, 0, 0], [-1, -1, 1, 0], [ 0, -1, 1, 0], [-1, -1, 0, 1], [-1, -1, 1, 1], [ 0, -1, 1, 1], [-1, -1, 0, 1], [-1, -1, 1, 1], [ 0, -1, 1, 1], [-1, 0, 0, 1], [-1, 0, 1, 1], [ 0, 0, 1, 1]], dtype=int8) >>> graph.nodes_at_link array([[ 0, 1], [ 1, 2], [ 0, 3], [ 1, 4], [ 2, 5], [ 3, 4], [ 4, 5], [ 3, 6], [ 4, 7], [ 5, 8], [ 6, 7], [ 7, 8], [ 6, 9], [ 7, 10], [ 8, 11], [ 9, 10], [10, 11]]) >>> graph.links_at_patch array([[ 3, 5, 2, 0], [ 4, 6, 3, 1], [ 8, 10, 7, 5], [ 9, 11, 8, 6], [13, 15, 12, 10], [14, 16, 13, 11]]) >>> graph.nodes_at_patch array([[ 4, 3, 0, 1], [ 5, 4, 1, 2], [ 7, 6, 3, 4], [ 8, 7, 4, 5], [10, 9, 6, 7], [11, 10, 7, 8]])
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- property dx#
- property dy#
- property origin#
- property spacing#
Module contents#
- class DualRectilinearGraph(node_y_and_x)[source]#
Bases:
DualGraph
,RectilinearGraph
Create a dual graph for a rectilinear grid.
Examples
>>> from landlab.graph import DualRectilinearGraph >>> graph = DualRectilinearGraph(([0, 1, 3], [0, 5, 15, 30])) >>> graph.x_of_corner array([ 2.5, 10. , 22.5, 2.5, 10. , 22.5]) >>> graph.y_of_corner array([ 0.5, 0.5, 0.5, 2. , 2. , 2. ]) >>> graph.number_of_cells == 2 True >>> graph.faces_at_cell array([[3, 5, 2, 0], [4, 6, 3, 1]])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
- class DualStructuredQuadGraph(node_y_and_x, shape=None, sort=True)[source]#
Bases:
DualGraph
,StructuredQuadGraph
Dual graph of a structured grid of quadrilaterals.
Examples
>>> from landlab.graph import DualStructuredQuadGraph >>> node_y = [-1, -2, -3, ... 0, 0, 0, ... 1, 2, 3] >>> node_x = [ 0, 1, 2, ... 0, 2, 3, ... 0, 1, 2] >>> graph = DualStructuredQuadGraph((node_y, node_x), shape=(3, 3), sort=True) >>> graph.number_of_corners == 4 True >>> graph.y_of_corner array([-1.25, -0.75, 0.75, 1.25]) >>> graph.x_of_corner array([ 2. , 0.75, 0.75, 2. ]) >>> graph.node_at_cell array([4])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- static get_node_at_cell(shape)[source]#
Set up an array that gives the node at each cell.
Examples
>>> from landlab.graph.structured_quad import DualStructuredQuadGraph >>> DualStructuredQuadGraph.get_node_at_cell((5, 6)) array([ 7, 8, 9, 10, 13, 14, 15, 16, 19, 20, 21, 22])
- static get_nodes_at_face(shape)[source]#
Set up an array that gives the nodes on either side of each face.
Examples
>>> from landlab.graph.structured_quad import DualStructuredQuadGraph >>> DualStructuredQuadGraph.get_nodes_at_face((3, 4)) array([[ 1, 5], [ 2, 6], [ 4, 5], [ 5, 6], [ 6, 7], [ 5, 9], [ 6, 10]])
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
- class DualUniformRectilinearGraph(shape, spacing=1.0, origin=(0.0, 0.0))[source]#
Bases:
DualGraph
,UniformRectilinearGraph
Create a dual graph for a uniform rectilinear grid.
Examples
>>> from landlab.graph import DualUniformRectilinearGraph >>> graph = DualUniformRectilinearGraph((4, 3)) >>> graph.x_of_corner array([ 0.5, 1.5, 0.5, 1.5, 0.5, 1.5]) >>> graph.y_of_corner array([ 0.5, 0.5, 1.5, 1.5, 2.5, 2.5]) >>> graph.number_of_cells == 2 True >>> graph.faces_at_cell array([[2, 3, 1, 0], [5, 6, 4, 3]])
- property adjacent_corners_at_corner#
Get adjacent corners.
See also
Graph.adjacent_nodes_at_node
- property adjacent_faces_at_face#
- property angle_of_face#
Get the angle of each face.
See also
Graph.angle_of_link
- property area_of_cell#
Get the area of each cell.
See also
Graph.area_of_patch
- property cells_at_corner#
- property cells_at_face#
- property corner_at_face_head#
Get corners at face head.
See also
Graph.node_at_link_head
- property corner_at_face_tail#
Get corners at face tail.
See also
Graph.node_at_link_tail
- property corner_x#
- property corner_y#
- property corners#
A shaped array of corner ids.
See also
Graph.nodes
- property corners_at_bottom_edge#
- property corners_at_cell#
Get the corners that define a cell.
See also
Graph.nodes_at_patch
- property corners_at_face#
Get corners at either end of faces.
See also
Graph.nodes_at_link
- property corners_at_left_edge#
- property corners_at_nodes_of_grid#
Nodes at nodes of grid.
See also
Graph.nodes_at_corners_of_grid
- property corners_at_right_edge#
- property corners_at_top_edge#
- property face_dirs_at_corner#
- property faces_at_cell#
Get the faces that define a cell.
See also
Graph.links_at_patch
- property faces_at_corner#
- property horizontal_faces#
- property length_of_face#
Get the length of faces.
See also
Graph.length_of_link
- property midpoint_of_face#
Get the middle of faces.
See also
Graph.midpoint_of_link
- property node_corners#
- property number_of_cells#
Get the number of cells.
See also
Graph.number_of_patches
- property number_of_corner_columns#
- property number_of_corner_rows#
- property number_of_corners#
Get total number of corners.
See also
Graph.number_of_nodes
- property number_of_faces#
Get corners at face head.
See also
Graph.number_of_links
- property perimeter_corners#
- property unit_vector_at_corner#
Get a unit vector for each corner.
See also
Graph.unit_vector_at_node
- property unit_vector_at_face#
Make arrays to store the unit vectors associated with each face.
See also
Graph.unit_vector_at_link
- property vertical_faces#
- property x_of_corner#
Get x-coordinate of corner.
See also
Graph.x_of_node
- property xy_of_cell#
Get the centroid of each cell.
See also
Graph.xy_of_patch
- property xy_of_corner#
Get x and y-coordinates of corner.
See also
Graph.xy_of_node
- property xy_of_face#
- property y_of_corner#
Get y-coordinate of corner.
See also
Graph.y_of_node
- class RectilinearGraph(nodes, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Graph of a rectlinear grid of nodes.
Examples
>>> from landlab.graph import RectilinearGraph >>> graph = RectilinearGraph(([0, 1, 2, 3], [1, 4, 8])) >>> graph.number_of_nodes 12 >>> graph.y_of_node array([ 0., 0., 0., 1., 1., 1., 2., 2., 2., 3., 3., 3.]) >>> graph.x_of_node array([ 1., 4., 8., 1., 4., 8., 1., 4., 8., 1., 4., 8.])
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- class StructuredQuadGraph(coords, shape=None, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- class UniformRectilinearGraph(shape, spacing=1.0, origin=0.0, sort=False)[source]#
Bases:
StructuredQuadGraphExtras
Graph of a structured grid of quadrilaterals.
Examples
>>> from landlab.graph import UniformRectilinearGraph >>> graph = UniformRectilinearGraph((4, 3), spacing=(1, 2), origin=(-1, 0)) >>> graph.number_of_nodes 12 >>> graph.y_of_node array([-1., -1., -1., 0., 0., 0., 1., 1., 1., 2., 2., 2.]) >>> graph.x_of_node array([ 0., 2., 4., 0., 2., 4., 0., 2., 4., 0., 2., 4.]) >>> graph.links_at_node array([[ 0, 2, -1, -1], [ 1, 3, 0, -1], [-1, 4, 1, -1], [ 5, 7, -1, 2], [ 6, 8, 5, 3], [-1, 9, 6, 4], [10, 12, -1, 7], [11, 13, 10, 8], [-1, 14, 11, 9], [15, -1, -1, 12], [16, -1, 15, 13], [-1, -1, 16, 14]]) >>> graph.link_dirs_at_node array([[-1, -1, 0, 0], [-1, -1, 1, 0], [ 0, -1, 1, 0], [-1, -1, 0, 1], [-1, -1, 1, 1], [ 0, -1, 1, 1], [-1, -1, 0, 1], [-1, -1, 1, 1], [ 0, -1, 1, 1], [-1, 0, 0, 1], [-1, 0, 1, 1], [ 0, 0, 1, 1]], dtype=int8) >>> graph.nodes_at_link array([[ 0, 1], [ 1, 2], [ 0, 3], [ 1, 4], [ 2, 5], [ 3, 4], [ 4, 5], [ 3, 6], [ 4, 7], [ 5, 8], [ 6, 7], [ 7, 8], [ 6, 9], [ 7, 10], [ 8, 11], [ 9, 10], [10, 11]]) >>> graph.links_at_patch array([[ 3, 5, 2, 0], [ 4, 6, 3, 1], [ 8, 10, 7, 5], [ 9, 11, 8, 6], [13, 15, 12, 10], [14, 16, 13, 11]]) >>> graph.nodes_at_patch array([[ 4, 3, 0, 1], [ 5, 4, 1, 2], [ 7, 6, 3, 4], [ 8, 7, 4, 5], [10, 9, 6, 7], [11, 10, 7, 8]])
Define a graph of connected nodes.
- Parameters:
mesh (Dataset) – xarray Dataset that defines the topology in ugrid format.
- property dx#
- property dy#
- property origin#
- property spacing#