Skip to content

Commit fe1afcb

Browse files
committed
Fix bug for compling without DeePKS.
1 parent 0574fd4 commit fe1afcb

File tree

8 files changed

+24
-11
lines changed

8 files changed

+24
-11
lines changed

source/module_esolver/lcao_before_scf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
193193
this->kv,
194194
two_center_bundle_,
195195
orb_,
196-
DM,
196+
DM
197197
#ifdef __DEEPKS
198+
,
198199
&this->ld
199200
#endif
200201
#ifdef __EXX

source/module_esolver/lcao_others.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
199199
this->kv,
200200
two_center_bundle_,
201201
orb_,
202-
DM,
202+
DM
203203
#ifdef __DEEPKS
204+
,
204205
&this->ld
205206
#endif
206207
#ifdef __EXX

source/module_hamilt_lcao/hamilt_lcaodft/LCAO_allocate.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace LCAO_domain
88
{
9+
#ifdef __DEEPKS
910
// It seems it is only related to DeePKS, so maybe we should move it to DeeKS_domain
1011
void DeePKS_init(const UnitCell& ucell,
1112
Parallel_Orbitals& pv,
@@ -14,7 +15,6 @@ void DeePKS_init(const UnitCell& ucell,
1415
LCAO_Deepks& ld)
1516
{
1617
ModuleBase::TITLE("LCAO_domain", "DeePKS_init");
17-
#ifdef __DEEPKS
1818
// preparation for DeePKS
1919
if (PARAM.inp.deepks_out_labels || PARAM.inp.deepks_scf)
2020
{
@@ -33,8 +33,7 @@ void DeePKS_init(const UnitCell& ucell,
3333
ld.allocate_V_delta(ucell.nat, nks);
3434
}
3535
}
36-
#endif
3736
return;
3837
}
39-
38+
#endif
4039
} // namespace LCAO_domain

source/module_hamilt_lcao/hamilt_lcaodft/LCAO_domain.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,13 @@ void build_ST_new(ForceStressArrays& fsr,
174174
*/
175175
void zeros_HSR(const char& mtype, LCAO_HS_Arrays& HS_arrays);
176176

177+
#ifdef __DEEPKS
177178
void DeePKS_init(const UnitCell& ucell,
178179
Parallel_Orbitals& pv,
179180
const int& nks,
180181
const LCAO_Orbitals& orb,
181182
LCAO_Deepks& ld);
183+
#endif
182184

183185
template <typename T>
184186
void set_mat2d(const int& global_ir, const int& global_ic, const T& v, const Parallel_Orbitals& pv, T* mat);

source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
8080
const K_Vectors& kv_in,
8181
const TwoCenterBundle& two_center_bundle,
8282
const LCAO_Orbitals& orb,
83-
elecstate::DensityMatrix<TK, double>* DM_in,
83+
elecstate::DensityMatrix<TK, double>* DM_in
8484
#ifdef __DEEPKS
85+
,
8586
LCAO_Deepks* ld_in
8687
#endif
8788
#ifdef __EXX

source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ class HamiltLCAO : public Hamilt<TK>
3939
const K_Vectors& kv_in,
4040
const TwoCenterBundle& two_center_bundle,
4141
const LCAO_Orbitals& orb,
42-
elecstate::DensityMatrix<TK, double>* DM_in,
42+
elecstate::DensityMatrix<TK, double>* DM_in
4343
#ifdef __DEEPKS
44+
,
4445
LCAO_Deepks* ld_in
4546
#endif
4647
#ifdef __EXX

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ DeePKS<OperatorLCAO<TK, TR>>::DeePKS(HS_Matrix_K<TK>* hsk_in,
2222
const TwoCenterIntegrator* intor_orb_alpha,
2323
const LCAO_Orbitals* ptr_orb,
2424
const int& nks_in,
25-
elecstate::DensityMatrix<TK, double>* DM_in,
26-
LCAO_Deepks* ld_in)
25+
elecstate::DensityMatrix<TK, double>* DM_in
26+
#ifdef __DEEPKS
27+
,
28+
LCAO_Deepks* ld_in
29+
#endif
30+
)
2731
: OperatorLCAO<TK, TR>(hsk_in, kvec_d_in, hR_in), DM(DM_in), ucell(ucell_in), intor_orb_alpha_(intor_orb_alpha),
2832
ptr_orb_(ptr_orb), nks(nks_in)
2933
{

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ class DeePKS<OperatorLCAO<TK, TR>> : public OperatorLCAO<TK, TR>
3838
const TwoCenterIntegrator* intor_orb_alpha,
3939
const LCAO_Orbitals* ptr_orb,
4040
const int& nks_in,
41-
elecstate::DensityMatrix<TK, double>* DM_in,
42-
LCAO_Deepks* ld_in);
41+
elecstate::DensityMatrix<TK, double>* DM_in
42+
#ifdef __DEEPKS
43+
,
44+
LCAO_Deepks* ld_in
45+
#endif
46+
);
4347
~DeePKS();
4448

4549
/**

0 commit comments

Comments
 (0)