Skip to content

Commit 8c26095

Browse files
committed
update updateSk
1 parent 02eb1de commit 8c26095

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ Operator<TK>*& HamiltLCAO<TK, TR>::getOperator()
500500
template <typename TK, typename TR>
501501
void HamiltLCAO<TK, TR>::updateSk(
502502
const int ik,
503-
const ModuleBase::Vector3<double>& kvec_d,
504503
const int hk_type)
505504
{
506505
ModuleBase::TITLE("HamiltLCAO", "updateSk");
@@ -511,12 +510,12 @@ void HamiltLCAO<TK, TR>::updateSk(
511510
if (hk_type == 1) // collumn-major matrix for SK
512511
{
513512
const int nrow = this->hsk->get_pv()->get_row_size();
514-
hamilt::folding_HR(*this->sR, this->getSk(), kvec_d, nrow, 1);
513+
hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], nrow, 1);
515514
}
516515
else if (hk_type == 0) // row-major matrix for SK
517516
{
518517
const int ncol = this->hsk->get_pv()->get_col_size();
519-
hamilt::folding_HR(*this->sR, this->getSk(), kvec_d, ncol, 0);
518+
hamilt::folding_HR(*this->sR, this->getSk(), this->kv->kvec_d[ik], ncol, 0);
520519
}
521520
else
522521
{

source/module_hamilt_lcao/hamilt_lcaodft/hamilt_lcao.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ class HamiltLCAO : public Hamilt<TK>
139139
* @param hk_type 0: SK is row-major, 1: SK is collumn-major
140140
* @return void
141141
*/
142-
void updateSk(const int ik,
143-
const ModuleBase::Vector3<double>& kvec_d,
144-
const int hk_type = 0);
142+
void updateSk(const int ik, const int hk_type = 0);
145143

146144
// core function: return H(k) and S(k) matrixs for direct solving eigenvalues.
147145
// not used in PW base

source/module_hamilt_lcao/module_dftu/dftu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ class DFTU
191191
* use HContainer as input and output in mat_k
192192
*/
193193
void folding_matrix_k_new(const int ik,
194-
const ModuleBase::Vector3<double>& kvec_d,
195194
hamilt::Hamilt<std::complex<double>>* p_ham);
196195

197196
//=============================================================

source/module_hamilt_lcao/module_dftu/dftu_folding.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,19 @@ void DFTU::folding_matrix_k(const UnitCell& ucell,
236236
// the index of orbitals in this processor
237237
const int iw1_all = start1 + ii;
238238
const int mu = pv.global2local_row(iw1_all);
239-
if (mu < 0) { continue;
240-
}
239+
if (mu < 0)
240+
{
241+
continue;
242+
}
241243

242244
for (int jj = 0; jj < atom2->nw * PARAM.globalv.npol; jj++)
243245
{
244246
int iw2_all = start2 + jj;
245247
const int nu = pv.global2local_col(iw2_all);
246-
if (nu < 0) { continue;
247-
}
248+
if (nu < 0)
249+
{
250+
continue;
251+
}
248252

249253
int iic;
250254
if (ModuleBase::GlobalFunc::IS_COLUMN_MAJOR_KS_SOLVER(PARAM.inp.ks_solver))
@@ -279,7 +283,6 @@ void DFTU::folding_matrix_k(const UnitCell& ucell,
279283
}
280284

281285
void DFTU::folding_matrix_k_new(const int ik,
282-
const ModuleBase::Vector3<double>& kvec_d,
283286
hamilt::Hamilt<std::complex<double>>* p_ham)
284287
{
285288
ModuleBase::TITLE("DFTU", "folding_matrix_k_new");
@@ -295,19 +298,19 @@ void DFTU::folding_matrix_k_new(const int ik,
295298
if(PARAM.globalv.gamma_only_local)
296299
{
297300
dynamic_cast<hamilt::HamiltLCAO<double, double>*>(p_ham)
298-
->updateSk(ik, kvec_d, hk_type);
301+
->updateSk(ik, hk_type);
299302
}
300303
else
301304
{
302305
if(PARAM.inp.nspin != 4)
303306
{
304307
dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, double>*>(p_ham)
305-
->updateSk(ik, kvec_d, hk_type);
308+
->updateSk(ik, hk_type);
306309
}
307310
else
308311
{
309312
dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, std::complex<double>>*>(p_ham)
310-
->updateSk(ik, kvec_d, hk_type);
313+
->updateSk(ik, hk_type);
311314
}
312315
}
313316
}

source/module_hamilt_lcao/module_dftu/dftu_occup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void DFTU::cal_occup_m_k(const int iter,
175175
for (int ik = 0; ik < kv.get_nks(); ik++)
176176
{
177177
// srho(mu,nu) = \sum_{iw} S(mu,iw)*dm_k(iw,nu)
178-
this->folding_matrix_k_new(ik, kv.kvec_d[ik], p_ham);
178+
this->folding_matrix_k_new(ik, p_ham);
179179

180180
std::complex<double>* s_k_pointer = nullptr;
181181

source/module_io/write_dos_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,15 @@ void ModuleIO::write_dos_lcao(const UnitCell& ucell,
455455
if (PARAM.inp.nspin == 4)
456456
{
457457
dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, std::complex<double>>*>(p_ham)
458-
->updateSk(ik, kv.kvec_d[ik], hk_type);
458+
->updateSk(ik, hk_type);
459459

460460
sk = dynamic_cast<const hamilt::HamiltLCAO<std::complex<double>, std::complex<double>>*>(p_ham)
461461
->getSk();
462462
}
463463
else
464464
{
465465
dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, double>*>(p_ham)
466-
->updateSk(ik, kv.kvec_d[ik], hk_type);
466+
->updateSk(ik, hk_type);
467467

468468
sk = dynamic_cast<const hamilt::HamiltLCAO<std::complex<double>, double>*>(p_ham)
469469
->getSk();

0 commit comments

Comments
 (0)