Skip to content

Commit ff93214

Browse files
committed
Unified make_table operation in PSIInit
1 parent 7198ec1 commit ff93214

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

source/module_hsolver/hsolver_pw_sdft.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,6 @@ void HSolverPW_SDFT<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
2828
const int nbands = psi.get_nbands();
2929
const int nks = psi.get_nk();
3030

31-
//---------------------------------------------------------------------------------------------------------------
32-
//---------------------------------for psi init guess!!!!--------------------------------------------------------
33-
//---------------------------------------------------------------------------------------------------------------
34-
// if (!PARAM.inp.psi_initializer && !this->initialed_psi && this->basis_type == "pw")
35-
// {
36-
// for (int ik = 0; ik < nks; ++ik)
37-
// {
38-
// /// update H(k) for each k point
39-
// pHamilt->updateHk(ik);
40-
41-
// if (nbands > 0 && GlobalV::MY_STOGROUP == 0)
42-
// {
43-
// /// update psi pointer for each k point
44-
// psi.fix_k(ik);
45-
46-
// /// for psi init guess!!!!
47-
// hamilt::diago_PAO_in_pw_k2(this->ctx, ik, psi, this->wfc_basis, this->pwf, pHamilt);
48-
// }
49-
// }
50-
// }
51-
//---------------------------------------------------------------------------------------------------------------
52-
//---------------------------------------------------------------------------------------------------------------
53-
//---------------------------------------------------------------------------------------------------------------
54-
5531
// prepare for the precondition of diagonalization
5632
std::vector<double> precondition(psi.get_nbasis(), 0.0);
5733

source/module_psi/psi_init.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ void PSIInit<T, Device>::prepare_init(Structure_Factor* p_sf,
8181
this->psi_init->initialize(p_sf, pw_wfc, p_ucell, random_seed, p_ppcell);
8282
#endif
8383

84+
85+
8486
// always new->initialize->tabulate->allocate->proj_ao_onkG
85-
this->psi_init->tabulate();
87+
// this->psi_init->tabulate();
88+
89+
8690
ModuleBase::timer::tick("PSIInit", "prepare_init");
8791
}
8892

@@ -138,7 +142,10 @@ void PSIInit<T, Device>::make_table(const int nks, Structure_Factor* p_sf)
138142
{
139143
if (this->use_psiinitializer)
140144
{
141-
} // do not need to do anything because the interpolate table is unchanged
145+
// do not need to do anything because the interpolate table is unchanged
146+
// what ???
147+
this->psi_init->tabulate();
148+
}
142149
else // old initialization method, used in EXX calculation
143150
{
144151
this->wf_old.init_after_vc(nks); // reallocate wanf2, the planewave expansion of lcao

source/module_psi/wf_atomic.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ void WF_atomic::init_at_1(Structure_Factor *sf_in)
9191
int nmesh;
9292
if(PARAM.inp.pseudo_mesh) {
9393
nmesh = atom->ncpp.mesh;
94-
} else {
94+
}
95+
else
96+
{
9597
nmesh = atom->ncpp.msh;
96-
}
98+
}
9799

98100
// check the unit condition
99101
double *inner_part = new double[nmesh];

0 commit comments

Comments
 (0)