Skip to content
Closed
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
8 changes: 1 addition & 7 deletions source/module_esolver/esolver_ks_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,7 @@ void ESolver_KS_PW<T, Device>::before_scf(UnitCell& ucell, const int istep)
this->kspw_psi,
this->p_hamilt,
this->ppcell,
GlobalV::ofs_running,
this->already_initpsi);

if (this->already_initpsi == false)
{
this->already_initpsi = true;
}
GlobalV::ofs_running);
}
}

Expand Down
2 changes: 0 additions & 2 deletions source/module_esolver/esolver_ks_pw.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class ESolver_KS_PW : public ESolver_KS<T, Device>

psi::Psi<std::complex<double>, Device>* __kspw_psi = nullptr;

bool already_initpsi = false;

using castmem_2d_d2h_op
= base_device::memory::cast_memory_op<std::complex<double>, T, base_device::DEVICE_CPU, Device>;

Expand Down
24 changes: 0 additions & 24 deletions source/module_hsolver/hsolver_pw_sdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,6 @@ void HSolverPW_SDFT<T, Device>::solve(hamilt::Hamilt<T, Device>* pHamilt,
const int nbands = psi.get_nbands();
const int nks = psi.get_nk();

//---------------------------------------------------------------------------------------------------------------
//---------------------------------for psi init guess!!!!--------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
// if (!PARAM.inp.psi_initializer && !this->initialed_psi && this->basis_type == "pw")
// {
// for (int ik = 0; ik < nks; ++ik)
// {
// /// update H(k) for each k point
// pHamilt->updateHk(ik);

// if (nbands > 0 && GlobalV::MY_STOGROUP == 0)
// {
// /// update psi pointer for each k point
// psi.fix_k(ik);

// /// for psi init guess!!!!
// hamilt::diago_PAO_in_pw_k2(this->ctx, ik, psi, this->wfc_basis, this->pwf, pHamilt);
// }
// }
// }
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------

// prepare for the precondition of diagonalization
std::vector<double> precondition(psi.get_nbasis(), 0.0);

Expand Down
6 changes: 2 additions & 4 deletions source/module_psi/psi_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ void PSIInit<T, Device>::initialize_psi(Psi<std::complex<double>>* psi,
psi::Psi<T, Device>* kspw_psi,
hamilt::Hamilt<T, Device>* p_hamilt,
const pseudopot_cell_vnl& nlpp,
std::ofstream& ofs_running,
const bool is_already_initpsi)
std::ofstream& ofs_running)
{
ModuleBase::timer::tick("PSIInit", "initialize_psi");

Expand Down Expand Up @@ -255,8 +254,7 @@ void PSIInit<T, Device>::initialize_psi(Psi<std::complex<double>>* psi,
}
else
{
//! note: is_already_initpsi will be false in init_after_vc when vc changes.
if (PARAM.inp.basis_type == "pw" && is_already_initpsi == false)
if (PARAM.inp.basis_type == "pw")
{
for (int ik = 0; ik < this->pw_wfc->nks; ++ik)
{
Expand Down
4 changes: 1 addition & 3 deletions source/module_psi/psi_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ class PSIInit
* @param psi store the wavefunction
* @param p_hamilt Hamiltonian operator
* @param ofs_running output stream for running information
* @param is_already_initpsi whether psi has been initialized
*/
void initialize_psi(Psi<std::complex<double>>* psi,
psi::Psi<T, Device>* kspw_psi,
hamilt::Hamilt<T, Device>* p_hamilt,
const pseudopot_cell_vnl& nlpp,
std::ofstream& ofs_running,
const bool is_already_initpsi);
std::ofstream& ofs_running);

/**
* @brief get the psi_initializer
Expand Down
Loading
Loading