Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: move GlobalC::GridD from global_fp.h to sltk_grid_driver.h #2584

Merged
merged 10 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ OBJS_LCAO=DM_gamma.o\
center2_orb-orb11.o\
center2_orb-orb21.o\
center2_orb-orb22.o\
global_fp.o\
local_orbital_charge.o\
local_orbital_wfc.o\
record_adj.o\
Expand Down
3 changes: 0 additions & 3 deletions source/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#include "module_io/input.h"
#include "module_io/input_conv.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#ifdef __LCAO
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#endif
#include "module_base/memory.h"
#include "module_base/timer.h"
#include "module_esolver/esolver.h"
Expand Down
5 changes: 5 additions & 0 deletions source/module_cell/module_neighbor/sltk_grid_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#include <omp.h>
#endif

namespace GlobalC
{
Grid_Driver GridD(GlobalV::test_deconstructor, GlobalV::test_grid_driver, GlobalV::test_grid);
}

Grid_Driver::Grid_Driver(
const int &test_d_in,
const int &test_gd_in,
Expand Down
4 changes: 4 additions & 0 deletions source/module_cell/module_neighbor/sltk_grid_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,8 @@ class Grid_Driver : public Grid
)const;
};

namespace GlobalC
{
extern Grid_Driver GridD;
}
#endif
1 change: 0 additions & 1 deletion source/module_elecstate/elecstate_exx.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"

namespace elecstate
{
Expand Down
2 changes: 1 addition & 1 deletion source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

//--------------temporary----------------------------
#include "module_base/global_function.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_elecstate/module_charge/symmetry_rho.h"
#include "module_elecstate/occupy.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_lcao/module_dftu/dftu.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_io/print_info.h"
Expand Down
13 changes: 6 additions & 7 deletions source/module_esolver/esolver_ks_lcao_elec.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#include "module_esolver/esolver_ks_lcao.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_elecstate/module_charge/symmetry_rho.h"
#include "module_esolver/esolver_ks_lcao.h"
#include "module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h"
#include "module_hamilt_lcao/module_dftu/dftu.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
//
#include "module_base/timer.h"
#include "module_cell/module_neighbor/sltk_atom_arrange.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_io/berryphase.h"
#include "module_io/istate_charge.h"
#include "module_io/istate_envelope.h"
#include "module_io/write_HS_R.h"

#include "module_io/berryphase.h"
#include "module_io/to_wannier90.h"
#include "module_base/timer.h"
#include "module_io/write_HS_R.h"
#ifdef __DEEPKS
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h"
#endif
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ if(ENABLE_LCAO)
center2_orb-orb22.cpp
DM_gamma.cpp
DM_k.cpp
global_fp.cpp
local_orbital_charge.cpp
local_orbital_wfc.cpp
dm_2d.cpp
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "FORCE_STRESS.h"

#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_lcao/module_dftu/dftu.h" //Quxin add for DFT+U on 20201029
#include "module_hamilt_pw/hamilt_pwdft/global.h"
// new
#include "module_base/timer.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_elecstate/potentials/efield.h" // liuyu add 2022-05-18
#include "module_elecstate/potentials/gatefield.h" // liuyu add 2022-09-13
#include "module_hamilt_general/module_surchem/surchem.h" //sunml add 2022-08-10
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "module_base/memory.h"
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#ifdef __DEEPKS
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" //caoyu add for deepks on 20210813
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "FORCE_gamma.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include <unordered_map>
#include "module_base/timer.h"

Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "module_base/timer.h"
#include "module_base/parallel_reduce.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_elecstate/cal_dm.h"
#include "module_base/tool_threading.h"
#include "module_io/write_HS.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "LCAO_gen_fixedH.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_pw/hamilt_pwdft/wavefunc.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include <vector>
#include <unordered_map>
#include <map>
Expand Down
9 changes: 5 additions & 4 deletions source/module_hamilt_lcao/hamilt_lcaodft/LCAO_hamilt.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "LCAO_hamilt.h"
#include "module_cell/module_neighbor/sltk_atom_arrange.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30
#include "module_hamilt_lcao/module_dftu/dftu.h"

#include "module_base/parallel_reduce.h"
#include "module_cell/module_neighbor/sltk_atom_arrange.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_hamilt_lcao/module_dftu/dftu.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#ifdef __DEEPKS
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h" //caoyu add 2021-07-26
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "LCAO_matrix.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_base/tool_threading.h"
#ifdef __DEEPKS
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/LCAO_nnr.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "record_adj.h" //mohan add 2012-07-06
#include "module_base/timer.h"
#include "module_base/tool_threading.h"
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/dm_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "module_base/blas_connector.h"
#include "module_base/scalapack_connector.h"
#include "module_base/timer.h"
#include "global_fp.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

#include "module_hamilt_lcao/hamilt_lcaodft/local_orbital_charge.h"
Expand Down
7 changes: 0 additions & 7 deletions source/module_hamilt_lcao/hamilt_lcaodft/global_fp.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions source/module_hamilt_lcao/hamilt_lcaodft/global_fp.h

This file was deleted.

1 change: 0 additions & 1 deletion source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "module_base/global_variable.h"
#include "module_base/timer.h"
#include "module_hamilt_lcao/module_dftu/dftu.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#ifdef __DEEPKS
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "module_base/memory.h"
#include "module_base/timer.h"

#include "global_fp.h" // mohan add 2021-01-30

Local_Orbital_wfc::Local_Orbital_wfc()
{
allocate_flag = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "module_hamilt_lcao/module_deepks/LCAO_deepks.h"
#endif
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"

namespace hamilt
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "module_base/timer.h"
#include "module_base/tool_title.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_ri/RI_2D_Comm.h"

Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/hamilt_lcaodft/record_adj.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "record_adj.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"

#include "module_base/timer.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
Record_adj::Record_adj() : iat2ca(nullptr) {}
Record_adj::~Record_adj(){
if(info_modified)
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#ifdef __DEEPKS

#include "LCAO_deepks.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

namespace GlobalC
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/module_dftu/dftu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "module_base/memory.h"
#include "module_base/timer.h"
#include "module_basis/module_ao/ORB_gen_tables.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_elecstate/module_charge/charge.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_elecstate/magnetism.h"
Expand Down
2 changes: 1 addition & 1 deletion source/module_hamilt_lcao/module_dftu/dftu_folding.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "dftu.h"
#include "module_base/timer.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"

namespace ModuleDFTU
{
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/module_dftu/dftu_force.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "module_elecstate/magnetism.h"
#include "module_elecstate/module_charge/charge.h"
#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

extern "C"
Expand Down
1 change: 0 additions & 1 deletion source/module_hamilt_lcao/module_dftu/dftu_yukawa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "module_base/global_function.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/LCAO_matrix.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h"
#include "dftu.h"

#include <cmath>
Expand Down
6 changes: 2 additions & 4 deletions source/module_hamilt_lcao/module_gint/gint_fvl.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include "gint_k.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30

#include "module_base/ylm.h"
#include "module_base/timer.h"
#include "module_base/ylm.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

void Gint::gint_kernel_force(
const int na_grid,
Expand Down
7 changes: 3 additions & 4 deletions source/module_hamilt_lcao/module_gint/gint_gamma_vl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
#include "gint_gamma.h"
#include "gint_tools.h"
#include "grid_technique.h"
#include "module_basis/module_ao/ORB_read.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_base/blas_connector.h"
#include "module_base/memory.h"
#include "module_base/timer.h"

#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30
#include "module_basis/module_ao/ORB_read.h"
#include "module_hamilt_lcao/hamilt_lcaodft/local_orbital_wfc.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

#ifdef _OPENMP
#include <omp.h>
Expand Down
13 changes: 6 additions & 7 deletions source/module_hamilt_lcao/module_gint/gint_k_pvdpr.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "module_base/parallel_reduce.h"
#include "gint_k.h"
#include "module_basis/module_ao/ORB_read.h"
#include "grid_technique.h"
#include "module_base/ylm.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "module_base/memory.h"
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_base/tool_threading.h"
#include "module_base/ylm.h"
#include "module_basis/module_ao/ORB_read.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

void Gint_k::allocate_pvdpR(void)
{
Expand Down
16 changes: 8 additions & 8 deletions source/module_hamilt_lcao/module_gint/gint_k_pvpr.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "module_base/parallel_reduce.h"
#include "gint_k.h"
#include "module_basis/module_ao/ORB_read.h"
#include "grid_technique.h"
#include "module_base/ylm.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "module_base/libm/libm.h"
#include "module_base/memory.h"
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_base/tool_threading.h"
#include "module_base/libm/libm.h"
#include "module_base/ylm.h"
#include "module_basis/module_ao/ORB_read.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"

void Gint_k::allocate_pvpR(void)
{
Expand Down
12 changes: 6 additions & 6 deletions source/module_hamilt_lcao/module_gint/gint_k_sparse.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "gint_k.h"
#include "grid_technique.h"
#include "module_base/global_function.h"
#include "module_base/global_variable.h"
#include "module_base/memory.h"
#include "module_base/parallel_reduce.h"
#include "gint_k.h"
#include "module_basis/module_ao/ORB_read.h"
#include "grid_technique.h"
#include "module_base/timer.h"
#include "module_base/ylm.h"
#include "module_basis/module_ao/ORB_read.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
#include "module_hamilt_pw/hamilt_pwdft/global.h"
#include "module_hamilt_lcao/hamilt_lcaodft/global_fp.h" // mohan add 2021-01-30
#include "module_base/memory.h"
#include "module_base/timer.h"

void Gint_k::distribute_pvpR_sparseMatrix(
const int current_spin,
Expand Down
Loading