pygeon.grids.refinement module
- pygeon.grids.refinement.barycentric_split(sd)[source]
This function constructs a new grid where each original cell is split into (dim+1) subcells by introducing a new node at the cell center and connecting it to the original cell’s nodes.
- Parameters:
sd (pg.Grid) – The input grid split.
- Returns:
A new grid object representing the barycentric split of the input grid.
- Return type:
pg.Grid
- pygeon.grids.refinement.compute_cell_faces(sd, face_nodes)[source]
Computes the mapping between cells and their associated faces (including new faces created by refinement) for a given grid structure.
- Parameters:
sd (pg.Grid) – The input grid.
face_nodes (sps.csc_array) – Connectivity matrix.
- Returns:
A sparse matrix representing the mapping between the faces and cells, including orientation.
- Return type:
sps.csc_array
- pygeon.grids.refinement.compute_face_nodes(sd, new_nodes)[source]
Compute the connectivity between new faces and nodes.
- Parameters:
sd (pg.Grid) – The input grid.
new_nodes (np.ndarray) – Array of new node indices.
- Returns:
A sparse array in CSC format where each entry (i, j) indicates that node i is connected to face j in the refined grid.
- Return type:
sps.csc_array