Skip to content

Commit 64463eb

Browse files
Critsium-xyclaude
andauthored
Move Structure_Factor, Soc and the cal_sk_op kernel to source_cell; drop four unused upward includes (#8234)
* Move Structure_Factor, Soc and the cal_sk_op kernel to source_cell Structure_Factor holds S(G) and the per-atom phase factors exp(-iG.tau), the Fourier representation of the atomic positions. Soc holds the spin-angular coupling coefficients of the pseudopotentials. Neither is plane-wave method code, but both lived in source_pw/module_pwdft, so source_psi, source_estate and source_hamilt included source_pw for them. - stru_fac.{h,cpp}, stru_fac_k.cpp, soc.{h,cpp} move to source_cell/. soc.cpp joins the cell library. stru_fac*.cpp form a separate structure_factor object library, because they need the plane-wave basis and the cell-only unit tests do not link planewave. - The cal_sk_op kernel (wf_op.{h,cpp}, cuda/wf_op.cu, rocm/wf_op.hip.cu) moves to source_cell/kernels/. Its unused include of source_psi/psi.h is dropped; stru_fac_k.cpp now includes memory_op.h, which it used through psi.h. - The old headers in source_pw/module_pwdft forward to the new ones, so higher-layer includers are unchanged. The includers in source_psi, source_estate and source_hamilt, and the tests that compile these files, point at the new paths. No code inside the moved files changes apart from include lines. Refs #8233 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop four unused upward includes in source_estate and source_relax - edm_tddft.cpp includes module_rt/gather_mat.h and propagator.h but uses neither; only edm_tddft_lapack.cpp needs them. - elecstate_pw_sdft.cpp includes xc_functional.h but uses no XC symbol. - ions_move_lbfgs.h includes esolver_ks.h, but the class only stores an ESolver*, which esolver.h already declares. Refs #8233 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove the stru_fac.h and soc.h forwarding headers from source_pw Point the remaining includers in source_esolver, source_io, source_lcao and source_pw at source_cell/stru_fac.h and source_cell/soc.h directly, and delete the two forwarding headers left in source_pw/module_pwdft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5a7e6a6 commit 64463eb

57 files changed

Lines changed: 60 additions & 59 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎source/CMakeLists.txt‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ list(
662662
source_pw/module_pwdft/kernels/force_op.cpp
663663
source_pw/module_pwdft/kernels/stress_op.cpp
664664
source_pw/module_pwdft/kernels/onsite_op.cpp
665-
source_pw/module_pwdft/kernels/wf_op.cpp
665+
source_cell/kernels/wf_op.cpp
666666
source_pw/module_pwdft/kernels/vnl_op.cpp
667667
source_base/kernels/math_ylm_op.cpp
668668
source_hamilt/module_xc/kernels/xc_functional_op.cpp
@@ -690,7 +690,7 @@ if(USE_CUDA)
690690
source_base/module_device/cuda/memory_op.cu
691691
source_pw/module_pwdft/kernels/cuda/force_op.cu
692692
source_pw/module_pwdft/kernels/cuda/stress_op.cu
693-
source_pw/module_pwdft/kernels/cuda/wf_op.cu
693+
source_cell/kernels/cuda/wf_op.cu
694694
source_pw/module_pwdft/kernels/cuda/vnl_op.cu
695695
source_base/module_device/cuda_compat.cpp
696696
source_base/kernels/cuda/math_ylm_op.cu
@@ -729,7 +729,7 @@ if(USE_ROCM)
729729
source_base/module_device/rocm/memory_op.hip.cu
730730
source_pw/module_pwdft/kernels/rocm/force_op.hip.cu
731731
source_pw/module_pwdft/kernels/rocm/stress_op.hip.cu
732-
source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu
732+
source_cell/kernels/rocm/wf_op.hip.cu
733733
source_pw/module_pwdft/kernels/rocm/vnl_op.hip.cu
734734
source_base/kernels/rocm/math_kernel_op.hip.cu
735735
source_base/kernels/rocm/math_kernel_op_vec.hip.cu
@@ -793,6 +793,7 @@ target_link_libraries(
793793
planewave
794794
symmetry
795795
cell
796+
structure_factor
796797
parameter
797798
psi_overall_init
798799
psi_init

‎source/Makefile.Objects‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ VPATH=./src_global:\
1919
./source_cell/module_neighlist:\
2020
./source_cell/module_symmetry:\
2121
./source_cell:\
22+
./source_cell/kernels:\
2223
./source_base:\
2324
./source_base/kernels:\
2425
./source_base/module_external:\

‎source/source_cell/CMakeLists.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ add_library(
4949
cal_wfc.cpp
5050
cal_ux.cpp
5151
cif_io.cpp
52+
soc.cpp
5253
ucell_io.cpp)
5354

55+
# Kept out of `cell` because it needs the plane-wave basis (planewave), which
56+
# the cell-only unit tests do not link.
57+
add_library(structure_factor OBJECT stru_fac.cpp stru_fac_k.cpp)
58+
5459
if(ENABLE_COVERAGE)
5560
add_coverage(cell)
61+
add_coverage(structure_factor)
5662
endif()
5763

5864
if(BUILD_TESTING)

source/source_pw/module_pwdft/kernels/cuda/wf_op.cu renamed to source/source_cell/kernels/cuda/wf_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "source_pw/module_pwdft/kernels/wf_op.h"
1+
#include "source_cell/kernels/wf_op.h"
22

33
#include <cstdint>
44

source/source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu renamed to source/source_cell/kernels/rocm/wf_op.hip.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "source_pw/module_pwdft/kernels/wf_op.h"
1+
#include "source_cell/kernels/wf_op.h"
22

33
#include <cstdint>
44

source/source_pw/module_pwdft/kernels/wf_op.cpp renamed to source/source_cell/kernels/wf_op.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "source_pw/module_pwdft/kernels/wf_op.h"
1+
#include "source_cell/kernels/wf_op.h"
22

33
#include <cstdint>
44
#include "source_base/libm/libm.h"

source/source_pw/module_pwdft/kernels/wf_op.h renamed to source/source_cell/kernels/wf_op.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define SRC_PW_WF_MULTI_DEVICE_H
33

44
#include "source_base/module_device/types.h"
5-
#include "source_psi/psi.h"
65
#include <complex>
76

87
namespace hamilt {
File renamed without changes.

0 commit comments

Comments
 (0)