Skip to content

Commit caf7bcd

Browse files
committed
lbfgs0
1 parent 279f99e commit caf7bcd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

source/module_relax/relax_old/bfgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void BFGS::UpdatePos(UnitCell& ucell)
349349
a[i*3+j]/=ModuleBase::BOHR_TO_A;
350350
}
351351
}
352-
ucell.update_pos_tau(a);
352+
unitcell::update_pos_tau(ucell.lat,a,ucell.ntype,ucell.nat,ucell.atoms);
353353
/*double move_ion[3*size];
354354
ModuleBase::zeros(move_ion, size*3);
355355

source/module_relax/relax_old/lbfgs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "module_base/matrix3.h"
44
#include "module_parameter/parameter.h"
55
#include "ions_move_basic.h"
6+
#include "module_cell/update_cell.h"
67

78
void LBFGS::allocate(const int _size) // initialize H0、H、pos0、force0、force
89
{
@@ -775,7 +776,7 @@ double LBFGS::GetEnergy(UnitCell& ucell,double stp)
775776
}
776777
}
777778
int k=0;
778-
ucell.update_pos_tau(a);
779+
unitcell::update_pos_tau(ucell.lat,a,ucell.ntype,ucell.nat,ucell.atoms);
779780
return solver->cal_energy();
780781
}
781782
std::vector<double> LBFGS::GetForce(UnitCell& ucell,double stp)
@@ -790,7 +791,7 @@ std::vector<double> LBFGS::GetForce(UnitCell& ucell,double stp)
790791
}
791792
}
792793
int k=0;
793-
ucell.update_pos_tau(a);
794+
unitcell::update_pos_tau(ucell.lat,a,ucell.ntype,ucell.nat,ucell.atoms);
794795
ModuleBase::matrix b;
795796
solver->cal_force(ucell,b);
796797
std::vector<double> c=std::vector<double>(3*size, 0.0);
@@ -820,7 +821,7 @@ void LBFGS::UpdatePos(UnitCell& ucell)
820821
{
821822
std::cout<<a[i]<<std::endl;
822823
}*/
823-
ucell.update_pos_tau(a);
824+
unitcell::update_pos_tau(ucell.lat,a,ucell.ntype,ucell.nat,ucell.atoms);
824825
/*double move_ion[3*size];
825826
ModuleBase::zeros(move_ion, size*3);
826827

0 commit comments

Comments
 (0)