Skip to content

Commit

Permalink
Refactor: change hsolver-lcao call manner in SpinConstrain (#4946)
Browse files Browse the repository at this point in the history
* change hsolver-lcao call manner in SpinConstrain

* fix build bug
  • Loading branch information
haozhihan authored Aug 11, 2024
1 parent b7ffff7 commit b1b03fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ void SpinConstrain<std::complex<double>, base_device::DEVICE_CPU>::cal_mw_from_l
{
ModuleBase::TITLE("SpinConstrain","cal_mw_from_lambda");
ModuleBase::timer::tick("SpinConstrain", "cal_mw_from_lambda");

// this->phsol->solve(this->p_hamilt, this->psi[0], this->pelec, this->KS_SOLVER, true);

// diagonalization without update charge
this->phsol->solve(this->p_hamilt, this->psi[0], this->pelec, this->KS_SOLVER, true);
hsolver::HSolverLCAO<std::complex<double>> hsolver_lcao_obj(this->ParaV, this->KS_SOLVER);
hsolver_lcao_obj.solve(this->p_hamilt, this->psi[0], this->pelec, this->KS_SOLVER, true);

elecstate::ElecStateLCAO<std::complex<double>>* pelec_lcao
= dynamic_cast<elecstate::ElecStateLCAO<std::complex<double>>*>(this->pelec);
this->pelec->calculate_weights();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "module_cell/klist.h"
#include "module_cell/unitcell.h"
#include "module_hsolver/hsolver.h"
#include "module_hsolver/hsolver_lcao.h"

struct ScAtomData;

Expand Down

0 comments on commit b1b03fe

Please sign in to comment.