graphlow.core.MeshTopology#

class graphlow.core.MeshTopology(mesh: TensorMesh[T])#

Topology API for fixed-connectivity meshes.

This class provides:

  • Access to basic connectivity and cell type information from pvmesh.

  • Lazy construction and caching of incidence/adjacency skeletons (SciPy sparse) and their backend-materialized counterparts.

  • Block views (fixed-length vs jagged) for vectorized geometry/topology operations.

  • Mapping operations between point-, face-, and cell-associated fields.

All topology-derived host-side data is backend-neutral and cached. Backend materialization is delegated to graphlow.core.cache.BackendCache.

Notes

Caches assume that connectivity does not change. If connectivity changes, call invalidate().

Attributes

n_cells

Number of cells in the mesh.

n_points

Number of points in the mesh.

Methods

cell_adjacency([layout])

Materialize cell adjacency (CC).

cell_block(cell_type)

Return cell block for specified cell type.

cell_conn()

Cell connectivity array (VTK-style flattened connectivity).

cell_degree_matrix([layout])

Materialize cell degree matrix.

cell_face_incidence([layout])

Materialize cell-face incidence (CF).

cell_laplacian_matrix([layout])

Materialize cell Laplacian matrix.

cell_offsets()

Cell offsets array (VTK-style).

cell_point_incidence([layout])

Materialize cell-point incidence (CP).

cell_tet_conn()

(n_cell, 4)-shaped cell connectivity array for tet cells.

cell_types()

Cell types array (VTK cell type IDs).

degree_cc()

Degree of cell to cell.

degree_cf()

Degree of cell to face.

degree_cp()

Degree of cell to point.

degree_fc()

Degree of face to cell.

degree_fp()

Degree of face to point.

degree_pc()

Degree of point to cell.

degree_pf()

Degree of point to face.

degree_pp()

Degree of point to point.

face_block(face_type[, boundary_only])

Return face block for specified face type.

face_cell_incidence([layout])

Materialize face-cell incidence (FC).

face_point_incidence([layout])

Materialize face-point incidence (FP).

face_registry()

Build or return the cached face registry for a volume mesh.

free_backend_sparse([name, layout])

Free backend sparse.

free_host_skeletons([name])

Free host skeletons.

get_derived_skeleton(derived, name)

Get or build derived skeleton (Laplacian, Degree, etc.).

get_skeleton(name)

Get or build basic skeleton (CP, PC, CC, PP, FC, CF, FP, PF).

invalidate()

Drop all topology caches.

is_unique_cell()

map_cell_to_face(x_cell, mode[, method])

Map cell field to face.

map_cell_to_point(x_cell, mode[, method])

Map cell field to point.

map_face_to_cell(x_face, mode[, method])

Map face field to cell.

map_face_to_point(x_face, mode[, method])

Map face field to point.

map_point_to_cell(x_point, mode[, method])

Map point field to cell.

map_point_to_face(x_point, mode[, method])

Map point field to face.

median_cells(x_cell[, n_hop])

Compute median among n-hop cell neighbors.

median_points(x_point[, n_hop])

Compute median among n-hop point neighbors.

mesh_dim()

Maximum topological dimension present in the mesh.

normalized_cell_adjacency([layout])

Materialize normalized cell adjacency.

normalized_point_adjacency([layout])

Materialize normalized point adjacency.

point_adjacency([layout])

Materialize point adjacency (PP).

point_cell_incidence([layout])

Materialize point-cell incidence (PC).

point_degree_matrix([layout])

Materialize point degree matrix.

point_face_incidence([layout])

Materialize point-face incidence (PF).

point_laplacian_matrix([layout])

Materialize point Laplacian matrix.

unique_cell_types()

Unique cell type IDs present in the mesh.