You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anphon: convert kpoint/system/fcs_phonon/write_phonons arrays to NDArray (P8)
Final phase of the allocate()/deallocate() retirement. The three
k-point owner classes (KpointGeneral, KpointMeshUniform,
KpointBandStructure) hold xk/kvec_na/kaxis via NDArray, which makes
their tables deep-const through the const KpointMeshUniform* borrows
everywhere; the read-only view parameters that were sloppily declared
mutable become const along the way (exec_interpolation's
xk_dense/kvec_dense, duplicate_xk_boundary, compute_dV2_dumn and
compute_d2V2_dumn2, and the non-template rotvec overloads' vec_in),
and pointer-copy aliases of the k tables become reference bindings.
Fcs_phonon::force_constant_with_cell converts too, surfacing three
methods that mutated it through a shallow const
(replicate_force_constants, load_fcs_from_file, MPI_Bcast_fcs_array) -
they lose the qualifier, and examine_translational_invariance's switch
cases gain scopes for the now non-trivially-constructed accumulators.
System, symmetry_core, and write_phonons locals convert wholesale.
The only allocate() calls left in anphon are the spglib C-ABI
boundaries (double(*)[3] / int(*)[3][3] in symmetry_core and
relaxation), each carrying a comment saying why; no raw new[] remains.
Full 8-suite regression battery + test_units pass, alm still builds
against the shared mathfunctions.h, and the ndarray unit test passes.
A/B timing vs the pre-migration binary: Si RTA -0.14%, BaTiO3 SCPH
+0.32%.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments