Skip to content

Commit 979be57

Browse files
committed
make new gint module the default compilation option
1 parent 2071666 commit 979be57

File tree

21 files changed

+57
-57
lines changed

21 files changed

+57
-57
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ if(ENABLE_LCAO)
252252
add_compile_definitions(__PEXSI)
253253
set(CMAKE_CXX_STANDARD 14)
254254
endif()
255-
if(NEW_GINT)
256-
add_compile_definitions(__NEW_GINT)
255+
if(OLD_GINT)
256+
add_compile_definitions(__OLD_GINT)
257257
endif()
258258
else()
259259
set(ENABLE_MLALGO OFF)

source/module_elecstate/elecstate_lcao.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void ElecStateLCAO<std::complex<double>>::psiToRho(const psi::Psi<std::complex<d
3434
//------------------------------------------------------------
3535

3636
ModuleBase::GlobalFunc::NOTE("Calculate the charge on real space grid!");
37-
#ifndef __NEW_GINT
37+
#ifdef __OLD_GINT
3838
this->gint_k->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint
3939
Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin);
4040
this->gint_k->cal_gint(&inout);
@@ -71,7 +71,7 @@ void ElecStateLCAO<double>::psiToRho(const psi::Psi<double>& psi)
7171
//------------------------------------------------------------
7272
ModuleBase::GlobalFunc::NOTE("Calculate the charge on real space grid!");
7373

74-
#ifndef __NEW_GINT
74+
#ifdef __OLD_GINT
7575
this->gint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint
7676
Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin);
7777
this->gint_gamma->cal_gint(&inout);
@@ -139,7 +139,7 @@ void ElecStateLCAO<double>::dmToRho(std::vector<double*> pexsi_DM, std::vector<d
139139
}
140140

141141
ModuleBase::GlobalFunc::NOTE("Calculate the charge on real space grid!");
142-
#ifndef __NEW_GINT
142+
#ifdef __OLD_GINT
143143
this->gint_gamma->transfer_DM2DtoGrid(this->DM->get_DMR_vector()); // transfer DM2D to DM_grid in gint
144144
Gint_inout inout(this->charge->rho, Gint_Tools::job_type::rho, PARAM.inp.nspin);
145145
this->gint_gamma->cal_gint(&inout);
@@ -152,7 +152,7 @@ void ElecStateLCAO<double>::dmToRho(std::vector<double*> pexsi_DM, std::vector<d
152152
{
153153
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[0], this->charge->nrxx);
154154
}
155-
#ifndef __NEW_GINT
155+
#ifdef __OLD_GINT
156156
Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau);
157157
this->gint_gamma->cal_gint(&inout1);
158158
#else

source/module_elecstate/elecstate_lcao_cal_tau.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void ElecStateLCAO<std::complex<double>>::cal_tau(const psi::Psi<std::complex<do
1616
{
1717
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx);
1818
}
19-
#ifndef __NEW_GINT
19+
#ifdef __OLD_GINT
2020
Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin);
2121
this->gint_k->cal_gint(&inout1);
2222
#else
@@ -36,7 +36,7 @@ void ElecStateLCAO<double>::cal_tau(const psi::Psi<double>& psi)
3636
{
3737
ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx);
3838
}
39-
#ifndef __NEW_GINT
39+
#ifdef __OLD_GINT
4040
Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau, PARAM.inp.nspin);
4141
this->gint_gamma->cal_gint(&inout1);
4242
#else

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ESolver_KS_LCAO<TK, TR>::ESolver_KS_LCAO()
9494
template <typename TK, typename TR>
9595
ESolver_KS_LCAO<TK, TR>::~ESolver_KS_LCAO()
9696
{
97-
#ifdef __NEW_GINT
97+
#ifndef __OLD_GINT
9898
// release gint_info
9999
ModuleGint::Gint::set_gint_info(nullptr);
100100
#endif

source/module_esolver/lcao_before_scf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
6060
PARAM.inp.test_atom_input);
6161

6262
//! 4) initialize NAO basis set
63-
#ifndef __NEW_GINT
63+
#ifdef __OLD_GINT
6464
double dr_uniform = 0.001;
6565
std::vector<double> rcuts;
6666
std::vector<std::vector<double>> psi_u;

source/module_esolver/lcao_others.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
9393
PARAM.inp.test_atom_input);
9494

9595
// (3) Periodic condition search for each grid.
96-
#ifndef __NEW_GINT
96+
#ifdef __OLD_GINT
9797
double dr_uniform = 0.001;
9898
std::vector<double> rcuts;
9999
std::vector<std::vector<double>> psi_u;

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void Veff<OperatorLCAO<double, double>>::contributeHR()
6868
double* vr_eff1 = this->pot->get_effective_v(this->current_spin);
6969
double* vofk_eff1 = this->pot->get_effective_vofk(this->current_spin);
7070

71-
#ifndef __NEW_GINT
71+
#ifdef __OLD_GINT
7272
if(XC_Functional::get_ked_flag())
7373
{
7474
Gint_inout inout(vr_eff1, vofk_eff1, Gint_Tools::job_type::vlocal_meta);
@@ -113,7 +113,7 @@ void Veff<OperatorLCAO<std::complex<double>, double>>::contributeHR()
113113
double* vr_eff1 = this->pot->get_effective_v(this->current_spin);
114114
double* vofk_eff1 = this->pot->get_effective_vofk(this->current_spin);
115115

116-
#ifndef __NEW_GINT
116+
#ifdef __OLD_GINT
117117
// if you change the place of the following code,
118118
// rememeber to delete the #include
119119
if(XC_Functional::get_ked_flag())
@@ -155,7 +155,7 @@ void Veff<OperatorLCAO<std::complex<double>, std::complex<double>>>::contributeH
155155
ModuleBase::TITLE("Veff", "contributeHR");
156156
ModuleBase::timer::tick("Veff", "contributeHR");
157157

158-
#ifndef __NEW_GINT
158+
#ifdef __OLD_GINT
159159
double* vr_eff1 = nullptr;
160160
double* vofk_eff1 = nullptr;
161161
for (int is = 0; is < 4; is++)

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Veff<OperatorLCAO<TK, TR>> : public OperatorLCAO<TK, TR>
5050
this->cal_type = calculation_type::lcao_gint;
5151

5252
this->initialize_HR(ucell_in, GridD_in);
53-
#ifndef __NEW_GINT
53+
#ifdef __OLD_GINT
5454
GK_in->initialize_pvpR(*ucell_in, GridD_in, nspin);
5555
#endif
5656
}
@@ -71,7 +71,7 @@ class Veff<OperatorLCAO<TK, TR>> : public OperatorLCAO<TK, TR>
7171
{
7272
this->cal_type = calculation_type::lcao_gint;
7373
this->initialize_HR(ucell_in, GridD_in);
74-
#ifndef __NEW_GINT
74+
#ifdef __OLD_GINT
7575
GG_in->initialize_pvpR(*ucell_in, GridD_in, nspin);
7676
#endif
7777
}

source/module_hamilt_lcao/hamilt_lcaodft/pulay_force_stress_gint.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace PulayForceStress
2020
{
2121
const int nspin = PARAM.inp.nspin;
2222

23-
#ifndef __NEW_GINT
23+
#ifdef __OLD_GINT
2424
if (set_dmr_gint) { gint.transfer_DM2DtoGrid(dm.get_DMR_vector()); } // 2d block to grid
2525
for (int is = 0; is < nspin; ++is)
2626
{

source/module_hamilt_lcao/hamilt_lcaodft/spar_dh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void sparse_format::cal_dH(const UnitCell& ucell,
109109

110110
if(PARAM.inp.nspin==2)
111111
{
112-
#ifndef __NEW_GINT
112+
#ifdef __OLD_GINT
113113
gint_k.allocate_pvdpR();
114114
// note: some MPI process will not have grids when MPI cores are too
115115
// many, v_eff in these processes are empty

0 commit comments

Comments
 (0)