Skip to content

Commit a0a1925

Browse files
committed
Removed useless code in gint_k_fvl.cpp, still can't calculate stress without force in gamma_only
1 parent 214bce8 commit a0a1925

File tree

1 file changed

+5
-41
lines changed

1 file changed

+5
-41
lines changed

source/src_lcao/gint_k_fvl.cpp

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,9 @@ void Gint_k::svl_k_RealSpace(
393393
// Folding R here
394394
//---------------------------------------
395395

396-
ModuleBase::timer::tick("Gint_k","folding_force_stress");
397396
//GlobalC::LM.DHloc_fixedR_x
398397
this->folding_stress(isforce, isstress, fvl_dphi, svl_dphi, pvdpx, pvdpy, pvdpz,
399398
pvdp11, pvdp22, pvdp33, pvdp12, pvdp13, pvdp23);
400-
ModuleBase::timer::tick("Gint_k","folding_force_stress");
401399

402400
if(isforce)
403401
{
@@ -477,14 +475,10 @@ void Gint_k::evaluate_vl_stress(
477475
double *psi1, *psi2;
478476
double *iw1p, *iw2p;
479477
double *iw1px, *iw1py, *iw1pz;//extra pointer compared to non-force grid integration.
480-
double *iw2px, *iw2py, *iw2pz;//extra pointer compared to non-force grid integration.
481478
double *end1, *end2;
482-
double *pvp1, *pvp2, *pvp3;//extra pointer
483-
double *pvp11, *pvp22, *pvp33, *pvp12, *pvp13, *pvp23;
484-
int iw1_lo, iw2_lo;
479+
double *pvp11, *pvp22, *pvp33, *pvp12, *pvp13, *pvp23;
485480
int iwi, iww;
486-
double vpsir1, vpsir2, vpsir3;//extra pointer
487-
double vpsir11, vpsir22, vpsir33, vpsir12, vpsir13, vpsir23;//extra pointer
481+
double vpsir11, vpsir22, vpsir33, vpsir12, vpsir13, vpsir23;//extra pointer
488482
double *psix, *psiy, *psiz;
489483

490484

@@ -514,8 +508,6 @@ void Gint_k::evaluate_vl_stress(
514508
const int iat = gt.which_atom[mcell_index1];
515509
const int T1 = GlobalC::ucell.iat2it[iat];
516510
const int I1 = GlobalC::ucell.iat2ia[iat];
517-
const int start1 = GlobalC::ucell.itiaiw2iwt(T1, I1, 0);
518-
const int iw1_start = gt.trace_lo[start1];
519511
Atom *atom1 = &GlobalC::ucell.atoms[T1];
520512

521513
//~~~~~~~~~~~~~~~~
@@ -557,9 +549,6 @@ void Gint_k::evaluate_vl_stress(
557549
//---------------------------------------------------------
558550
{
559551
Atom *atom2 = &GlobalC::ucell.atoms[T2];
560-
const int I2 = GlobalC::ucell.iat2ia[iat2];
561-
const int start2 = GlobalC::ucell.itiaiw2iwt(T2, I2, 0);
562-
const int iw2_start = gt.trace_lo[start2];
563552

564553
//---------------
565554
// get cell R2.
@@ -630,8 +619,7 @@ void Gint_k::evaluate_vl_stress(
630619

631620

632621
end1 = psi1 + atom1->nw;
633-
end2 = psi2 + atom2->nw;
634-
iw1_lo = iw1_start;
622+
end2 = psi2 + atom2->nw;
635623
//------------------------------------
636624
// circle for wave functions of atom 1.
637625
//------------------------------------
@@ -653,7 +641,6 @@ void Gint_k::evaluate_vl_stress(
653641
++iw1py;
654642
++iw1pz;
655643

656-
iw2_lo = iw2_start;
657644
iww = iatw + iwi;// -1 because ++iww from below.
658645

659646
dmR2 = &dmR[iww]; //mohan add 2012-01-05
@@ -677,12 +664,7 @@ void Gint_k::evaluate_vl_stress(
677664
//------------------------------------
678665
// circle for wave functions of atom 2.
679666
//------------------------------------
680-
iw2px = psix;
681-
iw2py = psiy;
682-
iw2pz = psiz;
683-
684-
for(iw2p=psi2; iw2p < end2; ++iw2p,
685-
++iw2px, ++iw2py, ++iw2pz)
667+
for(iw2p=psi2; iw2p < end2; ++iw2p)
686668
{
687669

688670
// bug here!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -694,7 +676,6 @@ void Gint_k::evaluate_vl_stress(
694676
pvp13[0] += dmR2[0] * vpsir13 * iw2p[0] ;
695677
pvp23[0] += dmR2[0] * vpsir23 * iw2p[0] ;
696678

697-
++iw2_lo;
698679
++pvp11;
699680
++pvp22;
700681
++pvp33;
@@ -704,7 +685,6 @@ void Gint_k::evaluate_vl_stress(
704685
//density matrix
705686
++dmR2;
706687
}
707-
++iw1_lo;
708688
}// iw
709689
}//end flag
710690
}//end ib
@@ -727,10 +707,8 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
727707
double *psi1, *psi2;
728708
double *iw1p, *iw2p;
729709
double *iw1px, *iw1py, *iw1pz;//extra pointer compared to non-force grid integration.
730-
double *iw2px, *iw2py, *iw2pz;//extra pointer compared to non-force grid integration.
731710
double *end1, *end2;
732711
double *pvp1, *pvp2, *pvp3;//extra pointer
733-
int iw1_lo, iw2_lo;
734712
int iwi, iww;
735713
double vpsir1, vpsir2, vpsir3;//extra pointer
736714
double *psix, *psiy, *psiz;
@@ -761,8 +739,6 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
761739
const int iat = gt.which_atom[mcell_index1];
762740
const int T1 = GlobalC::ucell.iat2it[iat];
763741
const int I1 = GlobalC::ucell.iat2ia[iat];
764-
const int start1 = GlobalC::ucell.itiaiw2iwt(T1, I1, 0);
765-
const int iw1_start = gt.trace_lo[start1];
766742
Atom *atom1 = &GlobalC::ucell.atoms[T1];
767743

768744
//~~~~~~~~~~~~~~~~
@@ -804,9 +780,6 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
804780
//---------------------------------------------------------
805781
{
806782
Atom *atom2 = &GlobalC::ucell.atoms[T2];
807-
const int I2 = GlobalC::ucell.iat2ia[iat2];
808-
const int start2 = GlobalC::ucell.itiaiw2iwt(T2, I2, 0);
809-
const int iw2_start = gt.trace_lo[start2];
810783

811784
//---------------
812785
// get cell R2.
@@ -871,7 +844,6 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
871844

872845
end1 = psi1 + atom1->nw;
873846
end2 = psi2 + atom2->nw;
874-
iw1_lo = iw1_start;
875847
//------------------------------------
876848
// circle for wave functions of atom 1.
877849
//------------------------------------
@@ -890,7 +862,6 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
890862
++iw1py;
891863
++iw1pz;
892864

893-
iw2_lo = iw2_start;
894865
iww = iatw + iwi;// -1 because ++iww from below.
895866

896867
dmR2 = &dmR[iww]; //mohan add 2012-01-05
@@ -907,12 +878,7 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
907878
//------------------------------------
908879
// circle for wave functions of atom 2.
909880
//------------------------------------
910-
iw2px = psix;
911-
iw2py = psiy;
912-
iw2pz = psiz;
913-
914-
for(iw2p=psi2; iw2p < end2; ++iw2p,
915-
++iw2px, ++iw2py, ++iw2pz)
881+
for(iw2p=psi2; iw2p < end2; ++iw2p)
916882
{
917883
// the main difference to calculate
918884
// the force is that the whole
@@ -923,14 +889,12 @@ void Gint_k::evaluate_vl_force(const int &grid_index, const int &size, const int
923889
pvp2[0] += dmR2[0] * vpsir2 * iw2p[0];
924890
pvp3[0] += dmR2[0] * vpsir3 * iw2p[0];
925891

926-
++iw2_lo;
927892
++pvp1;
928893
++pvp2;
929894
++pvp3;
930895
//density matrix
931896
++dmR2;
932897
}
933-
++iw1_lo;
934898
}// iw
935899
}//end flag
936900
}//end ib

0 commit comments

Comments
 (0)