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
Refactor: remove PARAM usage from hsolver.cpp and two redundant reads
Group A (redundant reads -- the value was already available locally):
- hsolver_pw.cpp: `PARAM.globalv.use_uspp` -> `this->use_uspp`. HSolverPW
already receives use_uspp through its constructor (injected from
PARAM.globalv.use_uspp at the esolver level), so the direct read was
duplicating an existing member.
- hsolver_lcao.cpp: `PARAM.inp.nspin` -> `nspin`. HSolverLCAO::solve()
already takes nspin as an argument; it is now threaded into
parakSolve() instead of being re-read from PARAM.
Group B (hsolver.cpp, now completely PARAM-free):
set_diagethr_ks() and set_diagethr_sdft() were already pure parameter-based
functions except for two leaked reads of PARAM.inp.scf_thr / PARAM.inp.nelec
in their nscf branches.
- set_diagethr_ks(): added `scf_thr_in`. The nscf branch used
PARAM.inp.nelec even though the function already had a `nelec_in`
parameter; both are now `nelec_in`. This is behaviour-preserving because
the only call site passes PARAM.inp.nelec for that argument.
- set_diagethr_sdft(): added `nelec_in` and `scf_thr_in`.
- Dropped the now-unused parameter.h include and added the <algorithm> /
<cmath> includes it was relying on transitively.
Call sites in source_esolver/esolver_ks.cpp updated accordingly; these are
the only external callers of the two functions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments