docs(examples): use gauge-vertex overload everywhere (U6)
Finding-U6 from doc/reviewer/usability-audit-2026-05-31.md. The Finding-D fix (external-audit-2026-05-30) added a clean one-call gauge-vertex overload: assign_euclidean_vertex_dof_indices(mesh, maps, gauge_vertex) But all user-facing code still showed the old verbose manual loop: auto vit = mesh.vertices().begin(); maps.v_idx[*vit++] = -1; int idx = 0; for (; vit != mesh.vertices().end(); ++vit) maps.v_idx[*vit] = idx++; Replaced in three places: README.md 'Minimal usage' code block example_euclidean.cpp Step 3 example_layout.cpp pin_first() helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,14 +54,13 @@ static void set_natural_theta(ConformalMesh& mesh, EuclideanMaps& maps, int n)
|
||||
}
|
||||
|
||||
// ── Helper: pin vertex 0, assign DOF indices 0..n-1 to the rest ──────────────
|
||||
// Uses the gauge-vertex overload introduced in external-audit Finding-D:
|
||||
// assign_euclidean_vertex_dof_indices(mesh, maps, gauge) pins the chosen
|
||||
// vertex and assigns sequential indices in a single pass.
|
||||
static int pin_first(ConformalMesh& mesh, EuclideanMaps& maps)
|
||||
{
|
||||
auto vit = mesh.vertices().begin();
|
||||
maps.v_idx[*vit++] = -1; // pinned
|
||||
int idx = 0;
|
||||
for (; vit != mesh.vertices().end(); ++vit)
|
||||
maps.v_idx[*vit] = idx++;
|
||||
return idx;
|
||||
return assign_euclidean_vertex_dof_indices(
|
||||
mesh, maps, *mesh.vertices().begin());
|
||||
}
|
||||
|
||||
// ── Main ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user