Skip to content

Commit 7fa6897

Browse files
committed
update lcao_after_scf, this is before using ctrl_outut_lcao in lcao_after_scf
1 parent 00ba221 commit 7fa6897

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

source/module_esolver/lcao_after_scf.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,32 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep, const
5757

5858
if(istep % PARAM.inp.out_interval == 0)
5959
{
60-
//ModuleIO::ctrl_output_lcao<TK, TR>(ucell, this->pelec, this->pv, istep);
60+
/*
61+
ModuleIO::ctrl_output_lcao<TK, TR>(ucell,
62+
this->kv,
63+
this->pelec,
64+
this->pv,
65+
this->gd,
66+
this->psi,
67+
this->p_hamilt,
68+
this->two_center_bundle_,
69+
this->GK,
70+
this->orb_,
71+
this->pw_wfc,
72+
this->pw_rho,
73+
this->GridT,
74+
this->pw_big,
75+
this->sf,
76+
this->rdmft_solver,
77+
#ifdef __DEEPKS
78+
this->ld,
79+
#endif
80+
#ifdef __EXX
81+
this->exd,
82+
this->exc,
83+
#endif
84+
istep);
85+
*/
6186
}
6287

6388
//------------------------------------------------------------------

source/module_io/ctrl_output_lcao.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ void ctrl_output_lcao(UnitCell& ucell,
4444
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
4545
const Structure_Factor& sf, // for Wannier90
4646
rdmft::RDMFT<TK, TR> &rdmft_solver, // for RDMFT
47+
#ifdef __DEEPKS
48+
LCAO_Deepks<T>& ld,
49+
#endif
50+
#ifdef __EXX
51+
Exx_LRI_Interface<T, double>& exd,
52+
Exx_LRI_Interface<T, std::complex<double>>& exc,
53+
#endif
4754
const int istep)
4855
{
4956
ModuleBase::TITLE("ModuleIO", "ctrl_output_lcao");
@@ -121,7 +128,7 @@ void ctrl_output_lcao(UnitCell& ucell,
121128
//------------------------------------------------------------------
122129
#ifdef __DEEPKS
123130
// need control parameter
124-
hamilt::HamiltLCAO<TK, TR>* p_ham_deepks = dynamic_cast<hamilt::HamiltLCAO<TK, TR>*>(p_hamilt);
131+
hamilt::HamiltLCAO<TK, TR>* p_ham_deepks = p_hamilt;
125132
std::shared_ptr<LCAO_Deepks<TK>> ld_shared_ptr(&ld, [](LCAO_Deepks<TK>*) {});
126133
LCAO_Deepks_Interface<TK, TR> deepks_interface(ld_shared_ptr);
127134

@@ -336,7 +343,7 @@ void ctrl_output_lcao(UnitCell& ucell,
336343
if (PARAM.inp.rpa)
337344
{
338345
RPA_LRI<TK, double> rpa_lri_double(GlobalC::exx_info.info_ri);
339-
rpa_lri_double.cal_postSCF_exx(*dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(this->pelec)->get_DM(),
346+
rpa_lri_double.cal_postSCF_exx(*dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(pelec)->get_DM(),
340347
MPI_COMM_WORLD,
341348
ucell,
342349
kv,
@@ -414,6 +421,10 @@ template void ModuleIO::ctrl_output_lcao<double, double>(UnitCell& ucell,
414421
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
415422
const Structure_Factor& sf, // for Wannier90
416423
rdmft::RDMFT<double, double> &rdmft_solver, // for RDMFT
424+
#ifdef __EXX
425+
Exx_LRI_Interface<T, double>& exd,
426+
Exx_LRI_Interface<T, std::complex<double>>& exc,
427+
#endif
417428
const int istep);
418429

419430
// For multiple k-points
@@ -433,6 +444,13 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, double>(UnitCell&
433444
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
434445
const Structure_Factor& sf, // for Wannier90
435446
rdmft::RDMFT<std::complex<double>, double> &rdmft_solver, // for RDMFT
447+
#ifdef __DEEPKS
448+
LCAO_Deepks<T>& ld,
449+
#endif
450+
#ifdef __EXX
451+
Exx_LRI_Interface<T, double>& exd,
452+
Exx_LRI_Interface<T, std::complex<double>>& exc,
453+
#endif
436454
const int istep);
437455

438456
template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<double>>(UnitCell& ucell,
@@ -451,5 +469,12 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<doub
451469
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
452470
const Structure_Factor& sf, // for Wannier90
453471
rdmft::RDMFT<std::complex<double>, std::complex<double>> &rdmft_solver, // for RDMFT
472+
#ifdef __DEEPKS
473+
LCAO_Deepks<T>& ld,
474+
#endif
475+
#ifdef __EXX
476+
Exx_LRI_Interface<T, double>& exd,
477+
Exx_LRI_Interface<T, std::complex<double>>& exc,
478+
#endif
454479
const int istep);
455480

source/module_io/ctrl_output_lcao.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include "module_basis/module_pw/pw_basis_k.h" // use ModulePW::PW_Basis_K and ModulePW::PW_Basis
1414
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h" // use Structure_Factor
1515
#include "module_rdmft/rdmft.h" // use RDMFT codes
16+
#ifdef __EXX
17+
#include "module_ri/Exx_LRI_interface.h" // use EXX codes
18+
#endif
1619

1720
namespace ModuleIO
1821
{
@@ -34,6 +37,13 @@ namespace ModuleIO
3437
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
3538
const Structure_Factor& sf, // for Wannier90
3639
rdmft::RDMFT<TK, TR> &rdmft_solver, // for RDMFT
40+
#ifdef __DEEPKS
41+
LCAO_Deepks<T>& ld,
42+
#endif
43+
#ifdef __EXX
44+
Exx_LRI_Interface<T, double>& exd,
45+
Exx_LRI_Interface<T, std::complex<double>>& exc,
46+
#endif
3747
const int istep);
3848
}
3949
#endif

0 commit comments

Comments
 (0)