Implemented in: assembler.py — assemble_stiffness() (circular), assemble_stiffness_rect() (rectangular), assemble_stiffness_voronoi() (Voronoi, default)
The MLPG5 method (Atluri et al., 1999) uses the Heaviside step function as test function. For the local subdomain ΩI centred at node I, integrating the equilibrium equation ∇⋅σ = 0 over ΩI and applying the divergence theorem:
where N is the 3×2 traction-normal matrix:
Substituting σ = D ε = D B u gives:
The stiffness matrix K is generally non-symmetric because the test function (Heaviside) and the trial function (MLS) belong to different spaces (Petrov-Galerkin).
For a segment of ∂ΩI with outward unit normal n = (nx, ny), the traction vector t = N σ maps the Voigt stress to the physical traction in Voigt notation:
The product NT D (2×3) is constant along each linear segment and is precomputed per segment per node row.
subdomain_shape="circular")
Each node I has a circular subdomain of radius rQ,I = β × rsupp,I. The contour integral is over the full circle (arc from 0 to 2π), clipped to the bounding box to handle boundary nodes. Gauss integration uses gauss_rule_arc() with n points on the arc.
The Gauss points are distributed along the arc via the mapping θ = mid + (dθ/2) × ξ with ξ ∈ [-1, 1]. The arc-length Jacobian is rQ × (dθ/2).
subdomain_shape="rectangular")Each node I has an axis-aligned square subdomain with half-side aI = β × rsupp,I. The contour integral is over 4 line segments. For β ≤ 0.5, rectangular subdomains never overlap:
Each side is a straight segment with constant outward normal. Gauss integration uses gauss_rule_segment(). Segments are clipped to the bounding box using _clip_rect_segments().
This variant is recommended for structural problems: it is consistent with the regular-grid point clouds used in UnifiedSampler2DRegular, gives a well-conditioned stiffness matrix, and provides a consistent force vector (no overlap artefacts).
subdomain_shape="voronoi", default)Each node I's subdomain is its Voronoi cell: the region of the plane closer to node I than to any other node. Voronoi cells partition the domain exactly — no gap, no overlap, regardless of the point distribution.
The cell boundary ∂ΩI consists of Voronoi edges (segments equidistant between pairs of nodes), which are then clipped to the physical domain polygon using PyClipper (if available) or to the bounding box otherwise.
The Voronoi tessellation is computed via scipy.spatial.Voronoi. This variant is robust for irregular point clouds (Poisson-disk, Delaunay-sampled) and produces exact domain coverage even for non-convex geometries when the domain polygon is available.
GM_PointCloud.domain_polygon. It is generated automatically at point cloud creation time. Without it, clipping falls back to the bounding box, which is incorrect for non-convex domains.
See also: Voronoi Subdomains — Detailed Theory for the full mathematical treatment, Delaunay duality, implementation details, and a pro/con comparison with circular and rectangular subdomains.
The inner J-loop is vectorised (NumPy broadcasting) to avoid Python-level iteration over support nodes. If sparse_K=True, COO triplets are accumulated and converted to CSR format after assembly.
All rules are based on Gauss-Legendre quadrature defined on the reference interval ξ ∈ [−1, 1], where optimal point locations and weights are tabulated. For n points the rule integrates polynomials up to degree 2n − 1 exactly. Each rule maps ξ to physical coordinates via a linear transformation; the change of variables introduces a Jacobian that scales the weights by the physical length of the integration domain:
Longer segments therefore carry proportionally larger weight, which is physically correct — a longer Voronoi or rectangular boundary edge contributes more to the contour integral.
| Integration domain | Function | Default n_gauss | Jacobian |
|---|---|---|---|
| Circular arc (portion) | gauss_rule_arc() | 3 (circular assembler) 4 (rect/Voronoi assemblers) | R × Δθ/2 |
| Straight segment (rectangular) | gauss_rule_segment() | 4 per side | |p1−p0|/2 |
| Voronoi edge segment | gauss_rule_segment() | 4 per edge | |p1−p0|/2 |
| Background cell (EFG Galerkin) | gauss_rule_2d() | 3 per direction (9 pts/cell) | cell area / 4 |