Skip to content

Commit 38a3692

Browse files
committed
modify threshold of weight of occupation from 1.0e-8 to 1.0e-14
1 parent 7dc831c commit 38a3692

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

source/module_base/constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const double RYDBERG_SI = HARTREE_SI/2.0; //J
9494

9595
// zero up to a given accuracy
9696
//const double epsr = 1.0e-6;
97-
//const double epsg = 1.0e-10;
97+
const double threshold_wg = 1.0e-14;
9898
}
9999

100100
#endif

source/src_pw/charge.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void Charge::sum_band_k(void)
760760
///
761761
///only occupied band should be calculated.
762762
///
763-
if(GlobalC::wf.wg(ik, ibnd)<1e-8) continue;
763+
if(GlobalC::wf.wg(ik, ibnd)<ModuleBase::threshold_wg) continue;
764764
GlobalC::en.eband += GlobalC::wf.ekb[ik][ibnd] * GlobalC::wf.wg(ik, ibnd);
765765
ModuleBase::GlobalFunc::ZEROS( porter, GlobalC::pw.nrxx );
766766
for (int ig = 0;ig < GlobalC::kv.ngk[ik] ; ig++)
@@ -818,7 +818,7 @@ void Charge::sum_band_k(void)
818818
///
819819
///only occupied band should be calculated.
820820
///
821-
if(GlobalC::wf.wg(ik, ibnd)<1e-8) continue;
821+
if(GlobalC::wf.wg(ik, ibnd)<ModuleBase::threshold_wg) continue;
822822
GlobalC::en.eband += GlobalC::wf.ekb[ik][ibnd] * GlobalC::wf.wg(ik, ibnd);
823823
//std::cout << "\n ekb = " << GlobalC::wf.ekb[ik][ibnd] << " wg = " << GlobalC::wf.wg(ik, ibnd);
824824

source/src_pw/forces.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ void Forces::cal_force_nl(ModuleBase::matrix& forcenl)
732732
///
733733
///only occupied band should be calculated.
734734
///
735-
if(GlobalC::wf.wg(ik, ib) < 1.0e-8) continue;
735+
if(GlobalC::wf.wg(ik, ib) < ModuleBase::threshold_wg) continue;
736736
for (int i=0; i<nkb; i++)
737737
{
738738
for (int ig=0; ig<GlobalC::wf.npw; ig++)
@@ -754,7 +754,7 @@ void Forces::cal_force_nl(ModuleBase::matrix& forcenl)
754754
///
755755
///only occupied band should be calculated.
756756
///
757-
if(GlobalC::wf.wg(ik, ib) < 1.0e-8) continue;
757+
if(GlobalC::wf.wg(ik, ib) < ModuleBase::threshold_wg) continue;
758758
double fac = GlobalC::wf.wg(ik, ib) * 2.0 * GlobalC::ucell.tpiba;
759759
int iat = 0;
760760
int sum = 0;

source/src_pw/stress_func_nl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void Stress_Func::stress_nl(ModuleBase::matrix& sigma)
5656
///
5757
///only occupied band should be calculated.
5858
///
59-
if(GlobalC::wf.wg(ik, ib) < 1.0e-8) continue;
59+
if(GlobalC::wf.wg(ik, ib) < ModuleBase::threshold_wg) continue;
6060
for (int i = 0; i < nkb; i++)
6161
{
6262
for (int ig = 0; ig < GlobalC::wf.npw; ig++) {
@@ -140,7 +140,7 @@ void Stress_Func::stress_nl(ModuleBase::matrix& sigma)
140140
///
141141
///only occupied band should be calculated.
142142
///
143-
if(GlobalC::wf.wg(ik, ib) < 1.0e-8) continue;
143+
if(GlobalC::wf.wg(ik, ib) < ModuleBase::threshold_wg) continue;
144144
for (int i=0; i<nkb; i++)
145145
{
146146
for (int ig=0; ig<GlobalC::wf.npw; ig++)
@@ -169,7 +169,7 @@ void Stress_Func::stress_nl(ModuleBase::matrix& sigma)
169169
///
170170
///only occupied band should be calculated.
171171
///
172-
if(GlobalC::wf.wg(ik, ib) < 1.0e-5) continue;
172+
if(GlobalC::wf.wg(ik, ib) < ModuleBase::threshold_wg) continue;
173173
double fac = GlobalC::wf.wg(ik, ib) * 1.0;
174174
int iat = 0;
175175
int sum = 0;

0 commit comments

Comments
 (0)