8.4.2. pyafv.ParallelFiniteVoronoiSimulator.build
- ParallelFiniteVoronoiSimulator.build(connect=False, plot_mode=False)[source]
Build local finite Voronoi structures and merge global diagnostics.
- Do the following:
Decompose cell centers into owned domains plus halo points
Build a finite Voronoi diagram in each local subdomain
Extract diagnostics for owned cells
Merge forces and geometric quantities back into global indexing
Optionally collect global cell connectivity and per-domain plot data
- Parameters:
connect (bool) – Whether to compute cell connectivity information. Setting this to
Falsesaves some computation time when connectivity is not needed. Note that the default isFalse, unlikeFiniteVoronoiSimulator.build(), where the default isTrue.plot_mode (bool) – Whether to include per-domain plotting diagnostics. If
True, usevisualize_2d_parallel()for visualization.
- Returns:
A dictionary containing merged forces and geometric properties with keys:
forces: (N,2) array of forces on cell centers
areas: (N,) array of cell areas
perimeters: (N,) array of cell perimeters
arclens: (N,) array of non-contacting edge (arc) lengths per cell
coord_nums: (N,) integer array of coordination numbers per cell
connections: (K,2) array of connected global cell index pairs
pids: (D,) integer array of process ids used for each domain
plot_mode: Whether per-domain plot diagnostics are included
If plot_mode is
True, the dictionary also contains:owned_global_ids: List of global cell ids owned by each domain
diag_plot: List of local plotting dictionaries, each with
vertices,edges_type, andregionsfor owned cells
- Return type: