Commit 4fa13e1
Refactor: remove dead cross module includes (deepmodeling#7574)
* refactor(cell): remove unused cross-module includes in read_atoms.cpp
Drop two dead includes that create needless reverse dependencies from
source_cell onto higher layers:
- source_estate/read_orb.h (elecstate::read_orb_file not used here;
the real user is read_atoms_helper.cpp)
- source_basis/module_ao/ORB_read.h (ORB / LCAO_Orbitals not used here)
Verified by compiling the `cell` target with ENABLE_LCAO=ON so the
former `#ifdef __LCAO` block was actually exercised.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: remove dead cross-module includes on reverse-dependency edges
Static scan + per-target compile verification identified 9 unused
includes that create reverse/lateral dependency edges between modules.
Removing them weakens the coupling without any behavior change:
io -> md input_conv.cpp (md_func.h)
estate -> lcao elecstate_energy_terms.cpp, elecstate_print.cpp
(module_deepks/LCAO_deepks.h)
lcao -> pw rdmft_tools.cpp (structure_factor.h),
wavefunc_in_pw.cpp (soc.h)
lcao -> io FORCE_gamma.cpp, FORCE_k.cpp (module_hs/write_HS.h)
pw -> io forces_cc.cpp, forces_scc.cpp (module_output/output_log.h)
Verified by building io_basic, elecstate, rdmft, hamilt_lcao and
module_pwdft (ENABLE_LCAO=ON) after removal; all link targets compile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(esolver): remove 29 dead io includes (esolver -> io hygiene)
Remove unused source_io includes across the esolver drivers. These are
on the allowed esolver->io direction, so this is include hygiene rather
than decoupling, but it trims 29 needless includes.
Verified three ways:
1. `make esolver` (ENABLE_LCAO=ON) recompiles all 21 TUs, 0 errors.
2. Feature-guarded headers checked explicitly since __RAPIDJSON,
__EXX/__LIBRI and __MLALGO are OFF in this build: the json
(init_info.h/output_info.h) and restart_exx_csr.h symbols are
unused in their consumers (Json::add_output_scf_mag in
esolver_ks.cpp comes from output_info.h, which is kept).
3. Whole-file precise-symbol sweep (incl. all #ifdef blocks) finds
no specific symbol of any removed header in its consumer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor: remove 2 more dead cross-module includes
Two dead includes missed by the first reverse-edge pass:
estate -> lcao elecstate_energy_terms.cpp
(module_deltaspin/spin_constrain.h; SpinConstrain
is not referenced anywhere in the file)
esolver -> io esolver_double_xc.cpp
(module_hs/write_HS.h; only a comment mentions
ModuleIO::write_hsk(), no actual call)
Verified: no header symbol appears anywhere in the consumer (guards
included), and `make elecstate` / `make esolver` build cleanly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 548bf8f commit 4fa13e1
21 files changed
Lines changed: 0 additions & 45 deletions
File tree
- source
- source_cell
- source_esolver
- source_estate
- source_io/module_parameter
- source_lcao
- module_rdmft
- source_pw/module_pwdft
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 24 | | |
32 | 25 | | |
33 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
0 commit comments