8.3. pyafv.FiniteVoronoiSimulator

class FiniteVoronoiSimulator(pts, phys, backend=None)[source]

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. Otherwise, the “cython” backend is used.

Raises:

Warning

If the Cython backend cannot be imported (unless backend is set to “python”), a RuntimeWarning is raised and the pure Python implementation is used instead.

Attributes

preferred_areas

Preferred areas \(\{A_{0,i}\}\) for all cells (read-only).

Methods

build([connect])

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_preferred_areas(A0)

Update the preferred areas for all cells.

_build_voronoi_with_extensions([joggle])

Build standard Voronoi structure for current points.

_per_cell_geometry(vor, vertices_all, ...)

Build the finite Voronoi per-cell geometry and energy contributions.