Voronoi Subdomains in MLPG5

This page gives a self-contained treatment of the Voronoi tessellation as the local integration subdomain in the MLPG5 method: its mathematical definition, its dual relationship with the Delaunay triangulation, how it is constructed and clipped in GearMaster, and a rigorous comparison with circular and rectangular alternatives.

Implemented in: assembler.py — assemble_stiffness_voronoi(), _compute_voronoi_cells(), _clip_polygon_pyclipper() (uses scipy.spatial.Voronoi and optionally pyclipper).

1. The Voronoi Diagram — Mathematical Definition

Let P = {x1, …, xN} be a finite set of points in ℜ2 (the generators or sites). The Voronoi cell of site xI is the set of all points in the plane at least as close to xI as to any other site:

VI = { x ∈ ℜ2 : |x − xI| ≤ |x − xJ|  ∀ J ≠ I }

Each cell is a (possibly unbounded) convex polygon. The Voronoi diagram is the subdivision of ℜ2 into the N cells {VI}. Key combinatorial properties:

Voronoi diagrams were introduced by Dirichlet (1850) in the context of quadratic forms and independently by Voronoi (1908). The discrete geometry community refers to them also as Dirichlet tessellations or Thiessen polygons.

2. Duality with the Delaunay Triangulation

The Voronoi diagram and the Delaunay triangulation of the same point set are geometric duals: every Voronoi vertex corresponds to a Delaunay triangle, every Voronoi edge corresponds to a Delaunay edge, and every Voronoi cell corresponds to a Delaunay vertex.

Formally, the Delaunay triangulation DT(P) is the unique triangulation (for points in general position) such that the open circumdisc of every triangle contains no other generator:

Tijk ∈ DT(P)  ⇔  circumdisc(Tijk) ∩ P = ∅

The Voronoi vertex associated with triangle Tijk is precisely the circumcentre of that triangle. The duality means:

In GearMaster, the Voronoi diagram is computed directly via scipy.spatial.Voronoi (Fortune's sweep algorithm, O(N log N)), without building the Delaunay triangulation explicitly. The duality is exploited implicitly: the Voronoi cells of a point set generated by the Poisson-disk or Delaunay samplers in GearMaster are near-regular hexagons (which is exactly the Voronoi dual of an approximately regular triangulation).

3. Voronoi Cells as MLPG5 Subdomains

In MLPG5 the stiffness contribution of node I is:

KIJ = −∮∂ΩI NT(n) DI BJ dΓ

The choice of ΩI is theoretically free, but the numerical and physical quality of the method depends critically on it. Using ΩI = VI (the Voronoi cell of node I) has a compelling set of motivations:

3.1. The Partition Property and Conservation

The Voronoi cells partition the domain exactly:

Ω = ⋃I VI,    VI ∩ VJ = ∅   (I ≠ J)

This means that every point of the domain is counted exactly once in the assembly. There are no integration gaps and no integration overlaps. For a divergence-based formulation (which MLPG5 is), exact partition directly implies local conservation: summing the equations over all subdomains recovers the global balance law exactly.

3.2. Natural Correspondence Between Node and Its Integration Region

The Voronoi cell is the region of the plane "owned" by node I in the closest-point sense. This is the most natural and physically unambiguous way to associate an integration region with a node — it corresponds to the nearest-neighbour interpolation region and provides equal-area cells (approximately) for uniform distributions.

3.3. Implicit Flux Balance on Cell Boundaries

Every Voronoi edge e_{IJ} separates cells VI and VJ. Because the outward normals at e_{IJ} are opposite for the two cells, the flux contributions at that shared edge cancel in pairs when summing over the global assembly — a discrete analogue of the interior flux cancellation in the divergence theorem. This is geometrically equivalent to the finite-volume flux conservation property.

3.4. Irregular Point Distributions

Unlike circular and rectangular subdomains, Voronoi cells adapt automatically to the local point spacing: large cells appear where nodes are sparse, small cells where nodes are dense. This makes the method naturally suited to graded and adaptive refinement, where the integration quality degrades gracefully rather than abruptly when spacing changes.

4. Construction in GearMaster

4.1. Mirror-Node Technique for Bounded Cells

The raw scipy.spatial.Voronoi output contains infinite regions for nodes on or near the convex hull: some Voronoi vertices are sent to infinity because there is no generator on the other side. To obtain bounded polygonal cells for all nodes, GearMaster applies the mirror-node technique: four sets of ghost nodes are added by reflecting the real nodes across the four sides of the bounding box:

Pmirror = Pleft ∪ Pright ∪ Pbottom ∪ Ptop

where Pleft = \{(2xmin − xi,\; yi)\}, etc. The Voronoi tessellation is computed on P ∪ Pmirror. Mirror nodes force the Voronoi ridges of boundary nodes to terminate within the bounding box, so every real node's region VI is a bounded polygon.

Only the regions corresponding to the original N real nodes (indices 0 to N−1) are retained.

4.2. Domain-Polygon Clipping with PyClipper

For non-convex domains (L-shapes, stepped beams, holes), the Voronoi cell of a boundary node may extend outside the physical domain. After computing the bounded Voronoi polygon for each node, GearMaster clips it to the true domain polygon using PyClipper (a Python wrapper for the Clipper2 polygon-clipping library):

VIclipped = VI ∩ Ω

The domain polygon Ω is the ordered CCW boundary polygon stored in GM_PointCloud.domain_polygon. It is generated at point-cloud creation time, either from the CAD model wire edges (via OpenCASCADE BRepTools_WireExplorer) or by tangent-guided nearest-neighbour traversal of the boundary nodes.

PyClipper operates with integer coordinates at a scale of 1 000 000 (1×106) to avoid floating-point precision issues. The clipped result is converted back to floating-point coordinates.

Fallback without PyClipper: If pyclipper is not installed, GearMaster falls back to clipping each Voronoi polygon to the bounding box using the Sutherland-Hodgman algorithm. This is incorrect for non-convex domains — cells near re-entrant corners will include area outside the physical domain, producing integration errors. Installing pyclipper is strongly recommended: pip install pyclipper.

4.3. Boundary Segment Exclusion

After clipping, some edges of VIclipped coincide with the domain boundary ∂Ω. These edges are excluded from the stiffness integral. The physical reason is that on ∂ΩI ∩ ∂Ω the flux NTDBJ represents the traction boundary condition, which is handled separately in the force vector (via apply_concentrated_loads()). Including it in K would double-count the boundary traction.

Segment exclusion is implemented by checking whether both endpoints of each Voronoi edge lie within a tolerance (2e-6) of any edge of the domain polygon.

5. Assembly Loop

assemble_stiffness_voronoi() — Algorithm

  1. Compute bounded Voronoi cells via _compute_voronoi_cells():
    1. Augment nodes with mirror reflections across bounding-box edges.
    2. Call scipy.spatial.Voronoi(augmented).
    3. For each real node I: extract polygon from vor.regions.
    4. Clip polygon to domain_polygon (PyClipper) or bounding box (S-H).
    5. Ensure CCW orientation; exclude boundary segments.
    6. Store list of (p0, p1, nout) per node.
  2. For each node I:
    1. Retrieve clipped Voronoi segments for cell VI.
    2. Precompute NTDI for each segment (constant along segment).
    3. For each Gauss point xg on the segment:
      • Query candidate nodes via cKDTree (query_ball_point(x_g, r_max)).
      • Evaluate MLS shape functions and derivatives at xg.
      • Build BJ for all support nodes J.
      • Accumulate K[2I:2I+2, 2J:2J+2] += −wg ⋅ NTDI BJ.
  3. If sparse_K=True: convert COO triplets to CSR matrix.

6. Comparison with Circular and Rectangular Subdomains

Property Voronoi
(default)
Rectangular
(β ≤ 0.5)
Circular
(β ≤ 0.5)
Partition of domain ✓ Exact ✓ Exact (non-overlap) ✗ Overlaps possible
Correct for irregular clouds ✓ Automatic adaptation ✗ Assumes near-regular grid ✗ Fixed radius per node
Non-convex domain support ✓ Via PyClipper ✓ Via bbox clipping ✓ Via arc clipping
Exact flux cancellation ✓ On shared Voronoi edges ✓ On axis-aligned shared sides ✗ No geometric contact
Segment count per node 4–10 (varies) 4 (fixed) 1 arc (full circle)
Symmetry of resulting K Non-symmetric Non-symmetric Non-symmetric
Dependence on β parameter ✓ None ✗ Sensitive (β ≤ 0.5) ✗ Sensitive (β ≤ 0.5)
External library required scipy (+ pyclipper) None None
Recommended use All cases; default Regular-grid clouds only Research / comparison

7. Pros and Cons Summary

Advantages of Voronoi subdomains:
Disadvantages of Voronoi subdomains:

8. References

  1. Voronoi, G. (1908). "Nouvelles applications des paramètres continus à la théorie des formes quadratiques." Journal für die reine und angewandte Mathematik, 133, 97–178. [Original Voronoi tessellation paper]
  2. Okabe, A., Boots, B., Sugihara, K., & Chiu, S. N. (2000). Spatial Tessellations: Concepts and Applications of Voronoi Diagrams, 2nd ed. Wiley. [Comprehensive monograph on Voronoi geometry, Delaunay duality, and applications]
  3. Fortune, S. (1987). "A sweepline algorithm for Voronoi diagrams." Algorithmica, 2(1–4), 153–174. DOI: 10.1007/BF01840357 [O(N log N) algorithm implemented in scipy.spatial.Voronoi]
  4. Atluri, S. N., Kim, H. G., & Cho, J. Y. (1999). "A critical assessment of the truly meshless local Petrov-Galerkin (MLPG), and local boundary integral equation (LBIE) methods." Computational Mechanics, 24(5), 348–372. DOI: 10.1007/s004660050480 [Original MLPG5 paper; discusses subdomain choice]
  5. Atluri, S. N., & Shen, S. (2002). The Meshless Local Petrov-Galerkin (MLPG) Method. Tech Science Press. [Textbook treatment of MLPG; Chapter 5 discusses Voronoi-based subdomains]
  6. Liu, G. R., & Gu, Y. T. (2005). An Introduction to Meshfree Methods and Their Programming. Springer. DOI: 10.1007/1-4020-3468-7 [Chapter 8: subdomain shapes in MLPG; compares circular, rectangular, Voronoi]
  7. Sukumar, N. (2004). "Construction of polygonal interpolants: a maximum entropy approach." International Journal for Numerical Methods in Engineering, 61(12), 2159–2181. DOI: 10.1002/nme.1193 [Demonstrates Voronoi cells as natural integration domains for nodal-based methods; Laplace shape functions are defined on Voronoi cells]
  8. Chinesta, F., Cescotto, S., Cuéto, E., & Lorong, P. (2011). Natural Element Method for the Simulation of Structures and Processes. Wiley-ISTE. [Natural neighbour / natural element methods: Voronoi and Delaunay duality as the foundation for meshfree interpolation; Section 2 gives a thorough treatment of bounded Voronoi construction via ghost/mirror nodes]