Skip to content

Commit f84cab5

Browse files
committed
fix: use uniform scale for Bowyer-Watson insertion, not anisotropic transform
The per-simplex anisotropic transform (based on local gradient) varies across the mesh, which can produce disconnected or non-star-shaped cavities in the Bowyer-Watson algorithm, breaking its volume conservation invariant. Fix: use the uniform bounds-scaling matrix for triangulation maintenance (Bowyer-Watson insertion). The anisotropic transform is still used for point selection (choose_point_in_simplex in _ask_best_point), so anisotropic sampling behavior is preserved. Closes #74.
1 parent 2efbfb6 commit f84cab5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

adaptive/learner/learnerND.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,14 @@ def tell(self, point, value):
265265
simplex = self._pending_to_simplex.get(point)
266266
if simplex is not None and not self._simplex_exists(simplex):
267267
simplex = self.tri.locate_point(point)
268-
transform = self.get_local_transform_matrix(simplex)
268+
# Use uniform scale matrix for Bowyer-Watson insertion rather than
269+
# the per-simplex anisotropic transform. The anisotropic transform
270+
# varies locally (based on gradient), which can produce disconnected
271+
# or non-star-shaped cavities in the original space, breaking the
272+
# volume conservation invariant of Bowyer-Watson. Anisotropy still
273+
# drives point selection via choose_point_in_simplex in _ask_best_point.
269274
to_delete, to_add = self._tri.add_point(
270-
point, simplex, transform=transform)
275+
point, simplex, transform=self._scale_matrix)
271276
self.update_losses(to_delete, to_add)
272277

273278
def get_local_transform_matrix(self, simplex):

0 commit comments

Comments
 (0)