7.3.8. pyafv.FiniteVoronoiSimulator._per_cell_geometry
- FiniteVoronoiSimulator._per_cell_geometry(vor, vertices_all, ridge_vertices_all, num_vertices, vertexpair2ridge)[source]
Build the finite Voronoi per-cell geometry and energy contributions.
- Iterate each cell to:
sort polygon/arc vertices around each cell
classify edges (1 = straight Voronoi edge; 0 = circular arc)
compute area/perimeter for each cell
accumulate derivatives w.r.t. vertices (dA_poly/dh, dP_poly/dh)
register “outer” vertices created at arc intersections and track their point pairs
Warning
This is an internal method. Use with caution.
- Parameters:
vor (Voronoi) – SciPy Voronoi object for current points with extensions.
vertices_all (ndarray) – (M,2) array of all Voronoi vertices including extensions.
ridge_vertices_all (ndarray) – (R,2) array of vertex indices for each ridge.
num_vertices (int) – Number of Voronoi vertices before adding extension.
vertexpair2ridge (dict[tuple[int, int], int]) – dict mapping vertex index pairs to ridge index.
- Returns:
A diagnostics dictionary containing:
vertex_in_id: set of inner vertex ids.
vertex_out_id: set of outer vertex ids.
vertices_out: (L,2) array of outer vertex coordinates.
vertex_out_points: (L,2) array of point index pairs associated with each outer vertex.
vertex_out_da_dtheta: Array of dA/dtheta for all outer vertices.
vertex_out_dl_dtheta: Array of dL/dtheta for all outer vertices.
dA_poly_dh: Array of dA_polygon/dh for each vertex.
dP_poly_dh: Array of dP_polygon/dh for each vertex.
area_list: Array of polygon areas for each cell.
perimeter_list: Array of polygon perimeters for each cell.
point_edges_type: List of lists of edge types per cell.
point_vertices_f_idx: List of lists of vertex ids per cell.
num_vertices_ext: Number of vertices including infinite extension vertices.
- Return type: