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:
Tarik Moussa
2026-05-31 01:49:05 +02:00
parent d1399ca82f
commit ccbfd852b2
4 changed files with 14 additions and 20 deletions

View File

@@ -59,13 +59,10 @@ int main(int argc, char* argv[])
compute_euclidean_lambda0_from_mesh(mesh, maps);
// ── Step 3: pin the first vertex (gauge fix) ──────────────────────────
auto vit = mesh.vertices().begin();
Vertex_index v_pinned = *vit++;
maps.v_idx[v_pinned] = -1; // pinned: u[v_pinned] = 0 (fixed)
int idx = 0;
for (; vit != mesh.vertices().end(); ++vit)
maps.v_idx[*vit] = idx++;
const int n = idx;
// The gauge-vertex overload pins the chosen vertex (v_idx = -1) and
// assigns sequential indices 0..n-1 to the rest in a single call.
Vertex_index v_pinned = *mesh.vertices().begin();
const int n = assign_euclidean_vertex_dof_indices(mesh, maps, v_pinned);
std::cout << "[example_euclidean] DOFs: " << n << " (1 vertex pinned).\n";