Commit 4ec173c
Rename some files and refactor some inclusions (#7796)
* rename structrue_factor to stru_fac and remove some redundant codes
* remove useless sf
* remove PARAM in relax_test.cpp
* remove PARAM in relax module
* fix(relax): fix Test_RELAX failure after removing PARAM global dependency
Symptom:
MODULE_RELAX_relax_new_relax failed. relax_step did nothing and all
taud/latvec values stayed at their initial values.
Root cause:
Commit 977855a replaced the global PARAM.input in Test_RELAX with a
local Input_para inp member, but missed three parameters that had been
silently inherited from the global state.
The inheritance worked because GoogleTest runs test suites in definition
order: Test_SETGRAD runs first and leaves the following values in the
global PARAM.input, which Test_RELAX reused without setting them:
- calculation = cell-relax
- force_thr = 0.001
- fixed_axes = a
After the commit each test class has its own local inp, so this hidden
sharing was lost:
- calculation defaults to scf, so setup_gradient returns true
immediately and relax_step does nothing.
- force_thr defaults to -1, which changes line_search convergence
behavior.
- fixed_axes defaults to None, which skips the stress constraint
branch and changes cell movement.
Fix:
Explicitly set the three previously-inherited parameters in
Test_RELAX::SetUp():
inp.calculation = cell-relax;
inp.force_thr = 0.001;
inp.fixed_axes = a;
Lessons learned:
When removing a global-variable dependency, audit every field read by
the code under test, including fields implicitly left behind by other
test suites. Each test should be self-contained and not rely on
inter-test-suite execution order.
* remove some useless compiling files
* increase threshold of 15_KP_HSE_SOC_symm from 10 to 11
---------
Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>1 parent 7891ac7 commit 4ec173c
53 files changed
Lines changed: 108 additions & 128 deletions
File tree
- source
- source_esolver
- source_estate
- module_charge
- module_pot
- source_hamilt/module_surchem
- test
- source_hsolver/test
- source_io
- module_bessel
- module_ctrl
- module_wannier
- test
- source_lcao
- module_ri
- source_psi
- test
- source_pw
- module_dfpt
- module_pwdft
- test
- module_stodft
- source_relax
- test
- tests/08_EXX/15_KP_HSE_SOC_symm
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
758 | | - | |
| 757 | + | |
| 758 | + | |
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
0 commit comments