Skip to content

Commit 064c977

Browse files
authored
Modify the output of the rR file to a sparse matrix form. (#209)
1 parent 922a09f commit 064c977

File tree

7 files changed

+625
-570
lines changed

7 files changed

+625
-570
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -957,16 +957,25 @@ void ESolver_KS_LCAO::afterscf(const int istep)
957957
GlobalC::dmft.out_to_dmft(this->LOWF, *this->UHM.LM);
958958
}
959959

960+
if (hsolver::HSolverLCAO::out_mat_hsR)
961+
{
962+
this->output_HS_R(istep); // LiuXh add 2019-07-15
963+
}
964+
960965
// add by jingan for out r_R matrix 2019.8.14
961966
if(INPUT.out_mat_r)
962967
{
963968
cal_r_overlap_R r_matrix;
964969
r_matrix.init(*this->LOWF.ParaV);
965-
r_matrix.out_r_overlap_R();
966-
}
967-
if (hsolver::HSolverLCAO::out_mat_hsR)
968-
{
969-
this->output_HS_R(istep); // LiuXh add 2019-07-15
970+
971+
if (hsolver::HSolverLCAO::out_mat_hsR)
972+
{
973+
r_matrix.out_rR_other(this->LM.output_R_coor);
974+
}
975+
else
976+
{
977+
r_matrix.out_rR();
978+
}
970979
}
971980

972981
if(!GlobalV::CAL_FORCE && !GlobalV::CAL_STRESS)

source/module_esolver/esolver_ks_lcao_tddft.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,25 @@ void ESolver_KS_LCAO_TDDFT::afterscf(const int istep)
529529
std::cout << " !! CONVERGENCE HAS NOT BEEN ACHIEVED !!" << std::endl;
530530
}
531531

532+
if (hsolver::HSolverLCAO::out_mat_hsR)
533+
{
534+
this->output_HS_R(istep); // LiuXh add 2019-07-15
535+
}
536+
532537
// add by jingan for out r_R matrix 2019.8.14
533538
if(INPUT.out_mat_r)
534539
{
535540
cal_r_overlap_R r_matrix;
536541
r_matrix.init(*this->LOWF.ParaV);
537-
r_matrix.out_r_overlap_R();
538-
}
539542

540-
if (Pdiag_Double::out_mat_hsR)
541-
{
542-
this->output_HS_R(istep); // LiuXh add 2019-07-15
543+
if (hsolver::HSolverLCAO::out_mat_hsR)
544+
{
545+
r_matrix.out_rR_other(this->LM.output_R_coor);
546+
}
547+
else
548+
{
549+
r_matrix.out_rR();
550+
}
543551
}
544552
}
545553

source/module_orbital/ORB_read.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ void LCAO_Orbitals::Read_Orbitals(
179179
}
180180

181181
// jingan add for calculate r(R) matrix
182-
if(out_mat_r)
183-
{
184-
kmesh = kmesh * 4;
185-
}
182+
// if(out_mat_r)
183+
// {
184+
// kmesh = kmesh * 4;
185+
// }
186186

187187
// this->kmesh = static_cast<int> (PI / 0.01 / 4 / this->dk);
188188
if(kmesh%2==0) kmesh++;

0 commit comments

Comments
 (0)