landlab.graph.quasi_spherical.dual_icosphere¶
icosphere_global_grid: Create a Landlab global (i.e., quasi-spherical) grid based on an IcoSphere, which is formed by iteratively densifying an icosahedron.
Greg Tucker, University of Colorado Boulder, September 2023
- class DualIcosphereGraph[source]¶
Bases:
object
A Landlab global (quasi-spherical) graph type based on an IcoSphere.
- Parameters:
Initialize DualIcosphereGraph
- Parameters:
Notes
Data structures set up include the following (note that n_cells = n_nodes and n_faces = n_links): - coords_of_node : ndarray of float (n_nodes, 3) - x_of_node, y_of_node, z_of_node : ((n_nodes, ) views of coords_of_node) - coords_of_corner : ndarray of float (n_corners, 3) - x_of_corner, y_of_corner, z_of_corner : ndarray of float (n_corners, ) - length_of_link : ndarray of float (n_links, ) - nodes_at_link : ndarray of int (n_links, 2) - node_at_link_tail, node_at_link_head : (n_links, ) views of nodes_at_link - links_at_node : ndarray of int (n_nodes, 6) - cell_at_node, node_at_cell : ndarray of int (n_nodes, ) - corners_at_face : ndarray of int (n_links, 2) - corners_at_node, corners_at_cell : ndarray of int (n_nodes, 6) - area_of_cell : ndarray of float (n_nodes, ) - length_of_face : ndarray of float (n_links, ) - link_at_face, face_at_link : ndarray of int (n_links, ) - faces_at_cell : ndarray of int (n_nodes, 6) - adjacent_nodes_at_node : ndarray of int (n_nodes, 6)
Examples
>>> import numpy as np
Basic example: dodecahedron
>>> ico = DualIcosphereGraph() >>> np.round(ico.coords_of_node[0], 3) array([-0.526, 0.851, 0. ]) >>> ico.r_of_node[0] 1.0 >>> int(ico.phi_of_node[0] * 100), int(ico.theta_of_node[0] * 100) (212, 157) >>> np.round(ico.coords_of_corner[1], 3) array([-0. , 0.934, 0.357]) >>> round(ico.length_of_link[0], 3) 1.107 >>> ico.nodes_at_link[0] array([ 0, 11]) >>> ico.links_at_node[0] array([ 0, 2, 4, 6, 8, -1]) >>> ico.cell_at_node[0] 0 >>> ico.node_at_cell[1] 1 >>> ico.corners_at_face[0] array([0, 4]) >>> int(10000 * ico.length_of_face[0]) 7297 >>> ico.corners_at_node[0] array([ 3, 4, 0, 1, 2, -1]) >>> ico.corners_at_cell[0] array([ 3, 4, 0, 1, 2, -1]) >>> int(1e6 * ico.area_of_cell[0]) 1047197 >>> ico.link_at_face[2] 2 >>> ico.face_at_link[3] 3 >>> ico.faces_at_cell[0] array([ 0, 2, 4, 6, 8, -1]) >>> ico.adjacent_nodes_at_node[0] array([11, 5, 1, 7, 10, -1])
Icosphere with 1 level of subdivision
>>> ico = DualIcosphereGraph(mesh_densification_level=1) >>> ico.number_of_patches 80
- __init__(radius=1.0, mesh_densification_level=0)[source]¶
Initialize DualIcosphereGraph
- Parameters:
Notes
Data structures set up include the following (note that n_cells = n_nodes and n_faces = n_links): - coords_of_node : ndarray of float (n_nodes, 3) - x_of_node, y_of_node, z_of_node : ((n_nodes, ) views of coords_of_node) - coords_of_corner : ndarray of float (n_corners, 3) - x_of_corner, y_of_corner, z_of_corner : ndarray of float (n_corners, ) - length_of_link : ndarray of float (n_links, ) - nodes_at_link : ndarray of int (n_links, 2) - node_at_link_tail, node_at_link_head : (n_links, ) views of nodes_at_link - links_at_node : ndarray of int (n_nodes, 6) - cell_at_node, node_at_cell : ndarray of int (n_nodes, ) - corners_at_face : ndarray of int (n_links, 2) - corners_at_node, corners_at_cell : ndarray of int (n_nodes, 6) - area_of_cell : ndarray of float (n_nodes, ) - length_of_face : ndarray of float (n_links, ) - link_at_face, face_at_link : ndarray of int (n_links, ) - faces_at_cell : ndarray of int (n_nodes, 6) - adjacent_nodes_at_node : ndarray of int (n_nodes, 6)
Examples
>>> import numpy as np
Basic example: dodecahedron
>>> ico = DualIcosphereGraph() >>> np.round(ico.coords_of_node[0], 3) array([-0.526, 0.851, 0. ]) >>> ico.r_of_node[0] 1.0 >>> int(ico.phi_of_node[0] * 100), int(ico.theta_of_node[0] * 100) (212, 157) >>> np.round(ico.coords_of_corner[1], 3) array([-0. , 0.934, 0.357]) >>> round(ico.length_of_link[0], 3) 1.107 >>> ico.nodes_at_link[0] array([ 0, 11]) >>> ico.links_at_node[0] array([ 0, 2, 4, 6, 8, -1]) >>> ico.cell_at_node[0] 0 >>> ico.node_at_cell[1] 1 >>> ico.corners_at_face[0] array([0, 4]) >>> int(10000 * ico.length_of_face[0]) 7297 >>> ico.corners_at_node[0] array([ 3, 4, 0, 1, 2, -1]) >>> ico.corners_at_cell[0] array([ 3, 4, 0, 1, 2, -1]) >>> int(1e6 * ico.area_of_cell[0]) 1047197 >>> ico.link_at_face[2] 2 >>> ico.face_at_link[3] 3 >>> ico.faces_at_cell[0] array([ 0, 2, 4, 6, 8, -1]) >>> ico.adjacent_nodes_at_node[0] array([11, 5, 1, 7, 10, -1])
Icosphere with 1 level of subdivision
>>> ico = DualIcosphereGraph(mesh_densification_level=1) >>> ico.number_of_patches 80
- __new__(**kwargs)¶
- property area_of_patch¶
- property cell_at_node¶
- property corners_at_cell¶
- property face_at_link¶
- property faces_at_cell¶
Face-cell and node-link numbering are the same!
- property link_at_face¶
- property node_at_cell¶
- property patches_at_node¶
- property phi_of_node¶
- property r_of_node¶
- property theta_of_node¶