refactor(api): consistent naming for spherical + hyper-ideal helpers (A1–A3)
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m20s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped

Standardize the low-level free-function API on <verb>_<geom>_<rest>,
matching the already-consistent setup_<geom>_maps. Old names kept as
[[deprecated]] inline aliases for one release; all internal call sites
migrated.

Renames:
  assign_vertex_dof_indices      -> assign_spherical_vertex_dof_indices
  assign_all_spherical_dof_indices -> assign_spherical_all_dof_indices
  assign_all_dof_indices         -> assign_hyper_ideal_all_dof_indices
  compute_lambda0_from_mesh      -> compute_spherical_lambda0_from_mesh
  gradient_check                 -> gradient_check_hyper_ideal

A4/A5 (public CGAL API) intentionally deferred pending the license/
provenance decision (see CGAL submission audit G0/G1).

Verified: 277/277 CGAL tests pass, no deprecation warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-31 09:15:22 +02:00
parent e13e7ea8e7
commit 65fc8ac816
16 changed files with 127 additions and 90 deletions

View File

@@ -41,10 +41,10 @@ static std::vector<double> make_x_all_variable(
ConformalMesh& mesh, HyperIdealMaps& maps,
double b_val, double a_val)
{
int n = assign_all_dof_indices(mesh, maps);
int n = assign_hyper_ideal_all_dof_indices(mesh, maps);
std::vector<double> x(static_cast<std::size_t>(n));
// Vertices first, then edges (matching assign_all_dof_indices order)
// Vertices first, then edges (matching assign_hyper_ideal_all_dof_indices order)
for (auto v : mesh.vertices())
x[static_cast<std::size_t>(maps.v_idx[v])] = b_val;
for (auto e : mesh.edges())
@@ -62,7 +62,7 @@ TEST(HyperIdealFunctional, HessianSymmetryCheck)
// Hessian is now implemented (numerical FD). Verify it is symmetric.
auto mesh = make_triangle();
auto maps = setup_hyper_ideal_maps(mesh);
int n = assign_all_dof_indices(mesh, maps);
int n = assign_hyper_ideal_all_dof_indices(mesh, maps);
std::vector<double> x(static_cast<std::size_t>(n), 0.5);
auto H = hyper_ideal_hessian_sym(mesh, x, maps);
@@ -86,7 +86,7 @@ TEST(HyperIdealFunctional, GradientCheck_AllHyperIdealTriangle)
auto maps = setup_hyper_ideal_maps(mesh);
auto x = make_x_all_variable(mesh, maps, /*b=*/1.0, /*a=*/0.5);
EXPECT_TRUE(gradient_check(mesh, x, maps))
EXPECT_TRUE(gradient_check_hyper_ideal(mesh, x, maps))
<< "Finite-difference gradient check failed on all-hyper-ideal triangle";
}
@@ -103,7 +103,7 @@ TEST(HyperIdealFunctional, GradientCheck_ExtendedDomain)
auto maps = setup_hyper_ideal_maps(mesh);
auto x = make_x_all_variable(mesh, maps, /*b=*/2.0, /*a=*/1.5);
EXPECT_TRUE(gradient_check(mesh, x, maps))
EXPECT_TRUE(gradient_check_hyper_ideal(mesh, x, maps))
<< "Finite-difference gradient check failed in extended domain";
}
@@ -120,7 +120,7 @@ TEST(HyperIdealFunctional, GradientCheck_TetrahedronAllVariable)
auto maps = setup_hyper_ideal_maps(mesh);
auto x = make_x_all_variable(mesh, maps, /*b=*/1.0, /*a=*/0.5);
EXPECT_TRUE(gradient_check(mesh, x, maps))
EXPECT_TRUE(gradient_check_hyper_ideal(mesh, x, maps))
<< "Finite-difference gradient check failed on all-variable tetrahedron";
}
@@ -136,7 +136,7 @@ TEST(HyperIdealFunctional, EnergyFiniteAtTestPoint)
{
auto mesh = make_quad_strip();
auto maps = setup_hyper_ideal_maps(mesh);
int n = assign_all_dof_indices(mesh, maps);
int n = assign_hyper_ideal_all_dof_indices(mesh, maps);
// Values taken from the Java testFunctionalAtNaNValue spirit:
// large-ish but positive DOF values that could expose degenerate paths.
@@ -177,7 +177,7 @@ TEST(HyperIdealFunctional, GradientCheck_MixedIdealHyperIdeal)
// DOF vector: [b1, b2, a_e0, a_e1, a_e2]
std::vector<double> x = {1.0, 1.0, 0.5, 0.5, 0.5};
EXPECT_TRUE(gradient_check(mesh, x, maps))
EXPECT_TRUE(gradient_check_hyper_ideal(mesh, x, maps))
<< "Finite-difference gradient check failed for mixed ideal / hyper-ideal";
}
@@ -194,7 +194,7 @@ TEST(HyperIdealFunctional, GradientCheck_Fan6AllVariable)
auto maps = setup_hyper_ideal_maps(mesh);
auto x = make_x_all_variable(mesh, maps, /*b=*/1.0, /*a=*/0.5);
EXPECT_TRUE(gradient_check(mesh, x, maps))
EXPECT_TRUE(gradient_check_hyper_ideal(mesh, x, maps))
<< "Finite-difference gradient check failed on fan-6 mesh";
}