Skip to content

Commit 6cff14f

Browse files
authored
Merge pull request #82 from dyzheng/develop
merge deepmodeling/ABACUS_2.2.0_beta to develop branch
2 parents c525e72 + 5a6bcdd commit 6cff14f

File tree

8 files changed

+543
-538
lines changed

8 files changed

+543
-538
lines changed

source/src_ions/ions.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ void Ions::opt_ions_pw(void)
183183
elec_sto.scf_stochastic(istep-1);
184184
eiter = elec_sto.iter;
185185
}
186-
187-
188-
if(GlobalV::CALCULATION=="relax"|| GlobalV::CALCULATION=="md" || GlobalV::CALCULATION=="cell-relax")
189-
{
190-
CE.update_all_pos(GlobalC::ucell);
191-
}
192186

193187
if(GlobalC::pot.out_potential == 2)
194188
{
@@ -367,6 +361,8 @@ bool Ions::if_do_cellrelax()
367361
bool Ions::do_relax(const int& istep, int& jstep, const ModuleBase::matrix& ionic_force, const double& total_energy)
368362
{
369363
ModuleBase::TITLE("Ions","do_relax");
364+
CE.update_istep(jstep);
365+
CE.update_all_pos(GlobalC::ucell);
370366
IMM.cal_movement(istep, jstep, ionic_force, total_energy);
371367
++jstep;
372368
return IMM.get_converged();
@@ -386,6 +382,7 @@ void Ions::reset_after_relax(const int& istep)
386382
GlobalV::ofs_running << " Setup the extrapolated charge." << std::endl;
387383
// charge extrapolation if istep>0.
388384
CE.extrapolate_charge();
385+
CE.save_pos_next(GlobalC::ucell);
389386

390387
GlobalV::ofs_running << " Setup the Vl+Vh+Vxc according to new structure factor and new charge." << std::endl;
391388
// calculate the new potential accordint to

source/src_lcao/FORCE_k.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,9 +1272,9 @@ void Force_LCAO_k::cal_fvl_dphi_k(
12721272
// Grid integration here.
12731273
//--------------------------------
12741274
// fvl_dphi can not be set to zero here if Vna is used
1275-
if(isstress&&isforce)
1275+
if(isstress||isforce)
12761276
{
1277-
GlobalC::UHM.GK.svl_k_RealSpace(fvl_dphi,svl_dphi,GlobalC::pot.vr_eff1);
1277+
GlobalC::UHM.GK.svl_k_RealSpace(isforce, isstress, fvl_dphi,svl_dphi,GlobalC::pot.vr_eff1);
12781278
}
12791279
else if(isforce)
12801280
{

0 commit comments

Comments
 (0)