Skip to content

Commit e7b7a34

Browse files
authored
fix: force can only be computed once in lcao MD/relax (#1005)
1 parent 31eddbf commit e7b7a34

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,13 @@ namespace ModuleESolver
150150

151151
void ESolver_KS_LCAO::cal_Force(ModuleBase::matrix& force)
152152
{
153-
if (!this->have_force)
154-
{
155-
Force_Stress_LCAO FSL(this->RA);
156-
FSL.getForceStress(GlobalV::CAL_FORCE, GlobalV::CAL_STRESS,
153+
Force_Stress_LCAO FSL(this->RA);
154+
FSL.getForceStress(GlobalV::CAL_FORCE, GlobalV::CAL_STRESS,
157155
GlobalV::TEST_FORCE, GlobalV::TEST_STRESS,
158156
this->LOC, this->LOWF, this->UHM, force, this->scs);
159-
//delete RA after cal_Force
160-
this->RA.delete_grid();
161-
this->have_force = true;
162-
}
157+
//delete RA after cal_Force
158+
this->RA.delete_grid();
159+
this->have_force = true;
163160
}
164161

165162
void ESolver_KS_LCAO::cal_Stress(ModuleBase::matrix& stress)

0 commit comments

Comments
 (0)