Skip to content

Commit f48d076

Browse files
committed
fix compile
1 parent cbc5a99 commit f48d076

File tree

12 files changed

+109
-404
lines changed

12 files changed

+109
-404
lines changed

source/module_esolver/esolver_ks_lcaopw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace ModuleESolver
106106
this->exx_lip = std::unique_ptr<Exx_Lip<T>>(new Exx_Lip<T>(GlobalC::exx_info.info_lip,
107107
ucell.symm,
108108
&this->kv,
109-
this->p_psi_init,
109+
this->psi_local,
110110
this->kspw_psi,
111111
this->pw_wfc,
112112
this->pw_rho,

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -386,27 +386,11 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
386386
auto* dftu = ModuleDFTU::DFTU::get_instance();
387387
dftu->init(ucell, nullptr, this->kv.get_nks());
388388
}
389-
// after init_rho (in pelec->init_scf), we have rho now.
390-
// before hamilt2density, we update Hk and initialize psi
391-
392-
// before_scf function will be called everytime before scf. However, once
393-
// atomic coordinates changed, structure factor will change, therefore all
394-
// atomwise properties will change. So we need to reinitialize psi every
395-
// time before scf. But for random wavefunction, we dont, because random
396-
// wavefunction is not related to atomic coordinates. What the old strategy
397-
// does is only to initialize for once...
398-
if (((PARAM.inp.init_wfc == "random") && (istep == 0)) || (PARAM.inp.init_wfc != "random"))
399-
{
400-
this->p_psi_init->initialize_psi(this->psi,
401-
this->kspw_psi,
402-
this->p_hamilt,
403-
GlobalV::ofs_running,
404-
this->already_initpsi);
405-
406-
if (this->already_initpsi == false)
407-
{
408-
this->already_initpsi = true;
409-
}
389+
390+
if (!this->already_initpsi)
391+
{
392+
this->p_psi_init->initialize_psi(this->psi, this->kspw_psi, this->p_hamilt, GlobalV::ofs_running);
393+
this->already_initpsi = true;
410394
}
411395

412396
ModuleBase::timer::tick("ESolver_KS_PW", "before_scf");

source/module_hsolver/test/hsolver_pw_sup.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -180,39 +180,3 @@ template class DiagoIterAssist<std::complex<float>, base_device::DEVICE_CPU>;
180180
template class DiagoIterAssist<std::complex<double>, base_device::DEVICE_CPU>;
181181

182182
} // namespace hsolver
183-
184-
namespace hamilt {
185-
186-
template <>
187-
void diago_PAO_in_pw_k2(
188-
const base_device::DEVICE_CPU* ctx,
189-
const int& ik,
190-
psi::Psi<std::complex<float>, base_device::DEVICE_CPU>& wvf,
191-
ModulePW::PW_Basis_K* wfc_basis,
192-
wavefunc* p_wf,
193-
const ModuleBase::realArray& tab_at,
194-
const int& lmaxkb,
195-
const UnitCell& ucell,
196-
hamilt::Hamilt<std::complex<float>, base_device::DEVICE_CPU>* phm_in) {
197-
for (int i = 0; i < wvf.size(); i++) {
198-
wvf.get_pointer()[i] = std::complex<float>((float)i + 1, 0);
199-
}
200-
}
201-
202-
template <>
203-
void diago_PAO_in_pw_k2(
204-
const base_device::DEVICE_CPU* ctx,
205-
const int& ik,
206-
psi::Psi<std::complex<double>, base_device::DEVICE_CPU>& wvf,
207-
ModulePW::PW_Basis_K* wfc_basis,
208-
wavefunc* p_wf,
209-
const ModuleBase::realArray& tab_at,
210-
const int& lmaxkb,
211-
const UnitCell& ucell,
212-
hamilt::Hamilt<std::complex<double>, base_device::DEVICE_CPU>* phm_in) {
213-
for (int i = 0; i < wvf.size(); i++) {
214-
wvf.get_pointer()[i] = std::complex<double>((double)i + 1, 0);
215-
}
216-
}
217-
218-
}//namespace hsolver

source/module_hsolver/test/hsolver_supplementary_mock.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,3 @@ K_Vectors::K_Vectors()
152152
K_Vectors::~K_Vectors()
153153
{
154154
}
155-
WF_atomic::WF_atomic()
156-
{
157-
}
158-
WF_atomic::~WF_atomic()
159-
{
160-
}

source/module_hsolver/test/test_hsolver_sdft.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ void Stochastic_Iter<T, Device>::cal_storho(const UnitCell& ucell,
130130
}
131131
template class Stochastic_Iter<std::complex<double>, base_device::DEVICE_CPU>;
132132

133-
template class Stochastic_Iter<std::complex<double>, base_device::DEVICE_CPU>;
134-
135133
Charge::Charge(){};
136134
Charge::~Charge(){};
137135

@@ -157,7 +155,6 @@ class TestHSolverPW_SDFT : public ::testing::Test
157155
ModulePW::PW_Basis_K pwbk;
158156
Stochastic_WF<std::complex<double>> stowf;
159157
K_Vectors kv;
160-
wavefunc wf;
161158
StoChe<double> stoche;
162159
hamilt::HamiltSdftPW<std::complex<double>>* p_hamilt_sto = nullptr;
163160
hsolver::HSolverPW_SDFT<std::complex<double>, base_device::DEVICE_CPU> hs_d

source/module_io/test/for_testing_input_conv.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ Structure_Factor::Structure_Factor()
165165
Structure_Factor::~Structure_Factor()
166166
{
167167
}
168-
WF_atomic::WF_atomic()
169-
{
170-
}
171-
WF_atomic::~WF_atomic()
172-
{
173-
}
174-
wavefunc::wavefunc()
175-
{
176-
}
177-
wavefunc::~wavefunc()
178-
{
179-
}
180168
UnitCell::UnitCell()
181169
{
182170
itia2iat.create(1, 1);

source/module_psi/psi_init.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,12 @@ template <typename T, typename Device>
8484
void PSIInit<T, Device>::initialize_psi(Psi<std::complex<double>>* psi,
8585
psi::Psi<T, Device>* kspw_psi,
8686
hamilt::Hamilt<T, Device>* p_hamilt,
87-
std::ofstream& ofs_running,
88-
const bool is_already_initpsi)
87+
std::ofstream& ofs_running)
8988
{
9089
if (kspw_psi->get_nbands() == 0 || GlobalV::MY_STOGROUP != 0)
9190
{
9291
return;
9392
}
94-
if (is_already_initpsi)
95-
{
96-
return;
97-
}
9893
if (this->basis_type == "lcao_in_pw")
9994
{
10095
return;

source/module_psi/psi_init.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ class PSIInit
3737
void initialize_psi(Psi<std::complex<double>>* psi,
3838
psi::Psi<T, Device>* kspw_psi,
3939
hamilt::Hamilt<T, Device>* p_hamilt,
40-
std::ofstream& ofs_running,
41-
const bool is_already_initpsi);
40+
std::ofstream& ofs_running);
4241

4342
/**
4443
* @brief initialize NAOs in plane wave basis, only for LCAO_IN_PW

source/module_psi/test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ AddTest(
1717
../../module_cell/parallel_kpoints.cpp
1818
../../module_cell/test/support/mock_unitcell.cpp
1919
../../module_io/orb_io.cpp
20+
../../module_io/write_pao.cpp
21+
../../module_io/read_wfc_pw.cpp
22+
../../module_io/binstream.cpp
2023
)
2124
endif()
2225

0 commit comments

Comments
 (0)