Skip to content

Commit d3cb289

Browse files
authored
try to remove spin_now (#5689)
1 parent 3fec10a commit d3cb289

File tree

6 files changed

+1
-46
lines changed

6 files changed

+1
-46
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -660,11 +660,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(UnitCell& ucell, const int istep, const
660660

661661
if (PARAM.inp.vl_in_h)
662662
{
663-
// update Gint_K
664-
if (!PARAM.globalv.gamma_only_local)
665-
{
666-
this->GK.renew();
667-
}
668663
// update real space Hamiltonian
669664
this->p_hamilt->refresh();
670665
}
@@ -961,10 +956,6 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
961956
#endif
962957

963958
// 6) write Hamiltonian and Overlap matrix
964-
if (!PARAM.globalv.gamma_only_local && (PARAM.inp.out_mat_hs[0] || PARAM.inp.deepks_v_delta))
965-
{
966-
this->GK.renew(true);
967-
}
968959
for (int ik = 0; ik < this->kv.get_nks(); ++ik)
969960
{
970961
if (PARAM.inp.out_mat_hs[0] || PARAM.inp.deepks_v_delta)

source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
262262
orb.cutoffs(),
263263
&grid_d,
264264
PARAM.inp.nspin);
265-
// reset spin index and real space Hamiltonian matrix
266-
int start_spin = -1;
267-
GK_in->reset_spin(start_spin);
265+
268266
}
269267
}
270268

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ void Veff<OperatorLCAO<TK, TR>>::contributeHR()
7575
// pvpR = < phi0 | v(spin) | phiR> for a new spin.
7676
//--------------------------------------------
7777
// GlobalV::ofs_running << " (spin change)" << std::endl;
78-
this->GK->reset_spin(this->current_spin);
7978

8079
// if you change the place of the following code,
8180
// rememeber to delete the #include

source/module_hamilt_lcao/module_gint/gint_k.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,6 @@ class Gint_k : public Gint {
2323
// pvpR and reset_spin/get_spin : auxilliary methods
2424
// for calculating hamiltonian
2525

26-
// reset the spin.
27-
void reset_spin(const int& spin_now_in) { this->spin_now = spin_now_in; };
28-
// get the spin.
29-
int get_spin() const { return spin_now; }
30-
31-
// renew gint index for new iteration
32-
void renew(const bool& soft = false) {
33-
if (soft
34-
&& this->spin_now
35-
== 0) { // in this case, gint will not be recalculated
36-
return;
37-
} else if (this->spin_now != -1) {
38-
int start_spin = -1;
39-
this->reset_spin(start_spin);
40-
}
41-
return;
42-
}
43-
4426
// allocate the <phi_0 | V | dphi_R> matrix element.
4527
void allocate_pvdpR();
4628
// destroy the temporary <phi_0 | V | dphi_R> matrix element.
@@ -102,9 +84,6 @@ class Gint_k : public Gint {
10284
//----------------------------
10385
// key variable
10486
//----------------------------
105-
106-
// used only in vlocal.
107-
int spin_now = -1;
10887
};
10988

11089
#endif

source/module_rdmft/rdmft_tools.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ void Veff_rdmft<TK, TR>::contributeHR()
247247
ModuleBase::TITLE("Veff", "contributeHR");
248248
ModuleBase::timer::tick("Veff", "contributeHR");
249249

250-
this->GK->reset_spin(this->current_spin);
251-
252250
double* vr_eff_rdmft = nullptr;
253251

254252
// calculate v_hartree(r) or v_local(r) or v_xc(r)

source/module_rdmft/update_state_rdmft.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@ void RDMFT<TK, TR>::update_charge()
159159
srho.begin(is, *(this->charge), rho_basis, GlobalC::ucell.symm);
160160
}
161161

162-
// what this? it seems that it needs to be updated at each iteration
163-
if (PARAM.inp.vl_in_h)
164-
{
165-
// update Gint_K
166-
if (!PARAM.globalv.gamma_only_local)
167-
{
168-
this->GK->renew();
169-
}
170-
}
171-
172162
}
173163

174164

0 commit comments

Comments
 (0)