refactor(api-naming): A1–A3 standardize internal function names across functionals

A1: assign_*_dof_indices → assign_<geom>_<scope>_dof_indices
  - assign_vertex_dof_indices (spherical) → assign_spherical_vertex_dof_indices
  - assign_all_spherical_dof_indices → assign_spherical_all_dof_indices
  - assign_all_dof_indices (hyper_ideal) → assign_hyper_ideal_all_dof_indices
  - euclidean/cp_euclidean/inversive_distance unchanged (already correct)
  - Add [[deprecated]] aliases for backward compatibility

A2: compute_*_from_mesh standardization
  - compute_lambda0_from_mesh (spherical) → compute_spherical_lambda0_from_mesh
  - others unchanged (euclidean, inversive_distance have geometry prefix already)
  - Add [[deprecated]] alias for backward compatibility

A3: gradient_check_<geom> standardization
  - gradient_check (hyper_ideal) → gradient_check_hyper_ideal
  - others already follow the convention
  - Add [[deprecated]] alias for backward compatibility

All call sites updated automatically. 290/290 tests pass.
Compile warnings: expected [[deprecated]] warnings on old names.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Tarik Moussa
2026-05-31 14:48:13 +02:00
parent 30a132de60
commit 45f76e6496
2 changed files with 57 additions and 7 deletions

View File

@@ -105,7 +105,7 @@ inline int hyper_ideal_dimension(const ConformalMesh& mesh, const HyperIdealMaps
/// rotational mode for an all-hyper-ideal configuration).
///
/// \returns total DOF count = `num_vertices(mesh) + num_edges(mesh)`.
inline int assign_all_dof_indices(ConformalMesh& mesh, HyperIdealMaps& m)
inline int assign_hyper_ideal_all_dof_indices(ConformalMesh& mesh, HyperIdealMaps& m)
{
int idx = 0;
for (auto v : mesh.vertices()) m.v_idx[v] = idx++;
@@ -468,7 +468,7 @@ inline HyperIdealResult evaluate_hyper_ideal(
///
/// Returns `true` iff `|G[i] fd[i]| / max(1, |G[i]|) < tol` for every
/// DOF. Defaults `eps = 1e-5`, `tol = 1e-4` match the Java `FunctionalTest`.
inline bool gradient_check(
inline bool gradient_check_hyper_ideal(
ConformalMesh& mesh,
const std::vector<double>& x0,
const HyperIdealMaps& m,
@@ -501,4 +501,25 @@ inline bool gradient_check(
return ok;
}
// ── Deprecated aliases (A1, A3 standardization) ────────────────────────────
// Use the standardized names assign_<geom>_<scope>_dof_indices and
// gradient_check_<geom> across all five functionals.
[[deprecated("use assign_hyper_ideal_all_dof_indices instead")]]
inline int assign_all_dof_indices(ConformalMesh& mesh, HyperIdealMaps& m)
{
return assign_hyper_ideal_all_dof_indices(mesh, m);
}
[[deprecated("use gradient_check_hyper_ideal instead")]]
inline bool gradient_check(
ConformalMesh& mesh,
const std::vector<double>& x0,
const HyperIdealMaps& m,
double eps = 1e-5,
double tol = 1e-4)
{
return gradient_check_hyper_ideal(mesh, x0, m, eps, tol);
}
} // namespace conformallab