3.3. pyafv.FiniteVoronoiSimulator
- class pyafv.FiniteVoronoiSimulator(pts, phys, backend=None)
Simulator for the active-finite-Voronoi (AFV) model.
This class provides an interface to simulate the finite Voronoi model. It wraps around the two backend implementations, which may be either a Cython-accelerated version or a pure Python fallback.
- Parameters:
pts (ndarray) – (N,2) array of initial cell center positions.
phys (PhysicalParams) – Physical parameters used within this simulator.
backend (Literal['cython', 'python'] | None) – Optional, specify “python” to force the use of the pure Python fallback implementation.
- Raises:
ValueError – If pts does not have shape (N,2).
TypeError – If phys is not an instance of PhysicalParams.
Attributes
Preferred areas for all cells (read-only).
Methods
build()Build the finite-Voronoi structure and compute forces, returning a dictionary of diagnostics.
plot_2d([ax, show])Build the finite-Voronoi structure and render a 2D snapshot.
update_params(phys)Update physical parameters.
update_positions(pts[, A0])Update cell center positions.
Update the preferred areas for all cells.
Build standard Voronoi structure for current points.
_per_cell_geometry(vor, vertices_all, ...)Build the finite-Voronoi per-cell geometry and energy contributions.