diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 6d310cf9753..d7e5116df8a 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -715,7 +715,6 @@ OBJS_SRCPW=H_Ewald_pw.o\ onsite_op.o\ wf_op.o\ vnl_op.o\ - global.o\ magnetism.o\ occupy.o\ structure_factor.o\ diff --git a/source/source_base/module_fft/fft_cuda.cpp b/source/source_base/module_fft/fft_cuda.cpp index bd5669f8228..e33fd203118 100644 --- a/source/source_base/module_fft/fft_cuda.cpp +++ b/source/source_base/module_fft/fft_cuda.cpp @@ -1,7 +1,6 @@ #include "fft_cuda.h" - #include "source_base/module_device/memory_op.h" -#include "source_pw/module_pwdft/global.h" +#include "source_base/module_device/device_check.h" namespace ModuleBase { @@ -111,4 +110,4 @@ template FFT_CUDA::FFT_CUDA(); template FFT_CUDA::~FFT_CUDA(); template FFT_CUDA::FFT_CUDA(); template FFT_CUDA::~FFT_CUDA(); -} // namespace ModuleBase \ No newline at end of file +} // namespace ModuleBase diff --git a/source/source_base/module_fft/fft_rocm.cpp b/source/source_base/module_fft/fft_rocm.cpp index 89413e2d645..1730a0cdda5 100644 --- a/source/source_base/module_fft/fft_rocm.cpp +++ b/source/source_base/module_fft/fft_rocm.cpp @@ -1,6 +1,7 @@ #include "fft_rocm.h" #include "source_base/module_device/memory_op.h" -#include "source_pw/module_pwdft/global.h" +#include "source_base/module_device/device_check.h" + namespace ModuleBase { template @@ -107,4 +108,4 @@ template FFT_ROCM::FFT_ROCM(); template FFT_ROCM::~FFT_ROCM(); template FFT_ROCM::FFT_ROCM(); template FFT_ROCM::~FFT_ROCM(); -}// namespace ModuleBase \ No newline at end of file +}// namespace ModuleBase diff --git a/source/source_cell/bcast_cell.cpp b/source/source_cell/bcast_cell.cpp index 2f9b88955af..8f2dcd3300e 100644 --- a/source/source_cell/bcast_cell.cpp +++ b/source/source_cell/bcast_cell.cpp @@ -3,8 +3,9 @@ #include "source_io/module_parameter/parameter.h" #ifdef __EXX #include "source_lcao/module_ri/serialization_cereal.h" -#include "source_pw/module_pwdft/global.h" #endif +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info + namespace unitcell { void bcast_atoms_tau(Atom* atoms, diff --git a/source/source_cell/klist.cpp b/source/source_cell/klist.cpp index cc358802253..b9ee8c4ebae 100644 --- a/source/source_cell/klist.cpp +++ b/source/source_cell/klist.cpp @@ -7,7 +7,6 @@ #include "source_base/parallel_global.h" #include "source_base/parallel_reduce.h" #include "source_cell/module_symmetry/symmetry.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/berryphase.h" #include "source_io/module_parameter/parameter.h" diff --git a/source/source_cell/read_atom_species.cpp b/source/source_cell/read_atom_species.cpp index b8cf4c57449..cd3bdfa124b 100644 --- a/source/source_cell/read_atom_species.cpp +++ b/source/source_cell/read_atom_species.cpp @@ -3,9 +3,10 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/tool_title.h" #ifdef __EXX -#include "source_pw/module_pwdft/global.h" #include "source_lcao/module_ri/serialization_cereal.h" #endif +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info + namespace unitcell { bool read_atom_species(std::ifstream& ifa, diff --git a/source/source_cell/read_atoms.cpp b/source/source_cell/read_atoms.cpp index cdce715ce74..9e680a731c5 100644 --- a/source/source_cell/read_atoms.cpp +++ b/source/source_cell/read_atoms.cpp @@ -10,7 +10,6 @@ #include "source_estate/read_orb.h" #include "source_base/timer.h" #include "source_base/constants.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/formatter.h" #include "source_base/mathzone.h" diff --git a/source/source_cell/setup_nonlocal.cpp b/source/source_cell/setup_nonlocal.cpp index ba3f915315f..74911595b6b 100644 --- a/source/source_cell/setup_nonlocal.cpp +++ b/source/source_cell/setup_nonlocal.cpp @@ -4,7 +4,6 @@ #include "source_io/module_parameter/parameter.h" #ifdef __LCAO -//#include "../source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/soc.h" // mohan add 2013-08-02 // In order to get rid of the read in file .NONLOCAL. diff --git a/source/source_esolver/esolver_ks_lcaopw.cpp b/source/source_esolver/esolver_ks_lcaopw.cpp index 7a6d78e3397..97823e7c1b2 100644 --- a/source/source_esolver/esolver_ks_lcaopw.cpp +++ b/source/source_esolver/esolver_ks_lcaopw.cpp @@ -10,7 +10,6 @@ #include "source_estate/module_charge/symmetry_rho.h" #include "source_estate/occupy.h" #include "source_hamilt/module_ewald/H_Ewald_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/print_info.h" //-----force------------------- #include "source_pw/module_pwdft/forces.h" diff --git a/source/source_esolver/esolver_ks_pw.cpp b/source/source_esolver/esolver_ks_pw.cpp index 61ee2e10bca..b98fe6490e9 100644 --- a/source/source_esolver/esolver_ks_pw.cpp +++ b/source/source_esolver/esolver_ks_pw.cpp @@ -28,6 +28,8 @@ #include "source_estate/module_charge/chgmixing.h" // use charge mixing, mohan add 20251006 #include "source_estate/update_pot.h" // mohan add 20251016 +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info + namespace ModuleESolver { diff --git a/source/source_esolver/esolver_ks_pw.h b/source/source_esolver/esolver_ks_pw.h index 27eee6c564c..b6f48e18cdf 100644 --- a/source/source_esolver/esolver_ks_pw.h +++ b/source/source_esolver/esolver_ks_pw.h @@ -3,7 +3,6 @@ #include "./esolver_ks.h" #include "source_psi/setup_psi_pw.h" // mohan add 20251012 #include "source_pw/module_pwdft/VSep_in_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/module_exx_helper/exx_helper.h" #include "source_pw/module_pwdft/operator_pw/velocity_pw.h" diff --git a/source/source_esolver/esolver_of.cpp b/source/source_esolver/esolver_of.cpp index b17cf6fb9df..ca8ff72ef5c 100644 --- a/source/source_esolver/esolver_of.cpp +++ b/source/source_esolver/esolver_of.cpp @@ -8,13 +8,13 @@ #include "source_base/global_function.h" #include "source_estate/module_charge/symmetry_rho.h" #include "source_hamilt/module_ewald/H_Ewald_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/print_info.h" #include "source_estate/cal_ux.h" #include "source_pw/module_pwdft/forces.h" #include "source_pw/module_ofdft/of_stress_pw.h" -// mohan add #include "source_pw/module_ofdft/of_print_info.h" +#include "source_hamilt/module_xc/xc_functional.h" + namespace ModuleESolver { diff --git a/source/source_esolver/esolver_of_interface.cpp b/source/source_esolver/esolver_of_interface.cpp index 7051308a00e..d428b795069 100644 --- a/source/source_esolver/esolver_of_interface.cpp +++ b/source/source_esolver/esolver_of_interface.cpp @@ -1,5 +1,4 @@ #include "esolver_of.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" namespace ModuleESolver diff --git a/source/source_esolver/esolver_of_tddft.cpp b/source/source_esolver/esolver_of_tddft.cpp index 12a398a2f74..3f7ce036a66 100644 --- a/source/source_esolver/esolver_of_tddft.cpp +++ b/source/source_esolver/esolver_of_tddft.cpp @@ -8,7 +8,6 @@ #include "source_base/global_function.h" #include "source_estate/module_charge/symmetry_rho.h" #include "source_hamilt/module_ewald/H_Ewald_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/print_info.h" #include "source_estate/cal_ux.h" //-----force------------------- diff --git a/source/source_esolver/esolver_of_tool.cpp b/source/source_esolver/esolver_of_tool.cpp index 39de034d75a..b54f4de53af 100644 --- a/source/source_esolver/esolver_of_tool.cpp +++ b/source/source_esolver/esolver_of_tool.cpp @@ -3,7 +3,6 @@ #include "source_base/memory.h" #include "source_estate/module_pot/efield.h" #include "source_estate/module_pot/gatefield.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_estate/cal_ux.h" diff --git a/source/source_esolver/lcao_others.cpp b/source/source_esolver/lcao_others.cpp index 337b8feacda..df4805d2de1 100644 --- a/source/source_esolver/lcao_others.cpp +++ b/source/source_esolver/lcao_others.cpp @@ -3,8 +3,6 @@ #include "source_estate/module_charge/symmetry_rho.h" #include "source_lcao/hamilt_lcao.h" #include "source_lcao/module_dftu/dftu.h" -#include "source_pw/module_pwdft/global.h" -// #include "source_base/formatter.h" #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_atom_arrange.h" diff --git a/source/source_estate/elecstate_exx.cpp b/source/source_estate/elecstate_exx.cpp index b8854de319a..addc7a03da0 100644 --- a/source/source_estate/elecstate_exx.cpp +++ b/source/source_estate/elecstate_exx.cpp @@ -1,4 +1,5 @@ -#include "source_pw/module_pwdft/global.h" +#include "source_estate/elecstate.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info namespace elecstate { @@ -16,4 +17,4 @@ void ElecState::set_exx(const double& Eexx) return; } -} \ No newline at end of file +} diff --git a/source/source_estate/elecstate_lcao.cpp b/source/source_estate/elecstate_lcao.cpp index 7bd32542aed..ffe81901e73 100644 --- a/source/source_estate/elecstate_lcao.cpp +++ b/source/source_estate/elecstate_lcao.cpp @@ -4,7 +4,6 @@ #include "source_estate/module_dm/cal_dm_psi.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_lcao/module_deltaspin/spin_constrain.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_lcao/module_gint/gint_interface.h" diff --git a/source/source_estate/module_charge/charge_init.cpp b/source/source_estate/module_charge/charge_init.cpp index 95f675eb90b..3e86b42fffa 100644 --- a/source/source_estate/module_charge/charge_init.cpp +++ b/source/source_estate/module_charge/charge_init.cpp @@ -12,11 +12,13 @@ #include "source_base/timer.h" #include "source_base/tool_threading.h" #include "source_estate/magnetism.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/parallel_grid.h" #include "source_io/cube_io.h" #include "source_io/rhog_io.h" #include "source_io/read_wf2rho_pw.h" +#include "source_io/restart.h" +#include "source_hamilt/module_xc/xc_functional.h" +#include "source_cell/klist.h" void Charge::init_rho(const UnitCell& ucell, const Parallel_Grid& pgrid, diff --git a/source/source_estate/module_charge/charge_mixing.cpp b/source/source_estate/module_charge/charge_mixing.cpp index 67e887a3447..320edc37efe 100644 --- a/source/source_estate/module_charge/charge_mixing.cpp +++ b/source/source_estate/module_charge/charge_mixing.cpp @@ -4,7 +4,7 @@ #include "source_base/module_mixing/broyden_mixing.h" #include "source_base/module_mixing/pulay_mixing.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" +#include "source_hamilt/module_xc/xc_functional.h" Charge_Mixing::Charge_Mixing() { diff --git a/source/source_estate/module_charge/charge_mixing_preconditioner.cpp b/source/source_estate/module_charge/charge_mixing_preconditioner.cpp index 333cfb59e49..a2fecdb91cd 100644 --- a/source/source_estate/module_charge/charge_mixing_preconditioner.cpp +++ b/source/source_estate/module_charge/charge_mixing_preconditioner.cpp @@ -2,7 +2,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" void Charge_Mixing::Kerker_screen_recip(std::complex* drhog) { diff --git a/source/source_estate/module_charge/charge_mixing_residual.cpp b/source/source_estate/module_charge/charge_mixing_residual.cpp index bbc7c7b6bee..9120ff4b35f 100644 --- a/source/source_estate/module_charge/charge_mixing_residual.cpp +++ b/source/source_estate/module_charge/charge_mixing_residual.cpp @@ -1,9 +1,8 @@ #include "charge_mixing.h" - #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/parallel_reduce.h" +#include "source_hamilt/module_xc/xc_functional.h" double Charge_Mixing::get_drho(Charge* chr, const double nelec) { diff --git a/source/source_estate/module_charge/charge_mixing_rho.cpp b/source/source_estate/module_charge/charge_mixing_rho.cpp index 38cd679f949..3eb3e91d1a4 100644 --- a/source/source_estate/module_charge/charge_mixing_rho.cpp +++ b/source/source_estate/module_charge/charge_mixing_rho.cpp @@ -1,7 +1,7 @@ #include "charge_mixing.h" #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" +#include "source_hamilt/module_xc/xc_functional.h" void Charge_Mixing::mix_rho_recip(Charge* chr) { diff --git a/source/source_estate/module_charge/symmetry_rhog.cpp b/source/source_estate/module_charge/symmetry_rhog.cpp index aae2103b75b..b16ac8476cf 100644 --- a/source/source_estate/module_charge/symmetry_rhog.cpp +++ b/source/source_estate/module_charge/symmetry_rhog.cpp @@ -1,5 +1,4 @@ #include "symmetry_rho.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/parallel_global.h" #include "source_hamilt/module_xc/xc_functional.h" @@ -234,4 +233,4 @@ void Symmetry_rho::get_ixyz2ipw(const ModulePW::PW_Basis *rho_basis, delete[] nstnz_start; delete[] ipsz2ipw; return; -} \ No newline at end of file +} diff --git a/source/source_estate/module_pot/H_TDDFT_pw.cpp b/source/source_estate/module_pot/H_TDDFT_pw.cpp index 3f6c8a7fcd7..92a652cbb5c 100644 --- a/source/source_estate/module_pot/H_TDDFT_pw.cpp +++ b/source/source_estate/module_pot/H_TDDFT_pw.cpp @@ -6,7 +6,6 @@ #include "source_io/input_conv.h" #include "source_io/module_parameter/parameter.h" #include "source_lcao/module_rt/evolve_elec.h" -#include "source_pw/module_pwdft/global.h" namespace elecstate { @@ -489,4 +488,4 @@ void H_TDDFT_pw::compute_force(const UnitCell& cell, ModuleBase::matrix& fe) } } -} // namespace elecstate \ No newline at end of file +} // namespace elecstate diff --git a/source/source_estate/module_pot/pot_ml_exx.cpp b/source/source_estate/module_pot/pot_ml_exx.cpp index dab2acf6188..4d1237276d3 100644 --- a/source/source_estate/module_pot/pot_ml_exx.cpp +++ b/source/source_estate/module_pot/pot_ml_exx.cpp @@ -5,7 +5,6 @@ #include "npy.hpp" #include "source_base/parallel_reduce.h" #include "source_base/global_function.h" -#include "source_pw/module_pwdft/global.h" namespace elecstate { diff --git a/source/source_estate/module_pot/pot_xc.cpp b/source/source_estate/module_pot/pot_xc.cpp index 09c4719a5c4..5bfccb118d9 100644 --- a/source/source_estate/module_pot/pot_xc.cpp +++ b/source/source_estate/module_pot/pot_xc.cpp @@ -1,7 +1,6 @@ #include "pot_xc.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #ifdef USE_LIBXC #include "source_hamilt/module_xc/xc_functional_libxc.h" diff --git a/source/source_hamilt/module_ewald/H_Ewald_pw.cpp b/source/source_hamilt/module_ewald/H_Ewald_pw.cpp index 20e6762cc0a..0a96c2058cc 100644 --- a/source/source_hamilt/module_ewald/H_Ewald_pw.cpp +++ b/source/source_hamilt/module_ewald/H_Ewald_pw.cpp @@ -6,7 +6,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/constants.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" double H_Ewald_pw::alpha=0.0; int H_Ewald_pw::mxr = 200; diff --git a/source/source_hamilt/module_surchem/cal_pseudo.cpp b/source/source_hamilt/module_surchem/cal_pseudo.cpp index 9c3a8be429f..e58024d4414 100644 --- a/source/source_hamilt/module_surchem/cal_pseudo.cpp +++ b/source/source_hamilt/module_surchem/cal_pseudo.cpp @@ -1,4 +1,3 @@ -#include "source_pw/module_pwdft/global.h" #include "surchem.h" // atom_in surchem::GetAtom; diff --git a/source/source_hamilt/module_xc/xc_functional.cpp b/source/source_hamilt/module_xc/xc_functional.cpp index 5b669d2a7d4..5cb8394b729 100644 --- a/source/source_hamilt/module_xc/xc_functional.cpp +++ b/source/source_hamilt/module_xc/xc_functional.cpp @@ -1,5 +1,4 @@ #include "xc_functional.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_base/global_function.h" diff --git a/source/source_hamilt/module_xc/xc_functional_libxc.cpp b/source/source_hamilt/module_xc/xc_functional_libxc.cpp index 1eb15e7a270..3b1595a3a50 100644 --- a/source/source_hamilt/module_xc/xc_functional_libxc.cpp +++ b/source/source_hamilt/module_xc/xc_functional_libxc.cpp @@ -6,7 +6,7 @@ #include "source_base/formatter.h" #ifdef __EXX -#include "source_pw/module_pwdft/global.h" // just for GlobalC::exx_info +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info #endif #include @@ -293,4 +293,4 @@ void XC_Functional_Libxc::finish_func(std::vector &funcs) } } -#endif \ No newline at end of file +#endif diff --git a/source/source_hamilt/module_xc/xc_functional_libxc_wrapper_tauxc.cpp b/source/source_hamilt/module_xc/xc_functional_libxc_wrapper_tauxc.cpp index 8891fc98f6d..a7499ef0906 100644 --- a/source/source_hamilt/module_xc/xc_functional_libxc_wrapper_tauxc.cpp +++ b/source/source_hamilt/module_xc/xc_functional_libxc_wrapper_tauxc.cpp @@ -4,8 +4,9 @@ #ifdef USE_LIBXC +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info +#include "source_hamilt/module_xc/xc_functional.h" #include "xc_functional_libxc.h" -#include "source_pw/module_pwdft/global.h" #include //tau_xc and tau_xc_spin: interface for calling xc_mgga_exc_vxc from LIBXC @@ -102,4 +103,4 @@ void XC_Functional_Libxc::tau_xc_spin( XC_Functional_Libxc::finish_func(funcs); } -#endif \ No newline at end of file +#endif diff --git a/source/source_hamilt/module_xc/xc_functional_wrapper_gcxc.cpp b/source/source_hamilt/module_xc/xc_functional_wrapper_gcxc.cpp index 7b46ce96a1e..ea6a5a3e1e3 100644 --- a/source/source_hamilt/module_xc/xc_functional_wrapper_gcxc.cpp +++ b/source/source_hamilt/module_xc/xc_functional_wrapper_gcxc.cpp @@ -8,7 +8,6 @@ #include "xc_functional.h" #include -#include "source_pw/module_pwdft/global.h" #include "source_base/global_function.h" #ifdef USE_LIBXC diff --git a/source/source_hsolver/diago_lapack.cpp b/source/source_hsolver/diago_lapack.cpp index 4888a1159ac..996115fa697 100644 --- a/source/source_hsolver/diago_lapack.cpp +++ b/source/source_hsolver/diago_lapack.cpp @@ -7,8 +7,8 @@ #include "source_base/global_variable.h" #include "source_base/module_external/lapack_connector.h" #include "source_base/timer.h" +#include #include "source_base/tool_quit.h" -#include "source_pw/module_pwdft/global.h" typedef hamilt::MatrixBlock matd; typedef hamilt::MatrixBlock> matcd; @@ -410,4 +410,4 @@ void DiagoLapack::post_processing(const int info, const std::vector& vec throw std::runtime_error(str_info_FILE); } } -} // namespace hsolver \ No newline at end of file +} // namespace hsolver diff --git a/source/source_hsolver/hsolver_lcaopw.cpp b/source/source_hsolver/hsolver_lcaopw.cpp index 10c80c4481a..2167330705d 100644 --- a/source/source_hsolver/hsolver_lcaopw.cpp +++ b/source/source_hsolver/hsolver_lcaopw.cpp @@ -5,7 +5,6 @@ #include "source_base/timer.h" #include "source_base/tool_quit.h" #include "source_estate/elecstate_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/hamilt_pw.h" #include "source_hsolver/diago_iter_assist.h" #include "source_io/module_parameter/parameter.h" diff --git a/source/source_io/berryphase.cpp b/source/source_io/berryphase.cpp index c98913b35d1..08067e2c8aa 100644 --- a/source/source_io/berryphase.cpp +++ b/source/source_io/berryphase.cpp @@ -4,7 +4,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_cell/klist.h" -#include "source_pw/module_pwdft/global.h" bool berryphase::berry_phase_flag = false; diff --git a/source/source_io/bessel_basis.cpp b/source/source_io/bessel_basis.cpp index 8c98d3aca0f..5768f411e08 100644 --- a/source/source_io/bessel_basis.cpp +++ b/source/source_io/bessel_basis.cpp @@ -5,7 +5,6 @@ #include "source_base/math_sphbes.h" #include "source_base/parallel_common.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include Bessel_Basis::Bessel_Basis() diff --git a/source/source_io/cal_mlkedf_descriptors.cpp b/source/source_io/cal_mlkedf_descriptors.cpp index eb16730a0e3..7e88cddfdec 100644 --- a/source/source_io/cal_mlkedf_descriptors.cpp +++ b/source/source_io/cal_mlkedf_descriptors.cpp @@ -517,4 +517,4 @@ void Cal_MLKEDF_Descriptors::getNablaRho(const double * const *prho, const Modul delete[] recipNablaRho; } -} \ No newline at end of file +} diff --git a/source/source_io/cal_mlkedf_descriptors.h b/source/source_io/cal_mlkedf_descriptors.h index d110d5bd9b9..9c28763da5a 100644 --- a/source/source_io/cal_mlkedf_descriptors.h +++ b/source/source_io/cal_mlkedf_descriptors.h @@ -3,8 +3,11 @@ #include #include "source_base/global_function.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" +#include "source_basis/module_pw/pw_basis.h" +#include "source_cell/unitcell.h" +#include "source_psi/psi.h" +#include "source_estate/elecstate_pw.h" namespace ModuleIO { @@ -106,4 +109,4 @@ class Cal_MLKEDF_Descriptors } // namespace ModuleIO -#endif \ No newline at end of file +#endif diff --git a/source/source_io/cal_pdos_gamma.cpp b/source/source_io/cal_pdos_gamma.cpp index c51519207e6..1b8faa2eef3 100644 --- a/source/source_io/cal_pdos_gamma.cpp +++ b/source/source_io/cal_pdos_gamma.cpp @@ -1,14 +1,14 @@ #include "cal_pdos_gamma.h" - +#include "source_io/module_parameter/parameter.h" // use PARAM #include "source_base/parallel_reduce.h" #include "source_base/module_external/blas_connector.h" #include "source_base/module_external/scalapack_connector.h" #include "write_orb_info.h" #include "source_base/global_function.h" #include "source_base/global_variable.h" -#include "source_pw/module_pwdft/global.h" #include "source_lcao/hamilt_lcao.h" + void ModuleIO::cal_pdos( const psi::Psi* psi, hamilt::Hamilt* p_ham, diff --git a/source/source_io/cal_pdos_multik.cpp b/source/source_io/cal_pdos_multik.cpp index d16b517f3fa..3bdae54db59 100644 --- a/source/source_io/cal_pdos_multik.cpp +++ b/source/source_io/cal_pdos_multik.cpp @@ -1,12 +1,11 @@ #include "cal_pdos_multik.h" - +#include "source_io/module_parameter/parameter.h" // use PARAM #include "source_base/parallel_reduce.h" #include "source_base/module_external/blas_connector.h" #include "source_base/module_external/scalapack_connector.h" #include "write_orb_info.h" #include "source_base/global_function.h" #include "source_base/global_variable.h" -#include "source_pw/module_pwdft/global.h" #include "source_lcao/hamilt_lcao.h" void ModuleIO::cal_pdos( diff --git a/source/source_io/cal_r_overlap_R.cpp b/source/source_io/cal_r_overlap_R.cpp index f7512699e07..8ea658c3db9 100644 --- a/source/source_io/cal_r_overlap_R.cpp +++ b/source/source_io/cal_r_overlap_R.cpp @@ -4,7 +4,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/mathzone_add1.h" cal_r_overlap_R::cal_r_overlap_R() diff --git a/source/source_io/cal_test.cpp b/source/source_io/cal_test.cpp index 3009d5852db..d162bb7137b 100644 --- a/source/source_io/cal_test.cpp +++ b/source/source_io/cal_test.cpp @@ -1,4 +1,3 @@ -#include "source_pw/module_pwdft/global.h" #include "source_base/global_function.h" #define private public #include "source_io/module_parameter/parameter.h" diff --git a/source/source_io/ctrl_iter_lcao.cpp b/source/source_io/ctrl_iter_lcao.cpp index c772d162e6e..ef7b2d42d67 100644 --- a/source/source_io/ctrl_iter_lcao.cpp +++ b/source/source_io/ctrl_iter_lcao.cpp @@ -1,5 +1,4 @@ #include "source_io/ctrl_iter_lcao.h" // use ctrl_iter_lcao() -#include "source_pw/module_pwdft/global.h" // use GlobalC::restart #ifdef __MLALGO #include "source_lcao/module_deepks/LCAO_deepks.h" diff --git a/source/source_io/ctrl_iter_lcao.h b/source/source_io/ctrl_iter_lcao.h index 6297d4f1d03..04ca83c7227 100644 --- a/source/source_io/ctrl_iter_lcao.h +++ b/source/source_io/ctrl_iter_lcao.h @@ -10,6 +10,7 @@ #include "source_lcao/hamilt_lcao.h" // use hamilt::HamiltLCAO #include "source_lcao/setup_exx.h" // mohan add 20251008 #include "source_lcao/setup_deepks.h" // mohan add 20251010 +#include "source_io/restart.h" namespace ModuleIO { diff --git a/source/source_io/input_conv.cpp b/source/source_io/input_conv.cpp index 8e3fb560ca3..d174cefeae9 100644 --- a/source/source_io/input_conv.cpp +++ b/source/source_io/input_conv.cpp @@ -6,7 +6,6 @@ #include "source_cell/unitcell.h" #include "source_estate/occupy.h" #include "source_hamilt/module_surchem/surchem.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/berryphase.h" #include "source_io/module_parameter/parameter.h" #include "source_relax/ions_move_basic.h" @@ -14,6 +13,7 @@ #include +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info #ifdef __EXX #include "source_lcao/module_ri/exx_abfs-jle.h" #endif @@ -45,6 +45,10 @@ #include "source_lcao/module_dftu/dftu.h" // mohan add 20251107 +#include "source_io/restart.h" +#include "source_relax/bfgs_basic.h" +#include "source_relax/ions_move_cg.h" + #ifdef __LCAO std::vector Input_Conv::convert_units(std::string params, double c) { std::vector params_ori; diff --git a/source/source_io/numerical_basis.cpp b/source/source_io/numerical_basis.cpp index aab51006f9a..b8833348927 100644 --- a/source/source_io/numerical_basis.cpp +++ b/source/source_io/numerical_basis.cpp @@ -9,7 +9,6 @@ #include "source_base/timer.h" #include "source_base/vector3.h" #include "source_cell/module_symmetry/symmetry.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/numerical_basis_jyjy.h" #include diff --git a/source/source_io/numerical_descriptor.cpp b/source/source_io/numerical_descriptor.cpp index 5ccf46cb6e3..6a3004416be 100644 --- a/source/source_io/numerical_descriptor.cpp +++ b/source/source_io/numerical_descriptor.cpp @@ -1,5 +1,4 @@ #include "numerical_descriptor.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_cell/module_symmetry/symmetry.h" #include "source_base/math_ylmreal.h" diff --git a/source/source_io/read_wf2rho_pw.cpp b/source/source_io/read_wf2rho_pw.cpp index 1be65a268ca..37d732956ca 100644 --- a/source/source_io/read_wf2rho_pw.cpp +++ b/source/source_io/read_wf2rho_pw.cpp @@ -2,7 +2,6 @@ #include "read_wfc_pw.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_estate/module_charge/symmetry_rho.h" #include "source_io/module_parameter/parameter.h" #include "source_estate/kernels/elecstate_op.h" diff --git a/source/source_io/restart.cpp b/source/source_io/restart.cpp index 1841f3bb376..c960215a2a6 100644 --- a/source/source_io/restart.cpp +++ b/source/source_io/restart.cpp @@ -42,6 +42,11 @@ bool Restart::write_file2(const std::string& file_name, const void* const ptr, c return true; } +namespace GlobalC +{ +Restart restart; // Peize Lin add 2020.04.04 +} // namespace GlobalC + bool Restart::read_file2(const std::string& file_name, void* const ptr, const size_t size, const bool error_quit) const { const int file = open(file_name.c_str(), O_RDONLY); diff --git a/source/source_io/restart.h b/source/source_io/restart.h index d3cf0cf2df2..8908c9d8022 100644 --- a/source/source_io/restart.h +++ b/source/source_io/restart.h @@ -55,4 +55,9 @@ class Restart bool read_file2(const std::string& file_name, void* const ptr, const size_t size, const bool error_quit = true) const; }; +namespace GlobalC +{ +extern Restart restart; // Peize Lin add 2020.04.04 +} // namespace GlobalC + #endif diff --git a/source/source_io/td_current_io.cpp b/source/source_io/td_current_io.cpp index bce3a96809a..75166e368e8 100644 --- a/source/source_io/td_current_io.cpp +++ b/source/source_io/td_current_io.cpp @@ -11,7 +11,6 @@ #include "source_estate/module_pot/H_TDDFT_pw.h" #include "source_lcao/LCAO_domain.h" #include "source_lcao/module_rt/td_info.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #ifdef __LCAO diff --git a/source/source_io/to_wannier90.cpp b/source/source_io/to_wannier90.cpp index 47241c0789f..a3b814ed82b 100644 --- a/source/source_io/to_wannier90.cpp +++ b/source/source_io/to_wannier90.cpp @@ -5,7 +5,6 @@ #include "source_base/math_polyint.h" #include "source_base/math_sphbes.h" #include "source_base/math_ylmreal.h" -#include "source_pw/module_pwdft/global.h" toWannier90::toWannier90() { @@ -514,4 +513,4 @@ bool toWannier90::try_read_nnkp(const UnitCell& ucell, const K_Vectors& kv) } return true; -} \ No newline at end of file +} diff --git a/source/source_io/to_wannier90_lcao.cpp b/source/source_io/to_wannier90_lcao.cpp index 911a42100e5..8c1b8288d94 100644 --- a/source/source_io/to_wannier90_lcao.cpp +++ b/source/source_io/to_wannier90_lcao.cpp @@ -9,7 +9,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/module_external/scalapack_connector.h" #include "source_lcao/module_hcontainer/atom_pair.h" -#include "source_pw/module_pwdft/global.h" #include #include diff --git a/source/source_io/to_wannier90_lcao.h b/source/source_io/to_wannier90_lcao.h index fa75293d9b5..e41a7755f76 100644 --- a/source/source_io/to_wannier90_lcao.h +++ b/source/source_io/to_wannier90_lcao.h @@ -22,7 +22,6 @@ #include "source_lcao/center2_orb-orb21.h" #include "source_lcao/center2_orb.h" #include "source_lcao/wavefunc_in_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_psi/psi.h" #include "single_R_io.h" #include "to_wannier90.h" diff --git a/source/source_io/to_wannier90_lcao_in_pw.cpp b/source/source_io/to_wannier90_lcao_in_pw.cpp index 1f0019241cc..0f241a2bac5 100644 --- a/source/source_io/to_wannier90_lcao_in_pw.cpp +++ b/source/source_io/to_wannier90_lcao_in_pw.cpp @@ -1,7 +1,6 @@ #include "to_wannier90_lcao_in_pw.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/math_integral.h" #include "source_base/math_polyint.h" #include "source_base/math_sphbes.h" diff --git a/source/source_io/to_wannier90_lcao_in_pw.h b/source/source_io/to_wannier90_lcao_in_pw.h index cf6d5fc9151..3b75e6c736b 100644 --- a/source/source_io/to_wannier90_lcao_in_pw.h +++ b/source/source_io/to_wannier90_lcao_in_pw.h @@ -16,7 +16,6 @@ #include "source_basis/module_ao/ORB_read.h" #include "source_cell/klist.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_psi/psi.h" #include "single_R_io.h" #include "to_wannier90.h" diff --git a/source/source_io/to_wannier90_pw.cpp b/source/source_io/to_wannier90_pw.cpp index 9c33cf49761..555e3be32d5 100644 --- a/source/source_io/to_wannier90_pw.cpp +++ b/source/source_io/to_wannier90_pw.cpp @@ -1,7 +1,7 @@ #include "to_wannier90_pw.h" +#include "source_base/parallel_comm.h" // use POOL_WORLD #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/math_integral.h" #include "source_base/math_polyint.h" #include "source_base/math_sphbes.h" diff --git a/source/source_io/unk_overlap_lcao.cpp b/source/source_io/unk_overlap_lcao.cpp index c4badd40ada..eaab367041e 100644 --- a/source/source_io/unk_overlap_lcao.cpp +++ b/source/source_io/unk_overlap_lcao.cpp @@ -1,10 +1,9 @@ #include "unk_overlap_lcao.h" - +#include "source_base/parallel_comm.h" // use POOL_WORLD, etc. #include "source_io/module_parameter/parameter.h" #include "ctime" #include "source_base/module_external/scalapack_connector.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" unkOverlap_lcao::unkOverlap_lcao() { diff --git a/source/source_io/unk_overlap_pw.cpp b/source/source_io/unk_overlap_pw.cpp index 0c87b1f6fb8..fab92428378 100644 --- a/source/source_io/unk_overlap_pw.cpp +++ b/source/source_io/unk_overlap_pw.cpp @@ -1,6 +1,5 @@ #include "unk_overlap_pw.h" - -#include "source_pw/module_pwdft/global.h" +#include "source_base/parallel_comm.h" // use POOL_WORLD, etc. #include "source_io/module_parameter/parameter.h" unkOverlap_pw::unkOverlap_pw() diff --git a/source/source_io/write_HS.h b/source/source_io/write_HS.h index dae3f8ef11f..43cd65b6d85 100644 --- a/source/source_io/write_HS.h +++ b/source/source_io/write_HS.h @@ -7,6 +7,7 @@ //#include "source_base/global_function.h" //#include "source_base/global_variable.h" #include "source_basis/module_ao/parallel_orbitals.h" // use Parallel_Orbitals +#include "source_hamilt/hamilt.h" // mohan add this file 2010-09-10 diff --git a/source/source_io/write_HS.hpp b/source/source_io/write_HS.hpp index 111e8d11b3e..e7ed39728dc 100644 --- a/source/source_io/write_HS.hpp +++ b/source/source_io/write_HS.hpp @@ -4,7 +4,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/filename.h" // use filename_output function diff --git a/source/source_io/write_HS_R.h b/source/source_io/write_HS_R.h index 87da54a2931..fcd2dd11720 100644 --- a/source/source_io/write_HS_R.h +++ b/source/source_io/write_HS_R.h @@ -6,9 +6,13 @@ #include "source_cell/klist.h" #include "source_hamilt/hamilt.h" #include "source_lcao/LCAO_HS_arrays.hpp" -#include "source_pw/module_pwdft/global.h" #include "source_lcao/module_dftu/dftu.h" // mohan add 20251107 +#ifdef __EXX +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info +#include "RI/global/Tensor.h" // for RI::Tensor +#endif + namespace ModuleIO { using TAC = std::pair>; diff --git a/source/source_io/write_HS_sparse.cpp b/source/source_io/write_HS_sparse.cpp index 8abd808cbad..382ece5a03b 100644 --- a/source/source_io/write_HS_sparse.cpp +++ b/source/source_io/write_HS_sparse.cpp @@ -4,7 +4,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_lcao/module_rt/td_info.h" -#include "source_pw/module_pwdft/global.h" #include "single_R_io.h" void ModuleIO::save_HSR_sparse(const int& istep, diff --git a/source/source_io/write_dipole.cpp b/source/source_io/write_dipole.cpp index 2b9ee8124a5..29d26e518d3 100644 --- a/source/source_io/write_dipole.cpp +++ b/source/source_io/write_dipole.cpp @@ -2,7 +2,6 @@ #include "source_estate/module_charge/charge.h" #include "source_io/dipole_io.h" #include "source_lcao/module_rt/evolve_elec.h" -#include "source_pw/module_pwdft/global.h" // fuxiang add 2017-03-15 void ModuleIO::write_dipole(const UnitCell& ucell, diff --git a/source/source_io/write_dmr.cpp b/source/source_io/write_dmr.cpp index ed1288cfa7f..0cb040b1d3e 100644 --- a/source/source_io/write_dmr.cpp +++ b/source/source_io/write_dmr.cpp @@ -3,7 +3,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_lcao/module_hcontainer/output_hcontainer.h" -#include "source_pw/module_pwdft/global.h" #include diff --git a/source/source_io/write_elecstat_pot.cpp b/source/source_io/write_elecstat_pot.cpp index e70ba045255..0fff6825683 100644 --- a/source/source_io/write_elecstat_pot.cpp +++ b/source/source_io/write_elecstat_pot.cpp @@ -3,7 +3,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_estate/module_pot/H_Hartree_pw.h" #include "source_estate/module_pot/efield.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/cube_io.h" #include "source_io/output_log.h" #include "write_elecstat_pot.h" diff --git a/source/source_io/write_elf.cpp b/source/source_io/write_elf.cpp index e3c72596fac..6c34a087734 100644 --- a/source/source_io/write_elf.cpp +++ b/source/source_io/write_elf.cpp @@ -1,6 +1,5 @@ #include "write_elf.h" #include "source_io/cube_io.h" -#include "source_pw/module_pwdft/global.h" namespace ModuleIO { diff --git a/source/source_lcao/FORCE_STRESS.cpp b/source/source_lcao/FORCE_STRESS.cpp index 4a1a0e035a0..9b129793df2 100644 --- a/source/source_lcao/FORCE_STRESS.cpp +++ b/source/source_lcao/FORCE_STRESS.cpp @@ -1,7 +1,6 @@ #include "FORCE_STRESS.h" #include "source_lcao/module_dftu/dftu.h" //Quxin add for DFT+U on 20201029 -#include "source_pw/module_pwdft/global.h" #include "source_io/output_log.h" #include "source_io/module_parameter/parameter.h" // new diff --git a/source/source_lcao/FORCE_gamma.cpp b/source/source_lcao/FORCE_gamma.cpp index 4f7bcb89abf..eabfde14368 100644 --- a/source/source_lcao/FORCE_gamma.cpp +++ b/source/source_lcao/FORCE_gamma.cpp @@ -3,7 +3,6 @@ #include "source_base/parallel_reduce.h" #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #ifdef __MLALGO #include "source_lcao/module_deepks/LCAO_deepks.h" //caoyu add for deepks on 20210813 diff --git a/source/source_lcao/FORCE_k.cpp b/source/source_lcao/FORCE_k.cpp index 276aab33602..78d8ffc6ac5 100644 --- a/source/source_lcao/FORCE_k.cpp +++ b/source/source_lcao/FORCE_k.cpp @@ -10,7 +10,6 @@ #include "source_estate/module_dm/cal_dm_psi.h" #include "source_lcao/LCAO_domain.h" #include "source_lcao/pulay_fs.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/write_HS.h" #include "source_io/module_parameter/parameter.h" diff --git a/source/source_lcao/LCAO_allocate.cpp b/source/source_lcao/LCAO_allocate.cpp index 0143727c7e0..adbe45c3c3e 100644 --- a/source/source_lcao/LCAO_allocate.cpp +++ b/source/source_lcao/LCAO_allocate.cpp @@ -1,7 +1,6 @@ #include "source_base/timer.h" #include "source_lcao/LCAO_domain.h" #include "source_lcao/module_deepks/LCAO_deepks.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" namespace LCAO_domain diff --git a/source/source_lcao/LCAO_init_basis.cpp b/source/source_lcao/LCAO_init_basis.cpp index 6d198a3a32f..c18e859599a 100644 --- a/source/source_lcao/LCAO_init_basis.cpp +++ b/source/source_lcao/LCAO_init_basis.cpp @@ -2,11 +2,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/parallel_comm.h" -/// once the GlobalC::exx_info has been deleted, this include can be gone -/// mohan note 2024-07-21 -#ifdef __EXX -#include "source_pw/module_pwdft/global.h" -#endif namespace LCAO_domain { diff --git a/source/source_lcao/hamilt_lcao.cpp b/source/source_lcao/hamilt_lcao.cpp index fc1ce9e92b2..d474db3eba8 100644 --- a/source/source_lcao/hamilt_lcao.cpp +++ b/source/source_lcao/hamilt_lcao.cpp @@ -4,7 +4,6 @@ #include "source_base/memory.h" #include "source_base/timer.h" #include "source_lcao/module_dftu/dftu.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include diff --git a/source/source_lcao/module_deepks/LCAO_deepks.cpp b/source/source_lcao/module_deepks/LCAO_deepks.cpp index f51f7ffa388..2cbc04680ce 100644 --- a/source/source_lcao/module_deepks/LCAO_deepks.cpp +++ b/source/source_lcao/module_deepks/LCAO_deepks.cpp @@ -14,7 +14,6 @@ #include "LCAO_deepks.h" #include "deepks_iterate.h" -#include "source_pw/module_pwdft/global.h" // Constructor of the class template diff --git a/source/source_lcao/module_dftu/dftu.cpp b/source/source_lcao/module_dftu/dftu.cpp index 8c990379fd4..92686ce4e33 100644 --- a/source/source_lcao/module_dftu/dftu.cpp +++ b/source/source_lcao/module_dftu/dftu.cpp @@ -8,7 +8,6 @@ #include "source_base/timer.h" #include "source_estate/magnetism.h" #include "source_estate/module_charge/charge.h" -#include "source_pw/module_pwdft/global.h" #include #include diff --git a/source/source_lcao/module_dftu/dftu_folding.cpp b/source/source_lcao/module_dftu/dftu_folding.cpp index bd2c8ad44a5..b67db9fcb40 100644 --- a/source/source_lcao/module_dftu/dftu_folding.cpp +++ b/source/source_lcao/module_dftu/dftu_folding.cpp @@ -2,7 +2,6 @@ #include "dftu.h" #include "source_base/timer.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_lcao/hamilt_lcao.h" #include "source_lcao/module_hcontainer/hcontainer.h" diff --git a/source/source_lcao/module_dftu/dftu_force.cpp b/source/source_lcao/module_dftu/dftu_force.cpp index 02bfdff5a89..ae588ae15aa 100644 --- a/source/source_lcao/module_dftu/dftu_force.cpp +++ b/source/source_lcao/module_dftu/dftu_force.cpp @@ -11,7 +11,6 @@ #include "source_estate/elecstate_lcao.h" #include "source_estate/magnetism.h" #include "source_estate/module_charge/charge.h" -#include "source_pw/module_pwdft/global.h" #include #include diff --git a/source/source_lcao/module_dftu/dftu_hamilt.cpp b/source/source_lcao/module_dftu/dftu_hamilt.cpp index f4d1b79a32a..6da3b584a11 100644 --- a/source/source_lcao/module_dftu/dftu_hamilt.cpp +++ b/source/source_lcao/module_dftu/dftu_hamilt.cpp @@ -2,7 +2,6 @@ #include "source_base/module_external/scalapack_connector.h" #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #ifdef __LCAO diff --git a/source/source_lcao/module_dftu/dftu_io.cpp b/source/source_lcao/module_dftu/dftu_io.cpp index f7ae8c2f628..f75bc408c6f 100644 --- a/source/source_lcao/module_dftu/dftu_io.cpp +++ b/source/source_lcao/module_dftu/dftu_io.cpp @@ -1,7 +1,7 @@ #include "dftu.h" #include "source_base/timer.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" +#include void Plus_U::output(const UnitCell &ucell) diff --git a/source/source_lcao/module_dftu/dftu_occup.cpp b/source/source_lcao/module_dftu/dftu_occup.cpp index aaabbb81ac9..d6409e86e5a 100644 --- a/source/source_lcao/module_dftu/dftu_occup.cpp +++ b/source/source_lcao/module_dftu/dftu_occup.cpp @@ -1,7 +1,6 @@ #include "dftu.h" #include "source_base/timer.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #ifdef __LCAO #include "source_lcao/hamilt_lcao.h" #endif diff --git a/source/source_lcao/module_dftu/dftu_tools.cpp b/source/source_lcao/module_dftu/dftu_tools.cpp index 3ceece7ae0d..1ae144a8c28 100644 --- a/source/source_lcao/module_dftu/dftu_tools.cpp +++ b/source/source_lcao/module_dftu/dftu_tools.cpp @@ -1,8 +1,6 @@ #include "dftu.h" #include "source_base/timer.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" - #ifdef __LCAO void Plus_U::cal_VU_pot_mat_complex(const int spin, const bool newlocale, std::complex* VU) diff --git a/source/source_lcao/module_dftu/dftu_yukawa.cpp b/source/source_lcao/module_dftu/dftu_yukawa.cpp index 5f77388a75b..c05e8acfee5 100644 --- a/source/source_lcao/module_dftu/dftu_yukawa.cpp +++ b/source/source_lcao/module_dftu/dftu_yukawa.cpp @@ -2,7 +2,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/constants.h" #include "source_base/global_function.h" -#include "source_pw/module_pwdft/global.h" #include "dftu.h" #include diff --git a/source/source_lcao/module_lr/operator_casida/operator_lr_hxc.cpp b/source/source_lcao/module_lr/operator_casida/operator_lr_hxc.cpp index 4aed4244f45..5b008589e1d 100644 --- a/source/source_lcao/module_lr/operator_casida/operator_lr_hxc.cpp +++ b/source/source_lcao/module_lr/operator_casida/operator_lr_hxc.cpp @@ -8,7 +8,6 @@ // #include "source_lcao/DM_gamma_2d_to_grid.h" #include "source_lcao/module_hcontainer/hcontainer_funcs.h" #include "source_lcao/module_lr/ao_to_mo_transformer/ao_to_mo.h" -#include "source_pw/module_pwdft/global.h" #include "source_lcao/module_gint/gint_interface.h" inline double conj(double a) { return a; } @@ -120,4 +119,4 @@ namespace LR template class OperatorLRHxc; template class OperatorLRHxc>; -} \ No newline at end of file +} diff --git a/source/source_lcao/module_lr/potentials/pot_hxc_lrtd.cpp b/source/source_lcao/module_lr/potentials/pot_hxc_lrtd.cpp index 58febe316ec..d4b04ad3ff6 100644 --- a/source/source_lcao/module_lr/potentials/pot_hxc_lrtd.cpp +++ b/source/source_lcao/module_lr/potentials/pot_hxc_lrtd.cpp @@ -6,7 +6,6 @@ #include #include "source_lcao/module_lr/utils/lr_util.h" #include "source_lcao/module_lr/utils/lr_util_xc.hpp" -#include "source_pw/module_pwdft/global.h" // tmp, for pgrid #define FXC_PARA_TYPE const double* const rho, ModuleBase::matrix& v_eff, const std::vector& ispin_op = { 0,0 } namespace LR { diff --git a/source/source_lcao/module_operator_lcao/meta_lcao.cpp b/source/source_lcao/module_operator_lcao/meta_lcao.cpp index f5db5e939ae..c6384af94f1 100644 --- a/source/source_lcao/module_operator_lcao/meta_lcao.cpp +++ b/source/source_lcao/module_operator_lcao/meta_lcao.cpp @@ -1,7 +1,6 @@ #include "meta_lcao.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_pw/module_pwdft/global.h" namespace hamilt { diff --git a/source/source_lcao/module_operator_lcao/op_dftu_lcao.cpp b/source/source_lcao/module_operator_lcao/op_dftu_lcao.cpp index c3ed6bb51e6..ab3d482f67f 100644 --- a/source/source_lcao/module_operator_lcao/op_dftu_lcao.cpp +++ b/source/source_lcao/module_operator_lcao/op_dftu_lcao.cpp @@ -2,7 +2,6 @@ #include "source_base/timer.h" #include "source_base/tool_title.h" #include "source_lcao/module_dftu/dftu.h" -#include "source_pw/module_pwdft/global.h" namespace hamilt { diff --git a/source/source_lcao/module_operator_lcao/op_exx_lcao.hpp b/source/source_lcao/module_operator_lcao/op_exx_lcao.hpp index 80f0c422a26..31e219fbd71 100644 --- a/source/source_lcao/module_operator_lcao/op_exx_lcao.hpp +++ b/source/source_lcao/module_operator_lcao/op_exx_lcao.hpp @@ -5,9 +5,9 @@ #include "op_exx_lcao.h" #include "source_io/module_parameter/parameter.h" #include "source_lcao/module_ri/RI_2D_Comm.h" -#include "source_pw/module_pwdft/global.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_io/restart_exx_csr.h" +#include "source_io/restart.h" namespace hamilt { @@ -394,4 +394,4 @@ void OperatorEXX>::contributeHk(int ik) } // namespace hamilt #endif // __EXX -#endif // OPEXXLCAO_HPP \ No newline at end of file +#endif // OPEXXLCAO_HPP diff --git a/source/source_lcao/module_operator_lcao/td_ekinetic_lcao.cpp b/source/source_lcao/module_operator_lcao/td_ekinetic_lcao.cpp index 6ee51ad7799..9ef6bbe126f 100644 --- a/source/source_lcao/module_operator_lcao/td_ekinetic_lcao.cpp +++ b/source/source_lcao/module_operator_lcao/td_ekinetic_lcao.cpp @@ -10,7 +10,6 @@ #include "source_lcao/center2_orb-orb11.h" #include "source_lcao/spar_hsr.h" #include "source_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/module_pwdft/global.h" namespace hamilt { diff --git a/source/source_lcao/module_operator_lcao/td_nonlocal_lcao.cpp b/source/source_lcao/module_operator_lcao/td_nonlocal_lcao.cpp index 6f39ad039f9..0bbcb6fd528 100644 --- a/source/source_lcao/module_operator_lcao/td_nonlocal_lcao.cpp +++ b/source/source_lcao/module_operator_lcao/td_nonlocal_lcao.cpp @@ -12,7 +12,6 @@ #include "source_lcao/module_rt/kernels/snap_psibeta_gpu.h" #endif -#include "source_pw/module_pwdft/global.h" #ifdef _OPENMP #include #include diff --git a/source/source_lcao/module_operator_lcao/td_pot_hybrid.cpp b/source/source_lcao/module_operator_lcao/td_pot_hybrid.cpp index f024c6fbff8..f0d68d01334 100644 --- a/source/source_lcao/module_operator_lcao/td_pot_hybrid.cpp +++ b/source/source_lcao/module_operator_lcao/td_pot_hybrid.cpp @@ -5,7 +5,6 @@ #include "source_cell/module_neighbor/sltk_grid_driver.h" #include "source_lcao/module_operator_lcao/operator_lcao.h" #include "source_lcao/module_hcontainer/hcontainer_funcs.h" -#include "source_pw/module_pwdft/global.h" // Constructor template diff --git a/source/source_lcao/module_rdmft/rdmft.cpp b/source/source_lcao/module_rdmft/rdmft.cpp index 34549fb671c..82aeeead513 100644 --- a/source/source_lcao/module_rdmft/rdmft.cpp +++ b/source/source_lcao/module_rdmft/rdmft.cpp @@ -6,11 +6,9 @@ #include "rdmft.h" #include "source_lcao/module_rdmft/rdmft_tools.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/parallel_reduce.h" #include "source_cell/module_symmetry/symmetry.h" - #include #include #include diff --git a/source/source_lcao/module_rdmft/rdmft.h b/source/source_lcao/module_rdmft/rdmft.h index 0e6b532d6e9..8e9fb71ced9 100644 --- a/source/source_lcao/module_rdmft/rdmft.h +++ b/source/source_lcao/module_rdmft/rdmft.h @@ -6,7 +6,6 @@ #define RDMFT_H #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_psi/psi.h" #include "source_base/matrix.h" @@ -26,6 +25,9 @@ // there are some operator reload to print data in different formats #endif +#include "source_estate/elecstate.h" +#include "source_cell/module_neighbor/sltk_grid_driver.h" // use Grid_Driver + #include #include #include diff --git a/source/source_lcao/module_rdmft/rdmft_tools.cpp b/source/source_lcao/module_rdmft/rdmft_tools.cpp index ffc08c431ac..845ffea162f 100644 --- a/source/source_lcao/module_rdmft/rdmft_tools.cpp +++ b/source/source_lcao/module_rdmft/rdmft_tools.cpp @@ -3,7 +3,6 @@ // DATE : 2024-03-11 //========================================================== #include "source_lcao/module_rdmft/rdmft_tools.h" -#include "source_pw/module_pwdft/global.h" // used by class Veff_rdmft #include "source_base/tool_title.h" #include "source_base/timer.h" diff --git a/source/source_lcao/module_rdmft/rdmft_tools.h b/source/source_lcao/module_rdmft/rdmft_tools.h index 0a4e28f548c..d8a34419e7d 100644 --- a/source/source_lcao/module_rdmft/rdmft_tools.h +++ b/source/source_lcao/module_rdmft/rdmft_tools.h @@ -5,6 +5,8 @@ #ifndef RDMFT_TOOLS_H #define RDMFT_TOOLS_H +#include "source_cell/klist.h" +#include "source_io/module_parameter/parameter.h" // use PARAM #include "source_psi/psi.h" #include "source_base/matrix.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" @@ -15,7 +17,6 @@ #include "source_base/parallel_2d.h" #include "source_basis/module_ao/parallel_orbitals.h" #include "source_base/parallel_reduce.h" -#include "source_pw/module_pwdft/global.h" #include "source_estate/module_dm/cal_dm_psi.h" #include "source_estate/module_dm/density_matrix.h" diff --git a/source/source_lcao/module_rdmft/update_state_rdmft.cpp b/source/source_lcao/module_rdmft/update_state_rdmft.cpp index 7a43c9be914..4f22791cf9a 100644 --- a/source/source_lcao/module_rdmft/update_state_rdmft.cpp +++ b/source/source_lcao/module_rdmft/update_state_rdmft.cpp @@ -9,7 +9,7 @@ #include "source_estate/module_dm/density_matrix.h" #include "source_estate/module_charge/symmetry_rho.h" #include "source_lcao/module_gint/gint_interface.h" - +#include "source_hamilt/module_xc/xc_functional.h" namespace rdmft { diff --git a/source/source_lcao/module_ri/Exx_LRI_interface.h b/source/source_lcao/module_ri/Exx_LRI_interface.h index 15302677b57..7a0cab7a58f 100644 --- a/source/source_lcao/module_ri/Exx_LRI_interface.h +++ b/source/source_lcao/module_ri/Exx_LRI_interface.h @@ -5,6 +5,7 @@ #include "source_lcao/module_ri/Mix_DMk_2D.h" #include "source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.h" #include "source_estate/module_dm/density_matrix.h" // mohan add 2025-11-04 +#include "source_hamilt/hamilt.h" #include class LCAO_Matrix; diff --git a/source/source_lcao/module_ri/Exx_LRI_interface.hpp b/source/source_lcao/module_ri/Exx_LRI_interface.hpp index 06e0845da84..131ae98ab35 100644 --- a/source/source_lcao/module_ri/Exx_LRI_interface.hpp +++ b/source/source_lcao/module_ri/Exx_LRI_interface.hpp @@ -11,6 +11,8 @@ #include "source_io/csr_reader.h" #include "source_io/write_HS_sparse.h" #include "source_estate/elecstate_lcao.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info +#include "source_io/restart.h" #include #include diff --git a/source/source_lcao/module_ri/LRI_CV.hpp b/source/source_lcao/module_ri/LRI_CV.hpp index b343d4d20dd..b07ad881d2a 100644 --- a/source/source_lcao/module_ri/LRI_CV.hpp +++ b/source/source_lcao/module_ri/LRI_CV.hpp @@ -13,7 +13,7 @@ #include "../../source_basis/module_ao/element_basis_index-ORB.h" #include "../../source_base/tool_title.h" #include "../../source_base/timer.h" -#include "../../source_pw/module_pwdft/global.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info #include #include diff --git a/source/source_lcao/module_ri/LRI_CV_Tools.hpp b/source/source_lcao/module_ri/LRI_CV_Tools.hpp index 42567d58e0e..110db1bf806 100644 --- a/source/source_lcao/module_ri/LRI_CV_Tools.hpp +++ b/source/source_lcao/module_ri/LRI_CV_Tools.hpp @@ -13,7 +13,6 @@ #include #include -#include "../../source_pw/module_pwdft/global.h" template RI::Tensor LRI_CV_Tools::cal_I(const RI::Tensor& m, diff --git a/source/source_lcao/module_ri/Matrix_Orbs11.cpp b/source/source_lcao/module_ri/Matrix_Orbs11.cpp index 31d7a87dcec..7f3a5ad63ab 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs11.cpp +++ b/source/source_lcao/module_ri/Matrix_Orbs11.cpp @@ -8,7 +8,6 @@ #include "exx_abfs-construct_orbs.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_pw/module_pwdft/global.h" void Matrix_Orbs11::init( const std::vector>>& orb_A, diff --git a/source/source_lcao/module_ri/Matrix_Orbs11.hpp b/source/source_lcao/module_ri/Matrix_Orbs11.hpp index 0d5ab1ba913..7b139203a10 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs11.hpp +++ b/source/source_lcao/module_ri/Matrix_Orbs11.hpp @@ -8,7 +8,6 @@ #include "Matrix_Orbs11.h" #include "RI_Util.h" -#include "source_pw/module_pwdft/global.h" template RI::Tensor Matrix_Orbs11::cal_overlap_matrix( diff --git a/source/source_lcao/module_ri/Matrix_Orbs21.cpp b/source/source_lcao/module_ri/Matrix_Orbs21.cpp index 9317e9dbd88..1bbade7e4ca 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs21.cpp +++ b/source/source_lcao/module_ri/Matrix_Orbs21.cpp @@ -8,7 +8,6 @@ #include "exx_abfs-construct_orbs.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_pw/module_pwdft/global.h" void Matrix_Orbs21::init( const std::vector>>& orb_A1, diff --git a/source/source_lcao/module_ri/Matrix_Orbs21.hpp b/source/source_lcao/module_ri/Matrix_Orbs21.hpp index 28766ad2f2e..af92d7aeddc 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs21.hpp +++ b/source/source_lcao/module_ri/Matrix_Orbs21.hpp @@ -8,7 +8,6 @@ #include "Matrix_Orbs21.h" #include "RI_Util.h" -#include "source_pw/module_pwdft/global.h" template RI::Tensor Matrix_Orbs21::cal_overlap_matrix( diff --git a/source/source_lcao/module_ri/Matrix_Orbs22.cpp b/source/source_lcao/module_ri/Matrix_Orbs22.cpp index 1dca7a351b9..23b782a781e 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs22.cpp +++ b/source/source_lcao/module_ri/Matrix_Orbs22.cpp @@ -8,7 +8,6 @@ #include "exx_abfs-construct_orbs.h" #include "source_base/timer.h" #include "source_base/tool_title.h" -#include "source_pw/module_pwdft/global.h" void Matrix_Orbs22::init( const std::vector>>& orb_A1, diff --git a/source/source_lcao/module_ri/Matrix_Orbs22.hpp b/source/source_lcao/module_ri/Matrix_Orbs22.hpp index 502597ba460..ed4b58d83ff 100644 --- a/source/source_lcao/module_ri/Matrix_Orbs22.hpp +++ b/source/source_lcao/module_ri/Matrix_Orbs22.hpp @@ -8,7 +8,6 @@ #include "Matrix_Orbs22.h" #include "RI_Util.h" -#include "source_pw/module_pwdft/global.h" template RI::Tensor Matrix_Orbs22::cal_overlap_matrix( diff --git a/source/source_lcao/module_ri/RI_2D_Comm.cpp b/source/source_lcao/module_ri/RI_2D_Comm.cpp index fdb3d52a8d0..90c016f51d6 100644 --- a/source/source_lcao/module_ri/RI_2D_Comm.cpp +++ b/source/source_lcao/module_ri/RI_2D_Comm.cpp @@ -1,11 +1,10 @@ //======================= // AUTHOR : Peize Lin -#include "source_io/module_parameter/parameter.h" // DATE : 2022-08-17 //======================= +#include "source_io/module_parameter/parameter.h" #include "RI_2D_Comm.h" -#include "source_pw/module_pwdft/global.h" #include "source_cell/klist.h" #include diff --git a/source/source_lcao/module_ri/RI_2D_Comm.hpp b/source/source_lcao/module_ri/RI_2D_Comm.hpp index 78eedf56c48..b9c34acd43d 100644 --- a/source/source_lcao/module_ri/RI_2D_Comm.hpp +++ b/source/source_lcao/module_ri/RI_2D_Comm.hpp @@ -8,7 +8,6 @@ #include "RI_2D_Comm.h" #include "RI_Util.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/tool_title.h" #include "source_base/timer.h" #include "source_lcao/LCAO_domain.h" @@ -284,4 +283,4 @@ void RI_2D_Comm::add_HexxR( ModuleBase::timer::tick("RI_2D_Comm", "add_HexxR"); } -#endif \ No newline at end of file +#endif diff --git a/source/source_lcao/module_ri/RI_Util.hpp b/source/source_lcao/module_ri/RI_Util.hpp index 3ff9cb4cf52..7e0fd61d6c5 100644 --- a/source/source_lcao/module_ri/RI_Util.hpp +++ b/source/source_lcao/module_ri/RI_Util.hpp @@ -6,9 +6,9 @@ #ifndef RI_UTIL_HPP #define RI_UTIL_HPP -#include "RI_Util.h" -#include "source_pw/module_pwdft/global.h" -#include "source_base/global_function.h" +#include "RI_Util.h" +#include "source_base/global_function.h" +#include "source_io/module_parameter/parameter.h" namespace RI_Util { @@ -147,4 +147,4 @@ namespace RI_Util } } -#endif \ No newline at end of file +#endif diff --git a/source/source_lcao/module_ri/RPA_LRI.h b/source/source_lcao/module_ri/RPA_LRI.h index 75161a21a49..ae5754069f3 100644 --- a/source/source_lcao/module_ri/RPA_LRI.h +++ b/source/source_lcao/module_ri/RPA_LRI.h @@ -11,6 +11,7 @@ // #include "module_xc/exx_info.h" // #include "source_basis/module_ao/ORB_atomic_lm.h" #include "source_base/matrix.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info // #include "source_lcao/module_ri/Exx_LRI.h" // #include #include diff --git a/source/source_lcao/module_ri/RPA_LRI.hpp b/source/source_lcao/module_ri/RPA_LRI.hpp index 8b039122ee7..2580a754248 100644 --- a/source/source_lcao/module_ri/RPA_LRI.hpp +++ b/source/source_lcao/module_ri/RPA_LRI.hpp @@ -13,6 +13,7 @@ #include "RPA_LRI.h" #include "source_io/module_parameter/parameter.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info template void RPA_LRI::init(const MPI_Comm& mpi_comm_in, const K_Vectors& kv_in, const std::vector& orb_cutoff) diff --git a/source/source_lcao/module_ri/conv_coulomb_pot_k.cpp b/source/source_lcao/module_ri/conv_coulomb_pot_k.cpp index bb50800b13b..17198101073 100644 --- a/source/source_lcao/module_ri/conv_coulomb_pot_k.cpp +++ b/source/source_lcao/module_ri/conv_coulomb_pot_k.cpp @@ -2,7 +2,6 @@ #include "../../source_base/constants.h" #include "source_io/module_parameter/parameter.h" #include "../../source_basis/module_ao/ORB_atomic_lm.h" -#include "../../source_pw/module_pwdft/global.h" namespace Conv_Coulomb_Pot_K { diff --git a/source/source_lcao/module_ri/exx_abfs-construct_orbs.cpp b/source/source_lcao/module_ri/exx_abfs-construct_orbs.cpp index 0a0e22b21a1..fc80551ad61 100644 --- a/source/source_lcao/module_ri/exx_abfs-construct_orbs.cpp +++ b/source/source_lcao/module_ri/exx_abfs-construct_orbs.cpp @@ -5,7 +5,6 @@ #include "source_base/gram_schmidt_orth-inl.h" #include "source_base/gram_schmidt_orth.h" #include "source_basis/module_ao/ORB_read.h" -#include "source_pw/module_pwdft/global.h" //for ucell #include "source_lcao/module_ri/test_code/exx_abfs-construct_orbs-test.h" // Peize Lin test std::vector>> Exx_Abfs::Construct_Orbs::change_orbs( diff --git a/source/source_lcao/module_ri/exx_abfs-io.cpp b/source/source_lcao/module_ri/exx_abfs-io.cpp index 2d78dcb4d8b..0ed196335b1 100644 --- a/source/source_lcao/module_ri/exx_abfs-io.cpp +++ b/source/source_lcao/module_ri/exx_abfs-io.cpp @@ -4,7 +4,6 @@ #include "exx_abfs-io.h" #include "exx_abfs-jle.h" -#include "../../source_pw/module_pwdft/global.h" #include "../../source_basis/module_ao/ORB_read.h" #include "../../source_base/global_function.h" #include "../../source_base/math_integral.h" // mohan add 2021-04-03 diff --git a/source/source_lcao/module_ri/exx_lip.hpp b/source/source_lcao/module_ri/exx_lip.hpp index 1ba014a935d..d83f975342f 100644 --- a/source/source_lcao/module_ri/exx_lip.hpp +++ b/source/source_lcao/module_ri/exx_lip.hpp @@ -11,7 +11,6 @@ #include "source_base/vector3.h" #include "source_base/global_function.h" #include "source_base/vector3.h" -#include "source_pw/module_pwdft/global.h" #include "source_cell/klist.h" #include "source_lcao/wavefunc_in_pw.h" #include "source_base/module_external/lapack_connector.h" @@ -24,6 +23,7 @@ #include "source_pw/module_pwdft/structure_factor.h" #include "source_base/tool_title.h" #include "source_base/timer.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info #include #include @@ -622,4 +622,4 @@ void Exx_Lip::read_q_pack(const ModuleSymmetry::Symmetry& symm, } */ -#endif \ No newline at end of file +#endif diff --git a/source/source_lcao/module_ri/exx_opt_orb-print.cpp b/source/source_lcao/module_ri/exx_opt_orb-print.cpp index bf19815cfce..2418fdd9962 100644 --- a/source/source_lcao/module_ri/exx_opt_orb-print.cpp +++ b/source/source_lcao/module_ri/exx_opt_orb-print.cpp @@ -1,5 +1,4 @@ #include "exx_opt_orb.h" -#include "../../source_pw/module_pwdft/global.h" #include "exx_abfs-jle.h" #include "source_base/tool_title.h" #include diff --git a/source/source_lcao/module_ri/exx_opt_orb.cpp b/source/source_lcao/module_ri/exx_opt_orb.cpp index a00af11834d..49faad5d785 100644 --- a/source/source_lcao/module_ri/exx_opt_orb.cpp +++ b/source/source_lcao/module_ri/exx_opt_orb.cpp @@ -1,5 +1,4 @@ #include "exx_opt_orb.h" -#include "source_pw/module_pwdft/global.h" #include "source_basis/module_ao/ORB_atomic_lm.h" #include "exx_abfs.h" #include "exx_abfs-construct_orbs.h" diff --git a/source/source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.cpp b/source/source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.cpp index 53922f42ac7..e0b4d91b8bd 100644 --- a/source/source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.cpp +++ b/source/source_lcao/module_ri/module_exx_symmetry/symmetry_rotation.cpp @@ -8,8 +8,6 @@ #include "source_base/timer.h" #include "source_base/mathzone.h" -#include "source_pw/module_pwdft/global.h" - namespace ModuleSymmetry { void Symmetry_rotation::set_Cs_rotation(const std::vector>& abfs_l_nchi) @@ -479,4 +477,4 @@ namespace ModuleSymmetry return RI_Util::get_Born_von_Karmen_cells(period); } -} \ No newline at end of file +} diff --git a/source/source_lcao/module_rt/evolve_elec.cpp b/source/source_lcao/module_rt/evolve_elec.cpp index e43c5da4f37..b957d193ea8 100644 --- a/source/source_lcao/module_rt/evolve_elec.cpp +++ b/source/source_lcao/module_rt/evolve_elec.cpp @@ -6,7 +6,6 @@ #include "source_estate/module_charge/symmetry_rho.h" #include "source_lcao/hamilt_lcao.h" #include "source_lcao/module_dftu/dftu.h" -#include "source_pw/module_pwdft/global.h" namespace module_rt { @@ -215,4 +214,4 @@ template class Evolve_elec; #if ((defined __CUDA) /* || (defined __ROCM) */) template class Evolve_elec; #endif -} // namespace module_rt \ No newline at end of file +} // namespace module_rt diff --git a/source/source_lcao/module_rt/evolve_psi.cpp b/source/source_lcao/module_rt/evolve_psi.cpp index 94d65597e83..bd6eaef793e 100644 --- a/source/source_lcao/module_rt/evolve_psi.cpp +++ b/source/source_lcao/module_rt/evolve_psi.cpp @@ -10,7 +10,6 @@ #include "source_esolver/esolver_ks_lcao_tddft.h" // use gatherMatrix #include "source_io/module_parameter/parameter.h" #include "source_lcao/hamilt_lcao.h" -#include "source_pw/module_pwdft/global.h" #include "upsi.h" #include diff --git a/source/source_lcao/module_rt/solve_propagation.cpp b/source/source_lcao/module_rt/solve_propagation.cpp index 01a08e04255..298bf2eef94 100644 --- a/source/source_lcao/module_rt/solve_propagation.cpp +++ b/source/source_lcao/module_rt/solve_propagation.cpp @@ -1,10 +1,11 @@ #include "solve_propagation.h" +#include "source_base/module_external/scalapack_connector.h" +#include "source_base/module_external/blas_connector.h" +#include "source_base/constants.h" +#include "source_base/global_function.h" #include -#include "source_base/module_external/scalapack_connector.h" -#include "source_pw/module_pwdft/global.h" - namespace module_rt { #ifdef __MPI diff --git a/source/source_lcao/record_adj.cpp b/source/source_lcao/record_adj.cpp index 47118496a51..9f0aee0e155 100644 --- a/source/source_lcao/record_adj.cpp +++ b/source/source_lcao/record_adj.cpp @@ -1,9 +1,8 @@ #include "record_adj.h" - #include "source_base/timer.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" + Record_adj::Record_adj() { } diff --git a/source/source_lcao/setup_dm.cpp b/source/source_lcao/setup_dm.cpp index a91b43ab96a..edb774ea58a 100644 --- a/source/source_lcao/setup_dm.cpp +++ b/source/source_lcao/setup_dm.cpp @@ -1,15 +1,11 @@ #include "source_lcao/setup_dm.h" - #include "source_estate/cal_dm.h" #include "source_base/timer.h" #include "source_estate/module_dm/cal_dm_psi.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_lcao/module_deltaspin/spin_constrain.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" - #include "source_lcao/module_gint/gint_interface.h" - #include namespace LCAO_domain diff --git a/source/source_lcao/spar_dh.h b/source/source_lcao/spar_dh.h index 9af4fd6009c..c176096e516 100644 --- a/source/source_lcao/spar_dh.h +++ b/source/source_lcao/spar_dh.h @@ -6,7 +6,6 @@ #include "source_lcao/LCAO_HS_arrays.hpp" #include "source_lcao/force_stress_arrays.h" #include "source_lcao/hamilt_lcao.h" -#include "source_pw/module_pwdft/global.h" #include namespace sparse_format diff --git a/source/source_lcao/spar_st.cpp b/source/source_lcao/spar_st.cpp index c3352b7c8aa..b3f7b4a2f2f 100644 --- a/source/source_lcao/spar_st.cpp +++ b/source/source_lcao/spar_st.cpp @@ -3,7 +3,6 @@ #include "force_stress_arrays.h" #include "source_io/module_parameter/parameter.h" #include "source_lcao/LCAO_domain.h" -#include "source_pw/module_pwdft/global.h" // only for INPUT #include "spar_dh.h" #include "spar_hsr.h" @@ -224,4 +223,4 @@ template void sparse_format::cal_SR>( std::map, std::map>>>& SR_soc_sparse, const Grid_Driver& grid, const double& sparse_thr, - hamilt::Hamilt>* p_ham); \ No newline at end of file + hamilt::Hamilt>* p_ham); diff --git a/source/source_lcao/spar_u.cpp b/source/source_lcao/spar_u.cpp index 6a7d48709a2..fe12fe1c60c 100644 --- a/source/source_lcao/spar_u.cpp +++ b/source/source_lcao/spar_u.cpp @@ -1,7 +1,6 @@ #include "spar_u.h" #include "source_base/parallel_reduce.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/timer.h" void sparse_format::cal_HR_dftu( diff --git a/source/source_lcao/spar_u.h b/source/source_lcao/spar_u.h index 972033b47d2..5ac5c8a3659 100644 --- a/source/source_lcao/spar_u.h +++ b/source/source_lcao/spar_u.h @@ -3,10 +3,9 @@ #include "source_cell/module_neighbor/sltk_atom_arrange.h" #include "source_cell/module_neighbor/sltk_grid_driver.h" -#include "source_pw/module_pwdft/global.h" #include "source_lcao/hamilt_lcao.h" #include "source_lcao/module_dftu/dftu.h" // mohan add 20251107 - +#include "source_base/abfs-vector3_order.h" namespace sparse_format { diff --git a/source/source_lcao/wavefunc_in_pw.cpp b/source/source_lcao/wavefunc_in_pw.cpp index 064a93c0d02..701f0f42a47 100644 --- a/source/source_lcao/wavefunc_in_pw.cpp +++ b/source/source_lcao/wavefunc_in_pw.cpp @@ -1,7 +1,6 @@ +#include // Peize Lin fix bug about strcmp 2016-08-02 #include "wavefunc_in_pw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" -#include // Peize Lin fix bug about strcmp 2016-08-02 #include "source_base/math_integral.h" #include "source_base/math_sphbes.h" #include "source_base/math_polyint.h" diff --git a/source/source_main/driver.cpp b/source/source_main/driver.cpp index 13c481bca4e..d28bd5ba4f4 100644 --- a/source/source_main/driver.cpp +++ b/source/source_main/driver.cpp @@ -4,7 +4,6 @@ #include "source_base/memory.h" #include "source_base/timer.h" #include "source_esolver/esolver.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/cal_test.h" #include "source_io/input_conv.h" #include "source_io/para_json.h" @@ -12,6 +11,8 @@ #include "source_io/read_input.h" #include "source_io/module_parameter/parameter.h" #include "source_main/version.h" +#include "source_base/parallel_global.h" + Driver::Driver() { } diff --git a/source/source_main/driver_run.cpp b/source/source_main/driver_run.cpp index 895b06bf577..fa0d0291262 100644 --- a/source/source_main/driver_run.cpp +++ b/source/source_main/driver_run.cpp @@ -1,7 +1,7 @@ #include "source_main/driver.h" #include "source_cell/check_atomic_stru.h" #include "source_cell/module_neighbor/sltk_atom_arrange.h" -#include "source_pw/module_pwdft/global.h" +#include "source_relax/relax_driver.h" #include "source_io/module_parameter/parameter.h" #include "source_io/para_json.h" #include "source_io/print_info.h" diff --git a/source/source_pw/module_ofdft/kedf_ml.cpp b/source/source_pw/module_ofdft/kedf_ml.cpp index 159eeb45609..bf2423fb481 100644 --- a/source/source_pw/module_ofdft/kedf_ml.cpp +++ b/source/source_pw/module_ofdft/kedf_ml.cpp @@ -5,7 +5,6 @@ #include "npy.hpp" #include "source_base/parallel_reduce.h" #include "source_base/global_function.h" -#include "source_pw/module_pwdft/global.h" void KEDF_ML::set_para( const int nx, @@ -252,4 +251,4 @@ void KEDF_ML::localTest(const double * const *pprho, ModulePW::PW_Basis *pw_rho) this->dumpMatrix("potential-abacus.npy", potential); exit(0); } -#endif \ No newline at end of file +#endif diff --git a/source/source_pw/module_ofdft/of_stress_pw.cpp b/source/source_pw/module_ofdft/of_stress_pw.cpp index 02011e4284c..04d097851c4 100644 --- a/source/source_pw/module_ofdft/of_stress_pw.cpp +++ b/source/source_pw/module_ofdft/of_stress_pw.cpp @@ -2,7 +2,6 @@ #include "source_base/timer.h" #include "source_hamilt/module_vdw/vdw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/output_log.h" // Since the kinetic stress of OFDFT is calculated by kinetic functionals in esolver_of.cpp, here we regard it as an diff --git a/source/source_pw/module_pwdft/CMakeLists.txt b/source/source_pw/module_pwdft/CMakeLists.txt index f958fdc75eb..66354adb9a3 100644 --- a/source/source_pw/module_pwdft/CMakeLists.txt +++ b/source/source_pw/module_pwdft/CMakeLists.txt @@ -39,7 +39,6 @@ list(APPEND objects structure_factor.cpp structure_factor_k.cpp soc.cpp - global.cpp parallel_grid.cpp elecond.cpp fs_nonlocal_tools.cpp diff --git a/source/source_pw/module_pwdft/VL_in_pw.cpp b/source/source_pw/module_pwdft/VL_in_pw.cpp index 87e14dcced7..66c0b595bbe 100644 --- a/source/source_pw/module_pwdft/VL_in_pw.cpp +++ b/source/source_pw/module_pwdft/VL_in_pw.cpp @@ -3,7 +3,6 @@ #include "source_base/libm/libm.h" #include "source_base/math_integral.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" pseudopot_cell_vl::pseudopot_cell_vl() { diff --git a/source/source_pw/module_pwdft/VNL_grad_pw.cpp b/source/source_pw/module_pwdft/VNL_grad_pw.cpp index 34009da0828..0cc37eccdb7 100644 --- a/source/source_pw/module_pwdft/VNL_grad_pw.cpp +++ b/source/source_pw/module_pwdft/VNL_grad_pw.cpp @@ -5,7 +5,7 @@ #include "source_base/math_ylmreal.h" #include "source_base/math_integral.h" #include "source_base/math_polyint.h" -#include "source_pw/module_pwdft/global.h" + void pseudopot_cell_vnl::initgradq_vnl(const UnitCell &cell) { const int nbrx = 10; @@ -183,4 +183,4 @@ void pseudopot_cell_vnl::getgradq_vnl(const UnitCell& ucell, ModuleBase::timer::tick("pp_cell_vnl","getvnl"); return; -} \ No newline at end of file +} diff --git a/source/source_pw/module_pwdft/VNL_in_pw.cpp b/source/source_pw/module_pwdft/VNL_in_pw.cpp index 438358c4aeb..3b63c28f3d6 100644 --- a/source/source_pw/module_pwdft/VNL_in_pw.cpp +++ b/source/source_pw/module_pwdft/VNL_in_pw.cpp @@ -11,9 +11,10 @@ #include "source_base/memory.h" #include "source_base/module_device/device.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/kernels/vnl_op.h" +#include "source_base/parallel_comm.h" // use POOL_WORLD + pseudopot_cell_vnl::pseudopot_cell_vnl() { diff --git a/source/source_pw/module_pwdft/forces.cpp b/source/source_pw/module_pwdft/forces.cpp index 819f0cdf232..255b8e23a2c 100644 --- a/source/source_pw/module_pwdft/forces.cpp +++ b/source/source_pw/module_pwdft/forces.cpp @@ -1,7 +1,6 @@ #include "forces.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/output_log.h" // new #include "source_base/complexmatrix.h" diff --git a/source/source_pw/module_pwdft/global.cpp b/source/source_pw/module_pwdft/global.cpp deleted file mode 100644 index fd2195162dc..00000000000 --- a/source/source_pw/module_pwdft/global.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "global.h" -//---------------------------------------------------------- -// init "GLOBAL CLASS" object -//---------------------------------------------------------- -namespace GlobalC -{ -Restart restart; // Peize Lin add 2020.04.04 -} - -//Magnetism mag; diff --git a/source/source_pw/module_pwdft/global.h b/source/source_pw/module_pwdft/global.h deleted file mode 100644 index d25b26ef9fc..00000000000 --- a/source/source_pw/module_pwdft/global.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef GLOBAL_H -#define GLOBAL_H - -#include "source_base/global_function.h" -#include "source_base/global_variable.h" -#include "source_estate/module_charge/charge_mixing.h" -#include "source_pw/module_pwdft/VNL_in_pw.h" -#include "source_io/restart.h" -#include "source_relax/relax_driver.h" -#ifdef __EXX -#include "source_hamilt/module_xc/exx_info.h" -#include "source_lcao/module_ri/exx_lip.h" -#endif -#include "source_estate/magnetism.h" -#include "source_hamilt/module_xc/xc_functional.h" -#include "source_base/module_device/device_check.h" - -//========================================================== -// EXPLAIN : define "GLOBAL CLASS" -//========================================================== - -#include "source_cell/parallel_kpoints.h" -#include "source_cell/unitcell.h" -namespace GlobalC -{ -extern Restart restart; // Peize Lin add 2020.04.04 -} // namespace GlobalC - -// extern Magnetism mag; - -#endif diff --git a/source/source_pw/module_pwdft/hamilt_pw.cpp b/source/source_pw/module_pwdft/hamilt_pw.cpp index 6af572142bb..6ba4df43188 100644 --- a/source/source_pw/module_pwdft/hamilt_pw.cpp +++ b/source/source_pw/module_pwdft/hamilt_pw.cpp @@ -3,7 +3,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/global_function.h" #include "source_base/global_variable.h" -#include "source_pw/module_pwdft/global.h" #include "operator_pw/veff_pw.h" #include "operator_pw/ekinetic_pw.h" @@ -11,8 +10,7 @@ #include "operator_pw/nonlocal_pw.h" #include "operator_pw/onsite_proj_pw.h" #include "operator_pw/op_exx_pw.h" - - +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info namespace hamilt { diff --git a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp index db0a2aa49ab..eb70bd302a2 100644 --- a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp +++ b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.cpp @@ -1,4 +1,6 @@ #include "exx_helper.h" +#include "source_io/module_parameter/parameter.h" // use PARAM +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info template double Exx_Helper::cal_exx_energy(psi::Psi *psi_) diff --git a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.h b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.h index 77c6c842958..010d9c7176c 100644 --- a/source/source_pw/module_pwdft/module_exx_helper/exx_helper.h +++ b/source/source_pw/module_pwdft/module_exx_helper/exx_helper.h @@ -3,7 +3,6 @@ // #include "source_psi/psi.h" #include "source_base/matrix.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/operator_pw/op_exx_pw.h" #ifndef EXX_HELPER_H diff --git a/source/source_pw/module_pwdft/operator_pw/exx_pw_pot.cpp b/source/source_pw/module_pwdft/operator_pw/exx_pw_pot.cpp index 924380d9dd4..e353e5ee602 100644 --- a/source/source_pw/module_pwdft/operator_pw/exx_pw_pot.cpp +++ b/source/source_pw/module_pwdft/operator_pw/exx_pw_pot.cpp @@ -1,6 +1,6 @@ #include "op_exx_pw.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info namespace hamilt { @@ -587,4 +587,4 @@ template void get_exx_stress_potential(const K_ int, int); #endif -} // namespace hamilt \ No newline at end of file +} // namespace hamilt diff --git a/source/source_pw/module_pwdft/operator_pw/meta_pw.cpp b/source/source_pw/module_pwdft/operator_pw/meta_pw.cpp index c036a0a1f3c..70926e0830e 100644 --- a/source/source_pw/module_pwdft/operator_pw/meta_pw.cpp +++ b/source/source_pw/module_pwdft/operator_pw/meta_pw.cpp @@ -1,7 +1,6 @@ #include "meta_pw.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_base/tool_quit.h" @@ -114,4 +113,4 @@ template class Meta, base_device::DEVICE_GPU>>; // base_device::DEVICE_CPU>> *meta); template Meta, // base_device::DEVICE_GPU>>::Meta(const Meta, base_device::DEVICE_GPU>> *meta); #endif -} // namespace hamilt \ No newline at end of file +} // namespace hamilt diff --git a/source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp b/source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp index e4e6f9167d6..c5be374e1d9 100644 --- a/source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp +++ b/source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp @@ -10,11 +10,12 @@ #include "source_cell/klist.h" #include "source_hamilt/operator.h" #include "source_psi/psi.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/kernels/cal_density_real_op.h" #include "source_pw/module_pwdft/kernels/exx_cal_energy_op.h" #include "source_pw/module_pwdft/kernels/mul_potential_op.h" #include "source_pw/module_pwdft/kernels/vec_mul_vec_complex_op.h" +#include "source_io/module_parameter/parameter.h" // use PARAM +#include "source_hamilt/module_xc/exx_info.h" // use GlobalC::exx_info #include #include diff --git a/source/source_pw/module_pwdft/parallel_grid.cpp b/source/source_pw/module_pwdft/parallel_grid.cpp index 2f05218cd26..73cbba225e9 100644 --- a/source/source_pw/module_pwdft/parallel_grid.cpp +++ b/source/source_pw/module_pwdft/parallel_grid.cpp @@ -1,7 +1,11 @@ #include "parallel_grid.h" - -#include "source_base/parallel_global.h" #include "source_io/module_parameter/parameter.h" + +#ifdef __MPI +#include "source_base/parallel_comm.h" // use POOL_WORLD +#include +#endif + Parallel_Grid::Parallel_Grid() { this->allocate = false; diff --git a/source/source_pw/module_pwdft/stress_func_cc.cpp b/source/source_pw/module_pwdft/stress_func_cc.cpp index 81b2767d51e..211d5a4bda9 100644 --- a/source/source_pw/module_pwdft/stress_func_cc.cpp +++ b/source/source_pw/module_pwdft/stress_func_cc.cpp @@ -3,7 +3,6 @@ #include "source_io/module_parameter/parameter.h" #include "source_base/math_integral.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_estate/cal_ux.h" #ifdef USE_LIBXC diff --git a/source/source_pw/module_pwdft/stress_func_ewa.cpp b/source/source_pw/module_pwdft/stress_func_ewa.cpp index 48887c07b24..20f107581c4 100644 --- a/source/source_pw/module_pwdft/stress_func_ewa.cpp +++ b/source/source_pw/module_pwdft/stress_func_ewa.cpp @@ -3,7 +3,6 @@ #include "source_base/timer.h" #include "source_base/tool_threading.h" #include "source_base/libm/libm.h" -#include "source_pw/module_pwdft/global.h" #ifdef _OPENMP #include diff --git a/source/source_pw/module_pwdft/stress_func_exx.cpp b/source/source_pw/module_pwdft/stress_func_exx.cpp index dd2c6570a00..cf0bf2af88e 100644 --- a/source/source_pw/module_pwdft/stress_func_exx.cpp +++ b/source/source_pw/module_pwdft/stress_func_exx.cpp @@ -1,4 +1,4 @@ -#include "global.h" +#include "source_hamilt/module_xc/exx_info.h" #include "operator_pw/op_exx_pw.h" #include "source_base/parallel_common.h" #include "stress_pw.h" diff --git a/source/source_pw/module_pwdft/stress_func_gga.cpp b/source/source_pw/module_pwdft/stress_func_gga.cpp index 9d9bbf5ebd5..f5eb5eaa1c9 100644 --- a/source/source_pw/module_pwdft/stress_func_gga.cpp +++ b/source/source_pw/module_pwdft/stress_func_gga.cpp @@ -1,7 +1,6 @@ #include "stress_func.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" //calculate the GGA stress correction in PW and LCAO template diff --git a/source/source_pw/module_pwdft/stress_func_har.cpp b/source/source_pw/module_pwdft/stress_func_har.cpp index b99ee7fb041..90d80bc4dc8 100644 --- a/source/source_pw/module_pwdft/stress_func_har.cpp +++ b/source/source_pw/module_pwdft/stress_func_har.cpp @@ -2,7 +2,6 @@ #include "source_estate/module_pot/H_Hartree_pw.h" #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" //calculate the Hartree part in PW or LCAO base template diff --git a/source/source_pw/module_pwdft/stress_func_kin.cpp b/source/source_pw/module_pwdft/stress_func_kin.cpp index 1336be5c093..83d6617ffe2 100644 --- a/source/source_pw/module_pwdft/stress_func_kin.cpp +++ b/source/source_pw/module_pwdft/stress_func_kin.cpp @@ -1,5 +1,4 @@ #include "stress_func.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_base/timer.h" #include "source_pw/module_pwdft/fs_kin_tools.h" diff --git a/source/source_pw/module_pwdft/stress_func_loc.cpp b/source/source_pw/module_pwdft/stress_func_loc.cpp index fe4d85e1be8..11c414f4dcd 100644 --- a/source/source_pw/module_pwdft/stress_func_loc.cpp +++ b/source/source_pw/module_pwdft/stress_func_loc.cpp @@ -4,23 +4,22 @@ #include "source_base/tool_threading.h" #include "source_base/timer.h" #include "source_base/libm/libm.h" -#include "source_pw/module_pwdft/global.h" //calculate local pseudopotential stress in PW or VL_dVL stress in LCAO template void Stress_Func::stress_loc(const UnitCell& ucell, - ModuleBase::matrix& sigma, - ModulePW::PW_Basis* rho_basis, - const ModuleBase::matrix& vloc, - const Structure_Factor* p_sf, - const bool is_pw, - const Charge* const chr) + ModuleBase::matrix& sigma, + ModulePW::PW_Basis* rho_basis, + const ModuleBase::matrix& vloc, + const Structure_Factor* p_sf, + const bool is_pw, + const Charge* const chr) { - ModuleBase::TITLE("Stress","stress_loc"); - ModuleBase::timer::tick("Stress","stress_loc"); + ModuleBase::TITLE("Stress","stress_loc"); + ModuleBase::timer::tick("Stress","stress_loc"); std::vector dvloc(rho_basis->npw); - FPTYPE evloc=0.0; + FPTYPE evloc=0.0; FPTYPE fact=1.0; const int nspin_rho = (PARAM.inp.nspin == 2) ? 2 : 1; diff --git a/source/source_pw/module_pwdft/stress_func_mgga.cpp b/source/source_pw/module_pwdft/stress_func_mgga.cpp index b2d9ffe841b..35201b51bb6 100644 --- a/source/source_pw/module_pwdft/stress_func_mgga.cpp +++ b/source/source_pw/module_pwdft/stress_func_mgga.cpp @@ -1,7 +1,6 @@ #include "source_base/timer.h" #include "source_hamilt/module_xc/xc_functional.h" #include "source_io/module_parameter/parameter.h" -#include "source_pw/module_pwdft/global.h" #include "stress_func.h" #include diff --git a/source/source_pw/module_pwdft/stress_func_nl.cpp b/source/source_pw/module_pwdft/stress_func_nl.cpp index b5bc6530743..3f825cc6500 100644 --- a/source/source_pw/module_pwdft/stress_func_nl.cpp +++ b/source/source_pw/module_pwdft/stress_func_nl.cpp @@ -5,7 +5,6 @@ #include "source_base/module_device/device.h" #include "source_base/timer.h" #include "source_pw/module_pwdft/fs_nonlocal_tools.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/nonlocal_maths.hpp" #include "stress_func.h" // calculate the nonlocal pseudopotential stress in PW diff --git a/source/source_pw/module_pwdft/stress_pw.cpp b/source/source_pw/module_pwdft/stress_pw.cpp index f79bd6349c7..919d1288bfe 100644 --- a/source/source_pw/module_pwdft/stress_pw.cpp +++ b/source/source_pw/module_pwdft/stress_pw.cpp @@ -2,8 +2,8 @@ #include "source_base/timer.h" #include "source_hamilt/module_vdw/vdw.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/output_log.h" +#include "source_hamilt/module_xc/xc_functional.h" template void Stress_PW::cal_stress(ModuleBase::matrix& sigmatot, diff --git a/source/source_pw/module_pwdft/structure_factor.cpp b/source/source_pw/module_pwdft/structure_factor.cpp index 2823d11e36d..44484f59d2b 100644 --- a/source/source_pw/module_pwdft/structure_factor.cpp +++ b/source/source_pw/module_pwdft/structure_factor.cpp @@ -3,7 +3,6 @@ #include "source_io/module_parameter/parameter.h" #include "structure_factor.h" #include "source_base/constants.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/math_bspline.h" #include "source_base/memory.h" #include "source_base/timer.h" diff --git a/source/source_pw/module_pwdft/structure_factor_k.cpp b/source/source_pw/module_pwdft/structure_factor_k.cpp index ea071cd4094..52dc3265458 100644 --- a/source/source_pw/module_pwdft/structure_factor_k.cpp +++ b/source/source_pw/module_pwdft/structure_factor_k.cpp @@ -1,9 +1,9 @@ #include "source_base/memory.h" #include "source_base/timer.h" -#include "source_pw/module_pwdft/global.h" #include "source_pw/module_pwdft/kernels/wf_op.h" #include "source_base/module_device/device.h" #include "structure_factor.h" + std::complex* Structure_Factor::get_sk(const int ik, const int it, const int ia, @@ -179,4 +179,4 @@ template void Structure_Factor::get_sk(base_dev int, const ModulePW::PW_Basis_K*, std::complex*) const; -#endif \ No newline at end of file +#endif diff --git a/source/source_pw/module_stodft/sto_forces.cpp b/source/source_pw/module_stodft/sto_forces.cpp index 35ed90a80b4..3fb761d85c6 100644 --- a/source/source_pw/module_stodft/sto_forces.cpp +++ b/source/source_pw/module_stodft/sto_forces.cpp @@ -5,7 +5,6 @@ #include "source_estate/elecstate.h" #include "source_estate/module_pot/efield.h" #include "source_estate/module_pot/gatefield.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/output_log.h" #include "source_io/module_parameter/parameter.h" #include "source_pw/module_pwdft/fs_nonlocal_tools.h" diff --git a/source/source_pw/module_stodft/sto_iter.cpp b/source/source_pw/module_stodft/sto_iter.cpp index aa9990a4150..cd00e2f6f23 100644 --- a/source/source_pw/module_stodft/sto_iter.cpp +++ b/source/source_pw/module_stodft/sto_iter.cpp @@ -8,7 +8,6 @@ #include "source_base/tool_title.h" #include "source_estate/kernels/elecstate_op.h" #include "source_estate/occupy.h" -#include "source_pw/module_pwdft/global.h" #include "source_hsolver/para_linear_transform.h" #include "source_io/module_parameter/parameter.h" diff --git a/source/source_pw/module_stodft/sto_stress_pw.cpp b/source/source_pw/module_stodft/sto_stress_pw.cpp index d83bd9d4416..8fbe01dc89e 100644 --- a/source/source_pw/module_stodft/sto_stress_pw.cpp +++ b/source/source_pw/module_stodft/sto_stress_pw.cpp @@ -3,7 +3,6 @@ #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/global.h" #include "source_pw/module_pwdft/structure_factor.h" #include "source_io/output_log.h" #include "source_io/module_parameter/parameter.h" diff --git a/source/source_pw/module_stodft/sto_wf.cpp b/source/source_pw/module_stodft/sto_wf.cpp index e844503a11f..de9a4559e19 100644 --- a/source/source_pw/module_stodft/sto_wf.cpp +++ b/source/source_pw/module_stodft/sto_wf.cpp @@ -1,4 +1,5 @@ #include "sto_wf.h" +#include "source_base/parallel_comm.h" // use POOL_WORLD #include "source_base/memory.h" #include "source_io/module_parameter/parameter.h" @@ -6,10 +7,7 @@ #include #include -//---------Temporary------------------------------------ #include "source_base/global_function.h" -#include "source_pw/module_pwdft/global.h" -//------------------------------------------------------ template Stochastic_WF::Stochastic_WF() diff --git a/source/source_relax/bfgs.cpp b/source/source_relax/bfgs.cpp index d105dc2791f..078a5122f9c 100644 --- a/source/source_relax/bfgs.cpp +++ b/source/source_relax/bfgs.cpp @@ -1,5 +1,4 @@ #include "bfgs.h" -#include "source_pw/module_pwdft/global.h" #include "source_base/module_external/lapack_connector.h" #include "source_io/module_parameter/parameter.h" #include "ions_move_basic.h" diff --git a/source/source_relax/bfgs.h b/source/source_relax/bfgs.h index b8872c979fa..97367ae9f29 100644 --- a/source/source_relax/bfgs.h +++ b/source/source_relax/bfgs.h @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include #include "source_base/matrix.h" #include "source_base/matrix3.h" #include "source_cell/unitcell.h" diff --git a/source/source_relax/lbfgs.cpp b/source/source_relax/lbfgs.cpp index 31eaa2116a2..b347fe86fb8 100644 --- a/source/source_relax/lbfgs.cpp +++ b/source/source_relax/lbfgs.cpp @@ -1,5 +1,4 @@ #include "lbfgs.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "ions_move_basic.h" #include "source_cell/update_cell.h" diff --git a/source/source_relax/line_search.cpp b/source/source_relax/line_search.cpp index bbf308f638e..1c07a59c3d4 100644 --- a/source/source_relax/line_search.cpp +++ b/source/source_relax/line_search.cpp @@ -1,9 +1,10 @@ #include "line_search.h" -#include "source_pw/module_pwdft/global.h" - +#include "source_base/global_function.h" +#include "source_base/global_variable.h" #include #include +#include bool Line_Search::line_search(const bool restart, const double x, // current point @@ -12,9 +13,10 @@ bool Line_Search::line_search(const bool restart, double& xnew, // the next point that we want to try const double conv_thr) { - if (restart) { - ls_step = 0; -} + if (restart) + { + ls_step = 0; + } if (ls_step == 0) // first point: make a trial step into trial direction { @@ -100,10 +102,11 @@ bool Line_Search::third_order(const double x, const double y, const double f, do } dmoveh = -fa / (fab - fa) / 2.0; - if (dmoveh < 0) { + if (dmoveh < 0) + { dmoveh = 4.0; -} - + } + if (dmove > 2.0 * dmoveh || dmoveh > 2.0 * dmove || (fa * fb > 0 && dmove < 1.0) || (fa * fb < 0 && dmove > 1.0)) { @@ -111,15 +114,17 @@ bool Line_Search::third_order(const double x, const double y, const double f, do } } // end anharmonic case - if (dmove > 4.0) { - dmove = 4.0; -} + if (dmove > 4.0) + { + dmove = 4.0; + } xnew = dmove + xa; double dy = (fb + (fab - fb) / (xa - xb) * (dmove - xb)) * (dmove - xb); - if (std::abs(dy) < conv_thr) { + if (std::abs(dy) < conv_thr) + { return true; -} + } ls_step++; return false; @@ -137,9 +142,10 @@ void Line_Search::init_brent(const double x, const double y, const double f) xb = x; yb = y; fb = f; - if (fa * fb > 0) { + if (fa * fb > 0) + { bracked = false; -} + } fstart = fa; } else // x < b @@ -233,9 +239,10 @@ bool Line_Search::brent(const double x, const double y, const double f, double& p = s * (2.0 * xm * qq * (qq - r) - (xb - xa) * (r - 1.0)); qq = (qq - 1.0) * (r - 1.0) * (s - 1.0); } - if (p > 0.0) { + if (p > 0.0) + { qq = -qq; -} + } p = std::abs(p); if (p < std::min(2.0 * (xb - xa) * qq - std::abs(tol1 * qq), std::abs(xe * qq) / 2.0)) @@ -273,9 +280,10 @@ bool Line_Search::brent(const double x, const double y, const double f, double& } xnew = xb; - if (std::abs(dy) < conv_thr) { + if (std::abs(dy) < conv_thr) + { return true; -} + } if (ls_step == 4) // I'm not sure if this is a good choice, but the idea is there should not be so many line // search steps I feel if the line search does not converge, we'd better change the direction // and restart line search @@ -335,9 +343,10 @@ bool Line_Search::brent(const double x, const double y, const double f, double& p = s * (2.0 * xm * qq * (qq - r) - (xb - xa) * (r - 1.0)); qq = (qq - 1.0) * (r - 1.0) * (s - 1.0); } - if (p > 0.0) { + if (p > 0.0) + { qq = -qq; -} + } p = std::abs(p); if (2.0 * p < std::min(3.0 * xm * qq - std::abs(tol1 * qq), std::abs(xe * qq))) @@ -381,9 +390,10 @@ bool Line_Search::brent(const double x, const double y, const double f, double& } xnew = xb; - if (std::abs(dy) < conv_thr) { + if (std::abs(dy) < conv_thr) + { return true; -} + } if (ls_step == 4) { GlobalV::ofs_running << "Too many Brent steps, let's do next CG step" << std::endl; @@ -392,4 +402,4 @@ bool Line_Search::brent(const double x, const double y, const double f, double& } return false; } // end ibrack -} \ No newline at end of file +} diff --git a/source/source_relax/relax_driver.cpp b/source/source_relax/relax_driver.cpp index 9b5217d77c7..434015e5ca5 100644 --- a/source/source_relax/relax_driver.cpp +++ b/source/source_relax/relax_driver.cpp @@ -1,7 +1,6 @@ #include "relax_driver.h" #include "source_base/global_file.h" -#include "source_pw/module_pwdft/global.h" // use chr. #include "source_io/cif_io.h" #include "source_io/json_output/output_info.h" #include "source_io/output_log.h" diff --git a/source/source_relax/relax_sync.cpp b/source/source_relax/relax_sync.cpp index a788af2f684..47f3e3b3332 100644 --- a/source/source_relax/relax_sync.cpp +++ b/source/source_relax/relax_sync.cpp @@ -6,7 +6,6 @@ #include "source_base/tool_title.h" #include "source_cell/update_cell.h" #include "source_cell/print_cell.h" -#include "source_pw/module_pwdft/global.h" #include "source_io/module_parameter/parameter.h" #include "source_relax/ions_move_basic.h"