EFG Galerkin Assembly — Background Cell Domain Integration

Implemented in: assembler.py — assemble_stiffness_galerkin()

1. Galerkin Formulation

The Element-Free Galerkin (EFG) method (Belytschko et al., 1994) uses identical trial and test spaces (both MLS). The global weak form is:

∫Ω δεT D ε dΩ = ∫Γt δuT t̄ dΓ

Substituting the MLS approximation gives the symmetric stiffness matrix:

KIJ = ∫Ω BIT D BJ dΩ

Unlike MLPG5, the resulting K is symmetric positive semi-definite (symmetric positive definite after essential BC enforcement).

2. Background Cell Integration

Since there are no elements, the domain integral ∫Ω must be evaluated on a separate integration mesh — the background cells. GearMaster triangulates the node cloud directly with scipy.spatial.Delaunay (assemble_stiffness_galerkin) and uses each triangle as an integration cell. Cells adapt automatically to the local node density and, once clipped to the CAD domain, conform closely to concave boundaries and holes.

Delaunay triangulation is the dual of the Voronoi tessellation already used for MLPG5 subdomains (see Voronoi Subdomains), but it is computed directly with scipy.spatial.Delaunay on the plain node set rather than derived from the (mirror-augmented) Voronoi diagram — this avoids reconstructing triangle connectivity by hand and sidesteps degeneracies (near-cocircular points) that Qhull already handles robustly.

  1. Triangulate the 2-D node cloud: tri = scipy.spatial.Delaunay(nodes_2d).
  2. For each triangle, compute its centroid and test it against domain_polygon / hole_polygons (via matplotlib.path.Path.contains_points). Triangles whose centroid falls outside the domain or inside a hole are discarded — this removes the classic Delaunay-of-convex-hull artefact of "ghost" triangles bridging concave notches or internal voids.
  3. For each retained triangle, apply a symmetric triangle Gauss rule (gauss_rule_triangle: 1/3/6-point rules depending on n_gauss, Dunavant order-4 6-point rule for n_gauss ≥ 3, all-positive weights).
  4. As a fine-grained safety net, boundary triangles that pass the centroid test but still straddle a concave edge are additionally clipped per Gauss point against the same domain/hole polygons.

Physical quadrature weight for a triangle T: wphys = area(T) × wi, with barycentric points L1v1 + L2v2 + L3v3.

Why Delaunay and not Voronoi cells for domain integration: a Voronoi cell is a polygon with a variable number of sides (some unbounded at the domain edge) and would need to be sub-triangulated before Gauss quadrature could be applied anyway. A Delaunay triangle is already the natural quadrature unit. Voronoi cells remain the correct choice for MLPG5's boundary integration (see Voronoi Subdomains); Delaunay triangles are the correct choice for EFG's domain integration.

EFG Assembly Algorithm

  1. Triangulate the node cloud with scipy.spatial.Delaunay.
  2. For each triangle whose centroid lies inside the domain (outside all holes):
    1. Map the barycentric Gauss rule (gauss_rule_triangle) to physical coordinates; weight = triangle area × normalized weight.
    2. For each Gauss point xg (re-clipped to the domain as a safety net):
      • Query candidate nodes via cKDTree (radius rmax).
      • Evaluate MLS shape functions and derivatives.
      • Build BI, BJ for all support nodes.
      • Compute constitutive matrix D at xg (from node material assignments).
      • Accumulate K[dof_I, dof_J] += wg × BIT D BJ.

3. Properties of the Galerkin Stiffness Matrix

GUI status: The EFG Galerkin assembler is implemented, functional, and exposed in the GUI: the solver editor's assembly-strategy selector includes an "EFG Galerkin — Global Domain Integration" option alongside MLPG5. The "Nodal Subdomain → Shape" row (normally MLPG5's circular/rectangular/Voronoi selector) instead shows a read-only "Delaunay (EFG background cells)" entry when EFG is selected, and its 3D preview draws the Delaunay background triangulation. MLPG5 Voronoi remains the recommended and most extensively validated assembly for production use.

4. Comparison: EFG Galerkin vs. MLPG5

Property EFG Galerkin MLPG5
Integration type Domain (background cell) Boundary (subdomain contour)
Stiffness symmetry Symmetric SPD Non-symmetric
Background structure needed Yes (Delaunay background cells) No (subdomains per node)
Integration points per node Many (over full domain) Few (over local boundary)
Suitable for non-convex domains Yes (Delaunay + centroid/hole clip) Yes (Voronoi + PyClipper)
GUI availability Available Default

5. References