From 31e2afb359072184f9d3208712bca288f009afdd Mon Sep 17 00:00:00 2001 From: Xiaoyang Zhang Date: Thu, 29 Oct 2026 16:40:27 +0800 Subject: [PATCH 1/3] 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 --- source/CMakeLists.txt | 7 +- source/Makefile.Objects | 1 + source/source_cell/CMakeLists.txt | 6 ++ .../kernels/cuda/wf_op.cu | 2 +- .../kernels/rocm/wf_op.hip.cu | 2 +- .../kernels/wf_op.cpp | 2 +- .../kernels/wf_op.h | 1 - .../module_pwdft => source_cell}/soc.cpp | 0 source/source_cell/soc.h | 86 ++++++++++++++++++ .../module_pwdft => source_cell}/stru_fac.cpp | 0 source/source_cell/stru_fac.h | 82 +++++++++++++++++ .../stru_fac_k.cpp | 3 +- .../source_estate/module_charge/chg_extra.h | 2 +- .../source_estate/module_pot/potential_new.h | 2 +- source/source_estate/setup_estate_pw.h | 2 +- .../source_estate/test/elecstate_pw_test.cpp | 2 +- .../module_surchem/cal_pseudo.cpp | 2 +- .../module_surchem/test/CMakeLists.txt | 2 +- .../module_surchem/test/setcell.h | 2 +- .../module_deepks/test/CMakeLists.txt | 2 +- .../source_lcao/module_rt/test/CMakeLists.txt | 2 +- source/source_psi/psi_base.cpp | 2 +- source/source_psi/psi_init_atomic.cpp | 4 +- source/source_psi/psi_init_nao.cpp | 2 +- source/source_psi/psi_prepare.cpp | 2 +- source/source_psi/setup_psi_pw.cpp | 2 +- source/source_psi/setup_psi_pw.h | 2 +- source/source_psi/test/CMakeLists.txt | 2 +- source/source_psi/test/psi_init_unit_test.cpp | 2 +- source/source_pw/module_pwdft/CMakeLists.txt | 3 - .../module_pwdft/kernels/test/wf_op_test.cpp | 2 +- source/source_pw/module_pwdft/soc.h | 88 ++----------------- source/source_pw/module_pwdft/stru_fac.h | 86 ++---------------- .../module_pwdft/test/CMakeLists.txt | 4 +- .../source_pw/module_pwdft/test/soc_test.cpp | 2 +- .../test/structure_factor_test.cpp | 2 +- 36 files changed, 218 insertions(+), 197 deletions(-) rename source/{source_pw/module_pwdft => source_cell}/kernels/cuda/wf_op.cu (99%) rename source/{source_pw/module_pwdft => source_cell}/kernels/rocm/wf_op.hip.cu (99%) rename source/{source_pw/module_pwdft => source_cell}/kernels/wf_op.cpp (98%) rename source/{source_pw/module_pwdft => source_cell}/kernels/wf_op.h (99%) rename source/{source_pw/module_pwdft => source_cell}/soc.cpp (100%) create mode 100644 source/source_cell/soc.h rename source/{source_pw/module_pwdft => source_cell}/stru_fac.cpp (100%) create mode 100644 source/source_cell/stru_fac.h rename source/{source_pw/module_pwdft => source_cell}/stru_fac_k.cpp (98%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index d849396a7d0..92d47f54e9b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -652,7 +652,7 @@ list( source_pw/module_pwdft/kernels/force_op.cpp source_pw/module_pwdft/kernels/stress_op.cpp source_pw/module_pwdft/kernels/onsite_op.cpp - source_pw/module_pwdft/kernels/wf_op.cpp + source_cell/kernels/wf_op.cpp source_pw/module_pwdft/kernels/vnl_op.cpp source_base/kernels/math_ylm_op.cpp source_hamilt/module_xc/kernels/xc_functional_op.cpp @@ -680,7 +680,7 @@ if(USE_CUDA) source_base/module_device/cuda/memory_op.cu source_pw/module_pwdft/kernels/cuda/force_op.cu source_pw/module_pwdft/kernels/cuda/stress_op.cu - source_pw/module_pwdft/kernels/cuda/wf_op.cu + source_cell/kernels/cuda/wf_op.cu source_pw/module_pwdft/kernels/cuda/vnl_op.cu source_base/module_device/cuda_compat.cpp source_base/kernels/cuda/math_ylm_op.cu @@ -719,7 +719,7 @@ if(USE_ROCM) source_base/module_device/rocm/memory_op.hip.cu source_pw/module_pwdft/kernels/rocm/force_op.hip.cu source_pw/module_pwdft/kernels/rocm/stress_op.hip.cu - source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu + source_cell/kernels/rocm/wf_op.hip.cu source_pw/module_pwdft/kernels/rocm/vnl_op.hip.cu source_base/kernels/rocm/math_kernel_op.hip.cu source_base/kernels/rocm/math_kernel_op_vec.hip.cu @@ -781,6 +781,7 @@ target_link_libraries( planewave symmetry cell + structure_factor parameter psi_overall_init psi_init diff --git a/source/Makefile.Objects b/source/Makefile.Objects index b2361a72e26..eebca350f46 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -19,6 +19,7 @@ VPATH=./src_global:\ ./source_cell/module_neighlist:\ ./source_cell/module_symmetry:\ ./source_cell:\ +./source_cell/kernels:\ ./source_base:\ ./source_base/kernels:\ ./source_base/module_external:\ diff --git a/source/source_cell/CMakeLists.txt b/source/source_cell/CMakeLists.txt index e35cb1025dc..3d83e0a783d 100644 --- a/source/source_cell/CMakeLists.txt +++ b/source/source_cell/CMakeLists.txt @@ -49,10 +49,16 @@ add_library( cal_wfc.cpp cal_ux.cpp cif_io.cpp + soc.cpp ucell_io.cpp) +# Kept out of `cell` because it needs the plane-wave basis (planewave), which +# the cell-only unit tests do not link. +add_library(structure_factor OBJECT stru_fac.cpp stru_fac_k.cpp) + if(ENABLE_COVERAGE) add_coverage(cell) + add_coverage(structure_factor) endif() if(BUILD_TESTING) diff --git a/source/source_pw/module_pwdft/kernels/cuda/wf_op.cu b/source/source_cell/kernels/cuda/wf_op.cu similarity index 99% rename from source/source_pw/module_pwdft/kernels/cuda/wf_op.cu rename to source/source_cell/kernels/cuda/wf_op.cu index 8b176340da7..1cf71563de9 100644 --- a/source/source_pw/module_pwdft/kernels/cuda/wf_op.cu +++ b/source/source_cell/kernels/cuda/wf_op.cu @@ -1,4 +1,4 @@ -#include "source_pw/module_pwdft/kernels/wf_op.h" +#include "source_cell/kernels/wf_op.h" #include diff --git a/source/source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu b/source/source_cell/kernels/rocm/wf_op.hip.cu similarity index 99% rename from source/source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu rename to source/source_cell/kernels/rocm/wf_op.hip.cu index c7bb7f9a056..d15338c4610 100644 --- a/source/source_pw/module_pwdft/kernels/rocm/wf_op.hip.cu +++ b/source/source_cell/kernels/rocm/wf_op.hip.cu @@ -1,4 +1,4 @@ -#include "source_pw/module_pwdft/kernels/wf_op.h" +#include "source_cell/kernels/wf_op.h" #include diff --git a/source/source_pw/module_pwdft/kernels/wf_op.cpp b/source/source_cell/kernels/wf_op.cpp similarity index 98% rename from source/source_pw/module_pwdft/kernels/wf_op.cpp rename to source/source_cell/kernels/wf_op.cpp index c942e484326..8670c6d6b72 100644 --- a/source/source_pw/module_pwdft/kernels/wf_op.cpp +++ b/source/source_cell/kernels/wf_op.cpp @@ -1,4 +1,4 @@ -#include "source_pw/module_pwdft/kernels/wf_op.h" +#include "source_cell/kernels/wf_op.h" #include #include "source_base/libm/libm.h" diff --git a/source/source_pw/module_pwdft/kernels/wf_op.h b/source/source_cell/kernels/wf_op.h similarity index 99% rename from source/source_pw/module_pwdft/kernels/wf_op.h rename to source/source_cell/kernels/wf_op.h index 98c9249cfb0..9c219d24ab9 100644 --- a/source/source_pw/module_pwdft/kernels/wf_op.h +++ b/source/source_cell/kernels/wf_op.h @@ -2,7 +2,6 @@ #define SRC_PW_WF_MULTI_DEVICE_H #include "source_base/module_device/types.h" -#include "source_psi/psi.h" #include namespace hamilt { diff --git a/source/source_pw/module_pwdft/soc.cpp b/source/source_cell/soc.cpp similarity index 100% rename from source/source_pw/module_pwdft/soc.cpp rename to source/source_cell/soc.cpp diff --git a/source/source_cell/soc.h b/source/source_cell/soc.h new file mode 100644 index 00000000000..40a3b2e41ac --- /dev/null +++ b/source/source_cell/soc.h @@ -0,0 +1,86 @@ +#ifndef SOC_H +#define SOC_H + +#include "source_base/global_function.h" + +#include +#include + +class Fcoef +{ + + public: + Fcoef(){}; + ~Fcoef(); + + int ind1 = 1; + int ind4 = 1; + int ind5 = 1; + + std::complex *p = nullptr; + + inline std::complex &operator()(const int &i1, const int &i2, const int &i3, const int &i4, const int &i5) + { + return p[ind2 * ind3 * ind4 * ind5 * i1 + ind3 * ind4 * ind5 * i2 + ind4 * ind5 * i3 + ind5 * i4 + i5]; + } + + inline const std::complex &operator()(const int &i1, + const int &i2, + const int &i3, + const int &i4, + const int &i5) const + { + return p[ind2 * ind3 * ind4 * ind5 * i1 + ind3 * ind4 * ind5 * i2 + ind4 * ind5 * i3 + ind5 * i4 + i5]; + } + + void create(const int i1, const int i2, const int i3); + + // void free(); + + private: + int ind2 = 2; + int ind3 = 2; +}; + +//----------------------- +// spin-orbital coupling +//----------------------- +class Soc +{ + + public: + Soc(){}; + ~Soc(); + + double spinor(const int l, const double j, const int m, const int spin) const; + + int sph_ind(const int l, const double j, const int m, const int spin) const; + + void rot_ylm(const int lmax); + // std::complex **rotylm; + + const std::complex &rotylm(const int &i1, const int &i2) const + { + return p_rot[l2plus1_ * i1 + i2]; + } + + Fcoef fcoef; + void set_fcoef(const int &l1, + const int &l2, + const int &is1, + const int &is2, + const int &m1, + const int &m2, + const double &j1, + const double &j2, + const int &it, + const int &ip1, + const int &ip2); + + // int npol; + private: + int l_max_ = -1; // maximum orbital index, must initialized before set_fcoef + int l2plus1_ = -1; + std::complex *p_rot = nullptr; +}; +#endif diff --git a/source/source_pw/module_pwdft/stru_fac.cpp b/source/source_cell/stru_fac.cpp similarity index 100% rename from source/source_pw/module_pwdft/stru_fac.cpp rename to source/source_cell/stru_fac.cpp diff --git a/source/source_cell/stru_fac.h b/source/source_cell/stru_fac.h new file mode 100644 index 00000000000..39fdf193f6a --- /dev/null +++ b/source/source_cell/stru_fac.h @@ -0,0 +1,82 @@ +#ifndef STRU_FAC_H +#define STRU_FAC_H + +#include "source_base/complexmatrix.h" +#include "source_basis/module_pw/pw_basis_k.h" +#include "source_cell/unitcell.h" +#include "source_base/parallel_grid.h" + +class Structure_Factor +{ + +public: + Structure_Factor(); + ~Structure_Factor(); + void set(const ModulePW::PW_Basis* rho_basis_in, const int& nbspline_in); + + //=============================================== + // Part 4: G vectors in reciprocal FFT box + //=============================================== + public: + int nbspline=0; + + // structure factor (ntype, ngmc) + ModuleBase::ComplexMatrix strucFac; + + /// @brief Calculate structure factors + /// @param has_float_data whether the Hamiltonian carries float data, which + /// decides if the single-precision eigts copies are built as well + void setup(const UnitCell* Ucell, + const Parallel_Grid& pgrid, + const ModulePW::PW_Basis* rho_basis, + const bool has_float_data); + + /// calculate structure factors through Cardinal B-spline interpolation + void bspline_sf( + const int, + const UnitCell* Ucell, + const Parallel_Grid& pgrid, + const ModulePW::PW_Basis* rho_basis); + + void bsplinecoef(std::complex *b1, std::complex *b2, std::complex *b3, + const int nx, const int ny, const int nz, const int norder); + + +public: + // phase of e^{-iG*tau_s} + ModuleBase::ComplexMatrix eigts1; // dimension: [Ucell->nat, 2*this->ncx + 1] + ModuleBase::ComplexMatrix eigts2; // dimension: [Ucell->nat, 2*this->ncy + 1] + ModuleBase::ComplexMatrix eigts3; // dimension: [Ucell->nat, 2*this->ncz + 1] + + template std::complex * get_eigts1_data() const; + template std::complex * get_eigts2_data() const; + template std::complex * get_eigts3_data() const; + + public: + // sf with k points + std::complex* get_sk(const int ik, const int it, const int ia, const ModulePW::PW_Basis_K* wfc_basis) const; + template + + void get_sk(Device* ctx, const int ik, const ModulePW::PW_Basis_K* wfc_basis, std::complex* sk) const; + + std::complex* get_skq(int ik, + int it, + int ia, + const ModulePW::PW_Basis_K* wfc_basis, + ModuleBase::Vector3 q) const; + + private: + + const UnitCell* ucell=nullptr; + std::complex * c_eigts1 = nullptr; + std::complex * c_eigts2 = nullptr; + std::complex * c_eigts3 = nullptr; + + std::complex * z_eigts1 = nullptr; + std::complex * z_eigts2 = nullptr; + std::complex * z_eigts3 = nullptr; + + const ModulePW::PW_Basis* rho_basis = nullptr; + std::string device = "cpu"; +}; +#endif // STRU_FAC_H diff --git a/source/source_pw/module_pwdft/stru_fac_k.cpp b/source/source_cell/stru_fac_k.cpp similarity index 98% rename from source/source_pw/module_pwdft/stru_fac_k.cpp rename to source/source_cell/stru_fac_k.cpp index 063d2d1ce36..d07d8b5a94f 100644 --- a/source/source_pw/module_pwdft/stru_fac_k.cpp +++ b/source/source_cell/stru_fac_k.cpp @@ -1,6 +1,7 @@ #include "source_base/module_device/device.h" +#include "source_base/module_device/memory_op.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/kernels/wf_op.h" +#include "source_cell/kernels/wf_op.h" #include "stru_fac.h" #include diff --git a/source/source_estate/module_charge/chg_extra.h b/source/source_estate/module_charge/chg_extra.h index 0efa5a13012..68b95a1ba06 100644 --- a/source/source_estate/module_charge/chg_extra.h +++ b/source/source_estate/module_charge/chg_extra.h @@ -5,8 +5,8 @@ #include "charge.h" #include "source_basis/module_pw/pw_basis.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" -#include "source_pw/module_pwdft/stru_fac.h" #ifdef __MPI #include "source_base/parallel_grid.h" #endif diff --git a/source/source_estate/module_pot/potential_new.h b/source/source_estate/module_pot/potential_new.h index fdfaa190f08..e459864f11c 100644 --- a/source/source_estate/module_pot/potential_new.h +++ b/source/source_estate/module_pot/potential_new.h @@ -3,8 +3,8 @@ #include "pot_base.h" #include "source_base/complexmatrix.h" +#include "source_cell/stru_fac.h" #include "source_hamilt/module_surchem/surchem.h" -#include "source_pw/module_pwdft/stru_fac.h" #include "source_pw/module_pwdft/vsep_pw.h" #include diff --git a/source/source_estate/setup_estate_pw.h b/source/source_estate/setup_estate_pw.h index bde637028a2..6e8fd7a7ce8 100644 --- a/source/source_estate/setup_estate_pw.h +++ b/source/source_estate/setup_estate_pw.h @@ -3,7 +3,7 @@ #include "source_cell/unitcell.h" #include "source_cell/klist.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_basis/module_pw/pw_basis_sup.h" #include "source_estate/elecstate.h" #include "source_pw/module_pwdft/vl_pw.h" diff --git a/source/source_estate/test/elecstate_pw_test.cpp b/source/source_estate/test/elecstate_pw_test.cpp index 1c47c8356b8..84dee22586c 100644 --- a/source/source_estate/test/elecstate_pw_test.cpp +++ b/source/source_estate/test/elecstate_pw_test.cpp @@ -8,7 +8,7 @@ #include "source_hamilt/module_xc/xc_functional.h" #include "source_pw/module_pwdft/vl_pw.h" #include "source_pw/module_pwdft/vnl_pw.h" -#include "source_pw/module_pwdft/soc.h" +#include "source_cell/soc.h" #include "source_io/module_parameter/parameter.h" /// @brief Friend helper to mutate PARAM private members in unit tests. diff --git a/source/source_hamilt/module_surchem/cal_pseudo.cpp b/source/source_hamilt/module_surchem/cal_pseudo.cpp index d1866c0e9a4..bd50dddc034 100644 --- a/source/source_hamilt/module_surchem/cal_pseudo.cpp +++ b/source/source_hamilt/module_surchem/cal_pseudo.cpp @@ -1,6 +1,6 @@ #include "surchem.h" -#include "source_pw/module_pwdft/stru_fac.h" // Structure_Factor member access (sf->strucFac) +#include "source_cell/stru_fac.h" // Structure_Factor member access (sf->strucFac) // atom_in surchem::GetAtom; diff --git a/source/source_hamilt/module_surchem/test/CMakeLists.txt b/source/source_hamilt/module_surchem/test/CMakeLists.txt index ddd30ce6d42..344b7da611d 100644 --- a/source/source_hamilt/module_surchem/test/CMakeLists.txt +++ b/source/source_hamilt/module_surchem/test/CMakeLists.txt @@ -15,7 +15,7 @@ AddTest( AddTest( TARGET MODULE_HAMILT_surchem_cal_pseudo LIBS parameter planewave device base psi - SOURCES cal_pseudo_test.cpp ../cal_pseudo.cpp ../surchem.cpp ../cal_epsilon.cpp ../../../source_pw/module_pwdft/stru_fac.cpp + SOURCES cal_pseudo_test.cpp ../cal_pseudo.cpp ../surchem.cpp ../cal_epsilon.cpp ../../../source_cell/stru_fac.cpp ) AddTest( diff --git a/source/source_hamilt/module_surchem/test/setcell.h b/source/source_hamilt/module_surchem/test/setcell.h index 9136552ae5d..6eaed1a2e39 100644 --- a/source/source_hamilt/module_surchem/test/setcell.h +++ b/source/source_hamilt/module_surchem/test/setcell.h @@ -8,7 +8,7 @@ #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_cell/unitcell.h" #include "source_base/parallel_grid.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" UnitCell::UnitCell(){}; UnitCell::~UnitCell(){}; diff --git a/source/source_lcao/module_deepks/test/CMakeLists.txt b/source/source_lcao/module_deepks/test/CMakeLists.txt index 0602f8ac755..859d7f14564 100644 --- a/source/source_lcao/module_deepks/test/CMakeLists.txt +++ b/source/source_lcao/module_deepks/test/CMakeLists.txt @@ -36,7 +36,7 @@ set(DEEPKS_UNIT_COMMON_SOURCES ../../../source_cell/read_pp_blps.cpp ../../../source_cell/sep.cpp ../../../source_cell/sep_cell.cpp - ../../../source_pw/module_pwdft/soc.cpp + ../../../source_cell/soc.cpp ../../../source_cell/read_pp_ucell.cpp ../../../source_estate/param_update.cpp ../../../source_cell/cal_wfc.cpp diff --git a/source/source_lcao/module_rt/test/CMakeLists.txt b/source/source_lcao/module_rt/test/CMakeLists.txt index e4a2c5e0efb..61fdf9edf6a 100644 --- a/source/source_lcao/module_rt/test/CMakeLists.txt +++ b/source/source_lcao/module_rt/test/CMakeLists.txt @@ -141,7 +141,7 @@ addtest( ../../../source_io/module_hs/pos_op_writer.cpp ../../../source_io/module_hs/lat_r_csr.cpp ../../../source_io/module_hs/pos_op_csr.cpp - ../../../source_pw/module_pwdft/soc.cpp + ../../../source_cell/soc.cpp ${SNAP_PSIBETA_CUDA_TEST_SOURCES}) addtest( diff --git a/source/source_psi/psi_base.cpp b/source/source_psi/psi_base.cpp index 045366c54d7..0dd81083197 100644 --- a/source/source_psi/psi_base.cpp +++ b/source/source_psi/psi_base.cpp @@ -2,8 +2,8 @@ #include "source_base/parallel_global.h" #include "source_basis/module_pw/pw_basis_k.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" -#include "source_pw/module_pwdft/stru_fac.h" #include #include diff --git a/source/source_psi/psi_init_atomic.cpp b/source/source_psi/psi_init_atomic.cpp index 020cb409d0d..564c5d7c2d2 100644 --- a/source/source_psi/psi_init_atomic.cpp +++ b/source/source_psi/psi_init_atomic.cpp @@ -8,10 +8,10 @@ #include "source_base/timer.h" #include "source_base/tool_quit.h" #include "source_basis/module_pw/pw_basis_k.h" +#include "source_cell/soc.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" #include "source_io/module_output/write_pao.h" -#include "source_pw/module_pwdft/soc.h" -#include "source_pw/module_pwdft/stru_fac.h" template void psi_init_atomic::allocate_ps_table() diff --git a/source/source_psi/psi_init_nao.cpp b/source/source_psi/psi_init_nao.cpp index 91705de86e2..2c1c2154293 100644 --- a/source/source_psi/psi_init_nao.cpp +++ b/source/source_psi/psi_init_nao.cpp @@ -1,8 +1,8 @@ #include "psi_init_nao.h" #include "source_basis/module_pw/pw_basis_k.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" -#include "source_pw/module_pwdft/stru_fac.h" #include // numerical algorithm support diff --git a/source/source_psi/psi_prepare.cpp b/source/source_psi/psi_prepare.cpp index 27d9f2bd4c7..d44a8c2049c 100644 --- a/source/source_psi/psi_prepare.cpp +++ b/source/source_psi/psi_prepare.cpp @@ -9,6 +9,7 @@ #include "source_base/timer.h" #include "source_base/tool_quit.h" #include "source_basis/module_pw/pw_basis_k.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" #include "source_hamilt/hamilt_hs_adapter.h" #include "source_hsolver/diag_comm_info.h" @@ -20,7 +21,6 @@ #include "source_psi/psi_init_nao.h" #include "source_psi/psi_init_nao_random.h" #include "source_psi/psi_init_random.h" -#include "source_pw/module_pwdft/stru_fac.h" namespace psi { diff --git a/source/source_psi/setup_psi_pw.cpp b/source/source_psi/setup_psi_pw.cpp index cb56267631a..820910408f7 100644 --- a/source/source_psi/setup_psi_pw.cpp +++ b/source/source_psi/setup_psi_pw.cpp @@ -2,9 +2,9 @@ #include "source_basis/module_pw/pw_basis_k.h" #include "source_cell/klist.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/stru_fac.h" Setup_Psi_pw::Setup_Psi_pw() { diff --git a/source/source_psi/setup_psi_pw.h b/source/source_psi/setup_psi_pw.h index 27ba4ad1f88..251480785f6 100644 --- a/source/source_psi/setup_psi_pw.h +++ b/source/source_psi/setup_psi_pw.h @@ -4,11 +4,11 @@ #include "source_base/module_device/device.h" #include "source_basis/module_pw/pw_basis_k.h" #include "source_cell/klist.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" #include "source_hamilt/hamilt.h" #include "source_io/module_parameter/input_parameter.h" #include "source_psi/psi_prepare.h" -#include "source_pw/module_pwdft/stru_fac.h" class Setup_Psi_pw { diff --git a/source/source_psi/test/CMakeLists.txt b/source/source_psi/test/CMakeLists.txt index 2177a5a072b..510a8c846bf 100644 --- a/source/source_psi/test/CMakeLists.txt +++ b/source/source_psi/test/CMakeLists.txt @@ -12,7 +12,7 @@ AddTest( LIBS parameter base device psi psi_init planewave SOURCES psi_init_unit_test.cpp - ../../source_pw/module_pwdft/soc.cpp + ../../source_cell/soc.cpp ../../source_cell/atom_spec.cpp ../../source_cell/test/support/mock_unitcell.cpp diff --git a/source/source_psi/test/psi_init_unit_test.cpp b/source/source_psi/test/psi_init_unit_test.cpp index 6b0de01d97a..8a97e1f7b02 100644 --- a/source/source_psi/test/psi_init_unit_test.cpp +++ b/source/source_psi/test/psi_init_unit_test.cpp @@ -10,8 +10,8 @@ #include "source_cell/atom_pseudo.h" #include "source_cell/magnetism.h" #include "source_cell/pseudo.h" +#include "source_cell/stru_fac.h" #include "source_cell/unitcell.h" -#include "source_pw/module_pwdft/stru_fac.h" #include "source_pw/module_pwdft/vl_pw.h" #include diff --git a/source/source_pw/module_pwdft/CMakeLists.txt b/source/source_pw/module_pwdft/CMakeLists.txt index 2b0af1ec744..2bce5128b55 100644 --- a/source/source_pw/module_pwdft/CMakeLists.txt +++ b/source/source_pw/module_pwdft/CMakeLists.txt @@ -74,9 +74,6 @@ list( vnl_pw_init_vnl.cpp vnl_pw_qrad.cpp vnl_pw_table.cpp - stru_fac.cpp - stru_fac_k.cpp - soc.cpp elecond.cpp fs_nonlocal_tools.cpp fs_nonlocal_tools_vkb.cpp diff --git a/source/source_pw/module_pwdft/kernels/test/wf_op_test.cpp b/source/source_pw/module_pwdft/kernels/test/wf_op_test.cpp index 1f7bca363ae..ec359585ecd 100644 --- a/source/source_pw/module_pwdft/kernels/test/wf_op_test.cpp +++ b/source/source_pw/module_pwdft/kernels/test/wf_op_test.cpp @@ -1,4 +1,4 @@ -#include "source_pw/module_pwdft/kernels/wf_op.h" +#include "source_cell/kernels/wf_op.h" #include "source_base/module_device/memory_op.h" diff --git a/source/source_pw/module_pwdft/soc.h b/source/source_pw/module_pwdft/soc.h index 40a3b2e41ac..85b0ea2330f 100644 --- a/source/source_pw/module_pwdft/soc.h +++ b/source/source_pw/module_pwdft/soc.h @@ -1,86 +1,8 @@ -#ifndef SOC_H -#define SOC_H +#ifndef SOURCE_PW_MODULE_PWDFT_SOC_H +#define SOURCE_PW_MODULE_PWDFT_SOC_H -#include "source_base/global_function.h" +// Soc moved to source_cell (#8233). New code should include +// source_cell/soc.h directly. +#include "source_cell/soc.h" -#include -#include - -class Fcoef -{ - - public: - Fcoef(){}; - ~Fcoef(); - - int ind1 = 1; - int ind4 = 1; - int ind5 = 1; - - std::complex *p = nullptr; - - inline std::complex &operator()(const int &i1, const int &i2, const int &i3, const int &i4, const int &i5) - { - return p[ind2 * ind3 * ind4 * ind5 * i1 + ind3 * ind4 * ind5 * i2 + ind4 * ind5 * i3 + ind5 * i4 + i5]; - } - - inline const std::complex &operator()(const int &i1, - const int &i2, - const int &i3, - const int &i4, - const int &i5) const - { - return p[ind2 * ind3 * ind4 * ind5 * i1 + ind3 * ind4 * ind5 * i2 + ind4 * ind5 * i3 + ind5 * i4 + i5]; - } - - void create(const int i1, const int i2, const int i3); - - // void free(); - - private: - int ind2 = 2; - int ind3 = 2; -}; - -//----------------------- -// spin-orbital coupling -//----------------------- -class Soc -{ - - public: - Soc(){}; - ~Soc(); - - double spinor(const int l, const double j, const int m, const int spin) const; - - int sph_ind(const int l, const double j, const int m, const int spin) const; - - void rot_ylm(const int lmax); - // std::complex **rotylm; - - const std::complex &rotylm(const int &i1, const int &i2) const - { - return p_rot[l2plus1_ * i1 + i2]; - } - - Fcoef fcoef; - void set_fcoef(const int &l1, - const int &l2, - const int &is1, - const int &is2, - const int &m1, - const int &m2, - const double &j1, - const double &j2, - const int &it, - const int &ip1, - const int &ip2); - - // int npol; - private: - int l_max_ = -1; // maximum orbital index, must initialized before set_fcoef - int l2plus1_ = -1; - std::complex *p_rot = nullptr; -}; #endif diff --git a/source/source_pw/module_pwdft/stru_fac.h b/source/source_pw/module_pwdft/stru_fac.h index 39fdf193f6a..da51b1d724d 100644 --- a/source/source_pw/module_pwdft/stru_fac.h +++ b/source/source_pw/module_pwdft/stru_fac.h @@ -1,82 +1,8 @@ -#ifndef STRU_FAC_H -#define STRU_FAC_H +#ifndef SOURCE_PW_MODULE_PWDFT_STRU_FAC_H +#define SOURCE_PW_MODULE_PWDFT_STRU_FAC_H -#include "source_base/complexmatrix.h" -#include "source_basis/module_pw/pw_basis_k.h" -#include "source_cell/unitcell.h" -#include "source_base/parallel_grid.h" +// Structure_Factor moved to source_cell (#8233). New code should include +// source_cell/stru_fac.h directly. +#include "source_cell/stru_fac.h" -class Structure_Factor -{ - -public: - Structure_Factor(); - ~Structure_Factor(); - void set(const ModulePW::PW_Basis* rho_basis_in, const int& nbspline_in); - - //=============================================== - // Part 4: G vectors in reciprocal FFT box - //=============================================== - public: - int nbspline=0; - - // structure factor (ntype, ngmc) - ModuleBase::ComplexMatrix strucFac; - - /// @brief Calculate structure factors - /// @param has_float_data whether the Hamiltonian carries float data, which - /// decides if the single-precision eigts copies are built as well - void setup(const UnitCell* Ucell, - const Parallel_Grid& pgrid, - const ModulePW::PW_Basis* rho_basis, - const bool has_float_data); - - /// calculate structure factors through Cardinal B-spline interpolation - void bspline_sf( - const int, - const UnitCell* Ucell, - const Parallel_Grid& pgrid, - const ModulePW::PW_Basis* rho_basis); - - void bsplinecoef(std::complex *b1, std::complex *b2, std::complex *b3, - const int nx, const int ny, const int nz, const int norder); - - -public: - // phase of e^{-iG*tau_s} - ModuleBase::ComplexMatrix eigts1; // dimension: [Ucell->nat, 2*this->ncx + 1] - ModuleBase::ComplexMatrix eigts2; // dimension: [Ucell->nat, 2*this->ncy + 1] - ModuleBase::ComplexMatrix eigts3; // dimension: [Ucell->nat, 2*this->ncz + 1] - - template std::complex * get_eigts1_data() const; - template std::complex * get_eigts2_data() const; - template std::complex * get_eigts3_data() const; - - public: - // sf with k points - std::complex* get_sk(const int ik, const int it, const int ia, const ModulePW::PW_Basis_K* wfc_basis) const; - template - - void get_sk(Device* ctx, const int ik, const ModulePW::PW_Basis_K* wfc_basis, std::complex* sk) const; - - std::complex* get_skq(int ik, - int it, - int ia, - const ModulePW::PW_Basis_K* wfc_basis, - ModuleBase::Vector3 q) const; - - private: - - const UnitCell* ucell=nullptr; - std::complex * c_eigts1 = nullptr; - std::complex * c_eigts2 = nullptr; - std::complex * c_eigts3 = nullptr; - - std::complex * z_eigts1 = nullptr; - std::complex * z_eigts2 = nullptr; - std::complex * z_eigts3 = nullptr; - - const ModulePW::PW_Basis* rho_basis = nullptr; - std::string device = "cpu"; -}; -#endif // STRU_FAC_H +#endif diff --git a/source/source_pw/module_pwdft/test/CMakeLists.txt b/source/source_pw/module_pwdft/test/CMakeLists.txt index 91e0ce07bcc..43424a97159 100644 --- a/source/source_pw/module_pwdft/test/CMakeLists.txt +++ b/source/source_pw/module_pwdft/test/CMakeLists.txt @@ -10,7 +10,7 @@ addtest( parameter SOURCES soc_test.cpp - ../soc.cpp + ../../../source_cell/soc.cpp ../../../source_base/global_variable.cpp ../../../source_base/global_function.cpp ../../../source_base/global_file.cpp @@ -84,7 +84,7 @@ addtest( planewave SOURCES structure_factor_test.cpp - ../stru_fac.cpp + ../../../source_cell/stru_fac.cpp ../../../source_cell/unitcell.cpp ../../../source_cell/unitcell_index.cpp ../../../source_cell/unitcell_stats.cpp diff --git a/source/source_pw/module_pwdft/test/soc_test.cpp b/source/source_pw/module_pwdft/test/soc_test.cpp index e870b744654..a1b09b45097 100644 --- a/source/source_pw/module_pwdft/test/soc_test.cpp +++ b/source/source_pw/module_pwdft/test/soc_test.cpp @@ -24,7 +24,7 @@ void EXPECT_COMPLEX_DOUBLE_EQ(const std::complex& a,const std::complex Date: Thu, 29 Oct 2026 17:34:18 +0800 Subject: [PATCH 2/3] 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 --- source/source_estate/elecstate_pw_sdft.cpp | 1 - source/source_estate/module_dm/edm_tddft.cpp | 2 -- source/source_relax/ions_move_lbfgs.h | 1 - 3 files changed, 4 deletions(-) diff --git a/source/source_estate/elecstate_pw_sdft.cpp b/source/source_estate/elecstate_pw_sdft.cpp index f4061f733a5..4f21c9c310e 100644 --- a/source/source_estate/elecstate_pw_sdft.cpp +++ b/source/source_estate/elecstate_pw_sdft.cpp @@ -3,7 +3,6 @@ #include "source_base/global_function.h" #include "source_base/global_variable.h" #include "source_base/timer.h" -#include "source_hamilt/module_xc/xc_functional.h" #include "source_io/module_parameter/parameter.h" namespace elecstate { diff --git a/source/source_estate/module_dm/edm_tddft.cpp b/source/source_estate/module_dm/edm_tddft.cpp index 765017de3a3..ae7179c7e26 100644 --- a/source/source_estate/module_dm/edm_tddft.cpp +++ b/source/source_estate/module_dm/edm_tddft.cpp @@ -7,8 +7,6 @@ #include "source_base/module_device/memory_op.h" // memory operations #include "source_base/module_external/lapack_connector.h" #include "source_base/module_external/scalapack_connector.h" -#include "source_lcao/module_rt/gather_mat.h" // gatherMatrix and distributeMatrix -#include "source_lcao/module_rt/propagator.h" // Include header for create_identity_matrix namespace module_dm { diff --git a/source/source_relax/ions_move_lbfgs.h b/source/source_relax/ions_move_lbfgs.h index edf7a585f6a..f3f5634f7c1 100644 --- a/source/source_relax/ions_move_lbfgs.h +++ b/source/source_relax/ions_move_lbfgs.h @@ -13,7 +13,6 @@ #include "source_base/matrix3.h" #include "source_cell/unitcell.h" #include "source_esolver/esolver.h" -#include "source_esolver/esolver_ks.h" /** * @class Ions_Move_LBFGS From 92289fe11f22e8f7f4c72d126b35259dd3fe48bd Mon Sep 17 00:00:00 2001 From: Critsium Date: Thu, 29 Oct 2026 22:05:16 +0800 Subject: [PATCH 3/3] 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 --- source/source_esolver/esolver_fp.h | 2 +- source/source_io/module_bessel/numerical_basis.h | 2 +- source/source_io/module_ctrl/ctrl_scf_lcao.h | 2 +- source/source_io/module_energy/write_eband_terms.cpp | 2 +- source/source_lcao/force_stress_lcao.h | 2 +- source/source_lcao/lcao_set.h | 2 +- source/source_lcao/setup_nonlocal.cpp | 2 +- source/source_pw/module_dfpt/dfpt_pert.cpp | 2 +- source/source_pw/module_dfpt/dfpt_pw.cpp | 2 +- source/source_pw/module_dfpt/test/dfpt_test_mocks.cpp | 2 +- .../module_dfpt/test_serial/dfpt_pert_serial_test.cpp | 2 +- .../module_dfpt/test_serial/dfpt_phon_serial_test.cpp | 2 +- .../module_dfpt/test_serial/dfpt_q0_serial_test.cpp | 2 +- source/source_pw/module_proj/onsite_proj.h | 2 +- source/source_pw/module_pwdft/force_pw.h | 2 +- source/source_pw/module_pwdft/setup_pot.h | 2 +- source/source_pw/module_pwdft/soc.h | 8 -------- source/source_pw/module_pwdft/stress_func.h | 2 +- source/source_pw/module_pwdft/stru_fac.h | 8 -------- source/source_pw/module_pwdft/vnl_pw.h | 4 ++-- source/source_pw/module_stodft/sto_stress_pw.cpp | 2 +- 21 files changed, 20 insertions(+), 36 deletions(-) delete mode 100644 source/source_pw/module_pwdft/soc.h delete mode 100644 source/source_pw/module_pwdft/stru_fac.h diff --git a/source/source_esolver/esolver_fp.h b/source/source_esolver/esolver_fp.h index 8d409b9d83b..39612979a9a 100644 --- a/source/source_esolver/esolver_fp.h +++ b/source/source_esolver/esolver_fp.h @@ -8,7 +8,7 @@ #include "source_estate/module_charge/chg_extra.h" // charge extrapolation #include "source_hamilt/module_surchem/surchem.h" // solvation model #include "source_base/parallel_grid.h" // Parallel_Grid (value member below) -#include "source_pw/module_pwdft/stru_fac.h" // structure factor +#include "source_cell/stru_fac.h" // structure factor #include "source_pw/module_pwdft/vl_pw.h" // local pseudopotential #include diff --git a/source/source_io/module_bessel/numerical_basis.h b/source/source_io/module_bessel/numerical_basis.h index 62e6cb07b1b..f7a13c7e531 100644 --- a/source/source_io/module_bessel/numerical_basis.h +++ b/source/source_io/module_bessel/numerical_basis.h @@ -16,7 +16,7 @@ #include "../../source_base/vector3.h" #include "../../source_basis/module_pw/pw_basis_k.h" #include "../../source_cell/klist.h" -#include "../../source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "../../source_psi/psi.h" //========================================================== // CLASS : diff --git a/source/source_io/module_ctrl/ctrl_scf_lcao.h b/source/source_io/module_ctrl/ctrl_scf_lcao.h index 013a25901da..29bc527ba5a 100644 --- a/source/source_io/module_ctrl/ctrl_scf_lcao.h +++ b/source/source_io/module_ctrl/ctrl_scf_lcao.h @@ -14,7 +14,7 @@ #include "source_lcao/setup_deepks.h" // for deepks, mohan add 20251008 #include "source_lcao/setup_exx.h" // for exx, mohan add 20251008 #include "source_psi/psi.h" // use Psi -#include "source_pw/module_pwdft/stru_fac.h" // use Structure_Factor +#include "source_cell/stru_fac.h" // use Structure_Factor #include #include diff --git a/source/source_io/module_energy/write_eband_terms.cpp b/source/source_io/module_energy/write_eband_terms.cpp index b7474b68023..b67094449cc 100644 --- a/source/source_io/module_energy/write_eband_terms.cpp +++ b/source/source_io/module_energy/write_eband_terms.cpp @@ -14,7 +14,7 @@ #include "source_basis/module_nao/two_center_bundle.h" #include "source_basis/module_ao/parallel_orbitals.h" #include "source_estate/module_charge/charge.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_hamilt/module_surchem/surchem.h" #include "source_basis/module_pw/pw_basis.h" diff --git a/source/source_lcao/force_stress_lcao.h b/source/source_lcao/force_stress_lcao.h index 827dfc3db7a..251fd24268b 100644 --- a/source/source_lcao/force_stress_lcao.h +++ b/source/source_lcao/force_stress_lcao.h @@ -10,7 +10,7 @@ #include "source_base/matrix.h" #include "source_pw/module_pwdft/force_pw.h" #include "source_pw/module_pwdft/stress_func.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_io/module_parameter/input_conv.h" #include "source_psi/psi.h" #ifdef __EXX diff --git a/source/source_lcao/lcao_set.h b/source/source_lcao/lcao_set.h index 114246be22a..8707156f1d1 100644 --- a/source/source_lcao/lcao_set.h +++ b/source/source_lcao/lcao_set.h @@ -8,7 +8,7 @@ #include "source_estate/module_dm/density_matrix.h" #include "source_hamilt/hamilt.h" #include "source_lcao/allocate_dm.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_basis/module_pw/pw_basis.h" #include "source_hamilt/module_surchem/surchem.h" #include "source_pw/module_pwdft/vl_pw.h" diff --git a/source/source_lcao/setup_nonlocal.cpp b/source/source_lcao/setup_nonlocal.cpp index 936c16516cf..2c8bd59d73d 100644 --- a/source/source_lcao/setup_nonlocal.cpp +++ b/source/source_lcao/setup_nonlocal.cpp @@ -3,7 +3,7 @@ #include "source_base/parallel_common.h" #ifdef __LCAO -#include "source_pw/module_pwdft/soc.h" +#include "source_cell/soc.h" #include "../source_base/complexmatrix.h" // mohan add 2013-08-02 // In order to get rid of the read in file .NONLOCAL. diff --git a/source/source_pw/module_dfpt/dfpt_pert.cpp b/source/source_pw/module_dfpt/dfpt_pert.cpp index c2dc7640892..159252d4cd7 100644 --- a/source/source_pw/module_dfpt/dfpt_pert.cpp +++ b/source/source_pw/module_dfpt/dfpt_pert.cpp @@ -11,7 +11,7 @@ #include "source_base/truncated_func.h" #include "source_cell/atom_pseudo.h" #include "source_cell/atom_spec.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include #include diff --git a/source/source_pw/module_dfpt/dfpt_pw.cpp b/source/source_pw/module_dfpt/dfpt_pw.cpp index de3b7a955a4..c256808bec9 100644 --- a/source/source_pw/module_dfpt/dfpt_pw.cpp +++ b/source/source_pw/module_dfpt/dfpt_pw.cpp @@ -15,7 +15,7 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_cell/qlist.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include #include diff --git a/source/source_pw/module_dfpt/test/dfpt_test_mocks.cpp b/source/source_pw/module_dfpt/test/dfpt_test_mocks.cpp index e4b45c89d1d..83757fc9ed1 100644 --- a/source/source_pw/module_dfpt/test/dfpt_test_mocks.cpp +++ b/source/source_pw/module_dfpt/test/dfpt_test_mocks.cpp @@ -21,7 +21,7 @@ #include "source_cell/unitcell.h" #include "source_estate/module_charge/chg_mix.h" #include "source_pw/module_pwdft/dftu_base.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" pseudo::pseudo() { diff --git a/source/source_pw/module_dfpt/test_serial/dfpt_pert_serial_test.cpp b/source/source_pw/module_dfpt/test_serial/dfpt_pert_serial_test.cpp index 06a2f76b145..a50fa7e9613 100644 --- a/source/source_pw/module_dfpt/test_serial/dfpt_pert_serial_test.cpp +++ b/source/source_pw/module_dfpt/test_serial/dfpt_pert_serial_test.cpp @@ -21,7 +21,7 @@ #include "source_cell/unitcell.h" #include "source_psi/psi.h" #include "source_pw/module_dfpt/dfpt_pert.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_pw/module_pwdft/dftu_base.h" // ctor/dtor stubs for the cell/spepot/stru_fac link closures live in the diff --git a/source/source_pw/module_dfpt/test_serial/dfpt_phon_serial_test.cpp b/source/source_pw/module_dfpt/test_serial/dfpt_phon_serial_test.cpp index 085de1a93da..aadaa8e91e0 100644 --- a/source/source_pw/module_dfpt/test_serial/dfpt_phon_serial_test.cpp +++ b/source/source_pw/module_dfpt/test_serial/dfpt_phon_serial_test.cpp @@ -23,7 +23,7 @@ #include "source_pw/module_dfpt/dfpt_kq_basis.h" #include "source_pw/module_dfpt/dfpt_pert.h" #include "source_pw/module_dfpt/dfpt_phon.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" // ctor/dtor stubs for the cell/spepot/stru_fac link closures live in the // shared test/dfpt_test_mocks.cpp compiled into every DFPT test binary. diff --git a/source/source_pw/module_dfpt/test_serial/dfpt_q0_serial_test.cpp b/source/source_pw/module_dfpt/test_serial/dfpt_q0_serial_test.cpp index a02dd2a66c1..1c52a86e558 100644 --- a/source/source_pw/module_dfpt/test_serial/dfpt_q0_serial_test.cpp +++ b/source/source_pw/module_dfpt/test_serial/dfpt_q0_serial_test.cpp @@ -22,7 +22,7 @@ #include "source_psi/psi.h" #include "source_pw/module_dfpt/dfpt_pert.h" #include "source_pw/module_dfpt/dfpt_q0.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" // ctor/dtor stubs for the cell/spepot/stru_fac link closures live in the // shared test/dfpt_test_mocks.cpp compiled into every DFPT test binary. diff --git a/source/source_pw/module_proj/onsite_proj.h b/source/source_pw/module_proj/onsite_proj.h index fcfe8553b14..63791c9fded 100644 --- a/source/source_pw/module_proj/onsite_proj.h +++ b/source/source_pw/module_proj/onsite_proj.h @@ -2,7 +2,7 @@ #define MODULEHAMILTPW_ONSITEPROJECTOR_H #include "source_base/module_device/device.h" #include "source_base/kernels/math_kernel_op.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_basis/module_pw/pw_basis_k.h" #include "source_psi/psi.h" #include "source_pw/module_proj/onsite_proj_tools.h" diff --git a/source/source_pw/module_pwdft/force_pw.h b/source/source_pw/module_pwdft/force_pw.h index 0cc4b56cdeb..f06138e8fd8 100644 --- a/source/source_pw/module_pwdft/force_pw.h +++ b/source/source_pw/module_pwdft/force_pw.h @@ -11,7 +11,7 @@ #include "source_pw/module_pwdft/vl_pw.h" #include "source_base/kernels/math_kernel_op.h" #include "source_psi/psi.h" -#include "stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_pw/module_pwdft/dftu_base.h" class pseudopot_cell_vnl; diff --git a/source/source_pw/module_pwdft/setup_pot.h b/source/source_pw/module_pwdft/setup_pot.h index 6842159e261..139f74dbea7 100644 --- a/source/source_pw/module_pwdft/setup_pot.h +++ b/source/source_pw/module_pwdft/setup_pot.h @@ -3,7 +3,7 @@ #include "source_cell/unitcell.h" #include "source_cell/klist.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_estate/elecstate.h" #include "source_pw/module_pwdft/vl_pw.h" #include "source_hamilt/hamilt.h" diff --git a/source/source_pw/module_pwdft/soc.h b/source/source_pw/module_pwdft/soc.h deleted file mode 100644 index 85b0ea2330f..00000000000 --- a/source/source_pw/module_pwdft/soc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SOURCE_PW_MODULE_PWDFT_SOC_H -#define SOURCE_PW_MODULE_PWDFT_SOC_H - -// Soc moved to source_cell (#8233). New code should include -// source_cell/soc.h directly. -#include "source_cell/soc.h" - -#endif diff --git a/source/source_pw/module_pwdft/stress_func.h b/source/source_pw/module_pwdft/stress_func.h index 4eb758999b8..4e786c67cac 100644 --- a/source/source_pw/module_pwdft/stress_func.h +++ b/source/source_pw/module_pwdft/stress_func.h @@ -11,7 +11,7 @@ #include "source_estate/module_charge/charge.h" #include "source_pw/module_pwdft/vnl_pw.h" #include "source_pw/module_pwdft/kernels/stress_op.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_base/kernels/math_kernel_op.h" #include "source_psi/psi.h" #include "source_pw/module_pwdft/dftu_base.h" diff --git a/source/source_pw/module_pwdft/stru_fac.h b/source/source_pw/module_pwdft/stru_fac.h deleted file mode 100644 index da51b1d724d..00000000000 --- a/source/source_pw/module_pwdft/stru_fac.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SOURCE_PW_MODULE_PWDFT_STRU_FAC_H -#define SOURCE_PW_MODULE_PWDFT_STRU_FAC_H - -// Structure_Factor moved to source_cell (#8233). New code should include -// source_cell/stru_fac.h directly. -#include "source_cell/stru_fac.h" - -#endif diff --git a/source/source_pw/module_pwdft/vnl_pw.h b/source/source_pw/module_pwdft/vnl_pw.h index 8761d7cc2fa..a9d2695af8d 100644 --- a/source/source_pw/module_pwdft/vnl_pw.h +++ b/source/source_pw/module_pwdft/vnl_pw.h @@ -7,8 +7,8 @@ #include "source_base/realarray.h" #include "source_cell/unitcell.h" #include "source_psi/psi.h" -#include "source_pw/module_pwdft/soc.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/soc.h" +#include "source_cell/stru_fac.h" #include #ifdef __LCAO diff --git a/source/source_pw/module_stodft/sto_stress_pw.cpp b/source/source_pw/module_stodft/sto_stress_pw.cpp index 68a42d67006..1bb5fd6ecb6 100644 --- a/source/source_pw/module_stodft/sto_stress_pw.cpp +++ b/source/source_pw/module_stodft/sto_stress_pw.cpp @@ -4,7 +4,7 @@ #include "source_base/timer.h" #include "source_pw/module_pwdft/fs_kin_tools.h" #include "source_pw/module_pwdft/fs_nonlocal_tools.h" -#include "source_pw/module_pwdft/stru_fac.h" +#include "source_cell/stru_fac.h" #include "source_io/module_output/output_log.h" #include "source_io/module_parameter/parameter.h"