@@ -31,6 +31,8 @@ void test_deepks::check_psialpha()
3131 }
3232 ld.init (ORB, ucell.nat , ucell.ntype , ParaO, na);
3333
34+ ld.allocate_psialpha (PARAM.input .cal_force , ucell, ORB, Test_Deepks::GridD);
35+
3436 ld.build_psialpha (PARAM.input .cal_force , ucell, ORB, Test_Deepks::GridD, overlap_orb_alpha_);
3537
3638 ld.check_psialpha (PARAM.input .cal_force , ucell, ORB, Test_Deepks::GridD);
@@ -200,7 +202,7 @@ void test_deepks::check_edelta()
200202 this ->ld .load_model (" model.ptg" );
201203 if (PARAM.sys .gamma_only_local )
202204 {
203- this ->ld .allocate_V_delta (ucell.nat );
205+ this ->ld .allocate_V_delta (ucell.nat , 1 ); // 1 for gamma-only
204206 }
205207 else
206208 {
@@ -239,14 +241,16 @@ void test_deepks::check_f_delta()
239241{
240242 ModuleBase::matrix svnl_dalpha;
241243 svnl_dalpha.create (3 , 3 );
244+ const int cal_stress = 1 ;
242245 if (PARAM.sys .gamma_only_local )
243246 {
244247 const int nks = 1 ;
245- ld.cal_f_delta_gamma (dm_new, ucell, ORB, Test_Deepks::GridD, nks, kv.kvec_d , 1 , svnl_dalpha);
248+ ld.cal_f_delta (dm_new, ucell, ORB, Test_Deepks::GridD, nks, kv.kvec_d , cal_stress , svnl_dalpha);
246249 }
247250 else
248251 {
249- ld.cal_f_delta_k (dm_k_new, ucell, ORB, Test_Deepks::GridD, kv.get_nkstot (), kv.kvec_d , 1 , svnl_dalpha);
252+ const int nks = kv.get_nkstot ();
253+ ld.cal_f_delta (dm_k_new, ucell, ORB, Test_Deepks::GridD, nks, kv.kvec_d , cal_stress, svnl_dalpha);
250254 }
251255 ld.check_f_delta (ucell.nat , svnl_dalpha);
252256
0 commit comments