Skip to content

Commit 2a8288d

Browse files
author
wenfei-li
committed
fix : fixed memory issues in LCAO calculations
1 parent 7b53682 commit 2a8288d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,11 @@ void ESolver_KS_LCAO::afterscf()
940940
{
941941
this->output_HS_R(); // LiuXh add 2019-07-15
942942
}
943+
944+
if(!GlobalV::CAL_FORCE && !GlobalV::CAL_STRESS)
945+
{
946+
RA.delete_grid();
947+
}
943948
}
944949

945950
bool ESolver_KS_LCAO::do_after_converge(int& iter)

source/module_orbital/ORB_table_phi.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ void ORB_table_phi::cal_ST_Phi12_R
178178

179179
double* integrated_func = new double[kmesh];
180180

181-
const std::vector<std::vector<double>> &jlm1 = pSB->get_jlx()[l-1];
181+
int ll;
182+
if(l==0) ll=0;
183+
else ll=l-1;
184+
185+
const std::vector<std::vector<double>> &jlm1 = pSB->get_jlx()[ll];
182186
const std::vector<std::vector<double>> &jl = pSB->get_jlx()[l];
183187
const std::vector<std::vector<double>> &jlp1 = pSB->get_jlx()[l+1];
184188

0 commit comments

Comments
 (0)