Skip to content

Commit bf5ccbc

Browse files
committed
add ctrl_runner_lcao successfully
1 parent f37dd62 commit bf5ccbc

File tree

5 files changed

+98
-21
lines changed

5 files changed

+98
-21
lines changed

source/Makefile.Objects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ OBJS_IO=input_conv.o\
582582
output_log.o\
583583
output_mat_sparse.o\
584584
ctrl_scf_lcao.o\
585+
ctrl_runner_lcao.o\
585586
ctrl_output_fp.o\
586587
ctrl_output_pw.o\
587588
para_json.o\

source/source_esolver/esolver_ks_lcao.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "esolver_ks_lcao.h"
22

3-
#include "source_io/write_proj_band_lcao.h" // projcted band structure
43

54
#include "source_base/formatter.h"
65
#include "source_base/global_variable.h"
@@ -11,7 +10,6 @@
1110
#include "source_lcao/module_deltaspin/spin_constrain.h"
1211
#include "source_lcao/module_dftu/dftu.h"
1312
#include "source_io/berryphase.h"
14-
#include "source_io/cal_ldos.h"
1513
#include "source_io/cube_io.h"
1614
//#include "source_io/io_npz.h"
1715
#include "source_io/output_dmk.h"
@@ -29,9 +27,6 @@
2927

3028
// be careful of hpp, there may be multiple definitions of functions, 20250302, mohan
3129
#include "source_lcao/hs_matrix_k.hpp"
32-
#include "source_io/write_eband_terms.hpp"
33-
#include "source_io/write_vxc.hpp"
34-
#include "source_io/write_vxc_r.hpp"
3530

3631
#include "source_base/global_function.h"
3732
#include "source_cell/module_neighbor/sltk_grid_driver.h"
@@ -66,6 +61,7 @@
6661
#include "source_lcao/module_gint/temp_gint/gint_info.h"
6762

6863
#include "source_estate/module_charge/chgmixing.h" // use charge mixing, mohan add 20251006
64+
#include "source_io/ctrl_runner_lcao.h" // use ctrl_runner_lcao()
6965

7066

7167
namespace ModuleESolver
@@ -391,20 +387,16 @@ void ESolver_KS_LCAO<TK, TR>::after_all_runners(UnitCell& ucell)
391387
}
392388

393389
ModuleIO::ctrl_runner_lcao<TK, TR>(ucell,
394-
PARAM.inp, this->kv, estate, this->pv,
395-
this->gd, this->psi, hamilt_lcao,
396-
this->two_center_bundle_, this->GK,
397-
this->orb_, this->pw_wfc, this->pw_rho,
398-
this->GridT, this->pw_big, this->sf,
399-
this->rdmft_solver,
400-
#ifdef __MLALGO
401-
this->ld,
402-
#endif
390+
PARAM.inp, this->kv, estate, this->pv, this->Pgrid,
391+
this->gd, this->psi, this->chr, hamilt_lcao,
392+
this->two_center_bundle_, this->GG, this->GK,
393+
this->orb_, this->pw_rho, this->pw_rhod,
394+
this->sf, this->locpp.vloc,
403395
#ifdef __EXX
404396
*this->exd,
405397
*this->exc,
406398
#endif
407-
istep);
399+
this->solvent);
408400

409401
ModuleBase::timer::tick("ESolver_KS_LCAO", "after_all_runners");
410402
}

source/source_io/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ if(ENABLE_LCAO)
8484
cal_r_overlap_R.cpp
8585
output_mat_sparse.cpp
8686
ctrl_scf_lcao.cpp
87+
ctrl_runner_lcao.cpp
8788
)
8889
endif()
8990

source/source_io/ctrl_runner_lcao.cpp

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
#include "source_estate/elecstate_lcao.h" // use elecstate::ElecState
44
#include "source_lcao/hamilt_lcao.h" // use hamilt::HamiltLCAO<TK, TR>
55

6+
#include "source_io/write_proj_band_lcao.h" // projcted band structure
7+
#include "source_io/cal_ldos.h" // cal LDOS
8+
#include "source_io/write_eband_terms.hpp"
9+
#include "source_io/write_vxc.hpp"
10+
#include "source_io/write_vxc_r.hpp"
11+
612
// functions
713
#ifdef __EXX
814
#include "source_lcao/module_ri/Exx_LRI_interface.h" // use EXX codes
@@ -14,7 +20,7 @@ namespace ModuleIO
1420

1521
template <typename TK, typename TR>
1622
void ctrl_runner_lcao(UnitCell& ucell, // unitcell
17-
Input_para &inp, // input
23+
const Input_para &inp, // input
1824
K_Vectors &kv, // k-point
1925
elecstate::ElecStateLCAO<TK>* pelec,// electronic info
2026
Parallel_Orbitals &pv, // orbital info
@@ -49,7 +55,7 @@ void ctrl_runner_lcao(UnitCell& ucell, // unitcell
4955
// 2) out ldos
5056
if (inp.out_ldos[0])
5157
{
52-
ModuleIO::Cal_ldos<TK>::cal_ldos_lcao(estate, psi[0], pgrid, ucell);
58+
ModuleIO::Cal_ldos<TK>::cal_ldos_lcao(pelec, psi[0], pgrid, ucell);
5359
}
5460

5561
// 3) print out exchange-correlation potential
@@ -126,14 +132,91 @@ void ctrl_runner_lcao(UnitCell& ucell, // unitcell
126132
kv,
127133
pelec->wg,
128134
gd,
129-
orb_.cutoffs(),
130-
two_center_bundle_
135+
orb.cutoffs(),
136+
two_center_bundle
131137
#ifdef __EXX
132138
,
133139
exd ? &exd->get_Hexxs() : nullptr,
134140
exc ? &exc->get_Hexxs() : nullptr
135141
#endif
136-
);
142+
);
137143
}
138144

139145
}
146+
147+
148+
149+
150+
template void ModuleIO::ctrl_runner_lcao<double, double>(UnitCell& ucell, // unitcell
151+
const Input_para &inp, // input
152+
K_Vectors &kv, // k-point
153+
elecstate::ElecStateLCAO<double>* pelec,// electronic info
154+
Parallel_Orbitals &pv, // orbital info
155+
Parallel_Grid &pgrid, // grid info
156+
Grid_Driver &gd, // search for adjacent atoms
157+
psi::Psi<double>* psi, // wave function
158+
Charge &chr, // charge density
159+
hamilt::HamiltLCAO<double, double>* p_hamilt, // hamiltonian
160+
TwoCenterBundle &two_center_bundle, // use two-center integration
161+
Gint_Gamma &gg, // gint for Gamma-only
162+
Gint_k &gk, // gint for multi k-points
163+
LCAO_Orbitals &orb, // LCAO orbitals
164+
ModulePW::PW_Basis* pw_rho, // charge density
165+
ModulePW::PW_Basis* pw_rhod, // dense charge density
166+
Structure_Factor &sf, // structure factor
167+
ModuleBase::matrix &vloc, // local pseudopotential
168+
#ifdef __EXX
169+
Exx_LRI_Interface<double, double>& exd,
170+
Exx_LRI_Interface<double, std::complex<double>>& exc,
171+
#endif
172+
surchem &solvent); // solvent model
173+
174+
template void ctrl_runner_lcao<std::complex<double>, double>(UnitCell& ucell, // unitcell
175+
const Input_para &inp, // input
176+
K_Vectors &kv, // k-point
177+
elecstate::ElecStateLCAO<std::complex<double>>* pelec,// electronic info
178+
Parallel_Orbitals &pv, // orbital info
179+
Parallel_Grid &pgrid, // grid info
180+
Grid_Driver &gd, // search for adjacent atoms
181+
psi::Psi<std::complex<double>>* psi, // wave function
182+
Charge &chr, // charge density
183+
hamilt::HamiltLCAO<std::complex<double>, double>* p_hamilt, // hamiltonian
184+
TwoCenterBundle &two_center_bundle, // use two-center integration
185+
Gint_Gamma &gg, // gint for Gamma-only
186+
Gint_k &gk, // gint for multi k-points
187+
LCAO_Orbitals &orb, // LCAO orbitals
188+
ModulePW::PW_Basis* pw_rho, // charge density
189+
ModulePW::PW_Basis* pw_rhod, // dense charge density
190+
Structure_Factor &sf, // structure factor
191+
ModuleBase::matrix &vloc, // local pseudopotential
192+
#ifdef __EXX
193+
Exx_LRI_Interface<std::complex<double>, double>& exd,
194+
Exx_LRI_Interface<std::complex<double>, std::complex<double>>& exc,
195+
#endif
196+
surchem &solvent); // solvent model
197+
198+
template void ctrl_runner_lcao<std::complex<double>, std::complex<double>>(UnitCell& ucell, // unitcell
199+
const Input_para &inp, // input
200+
K_Vectors &kv, // k-point
201+
elecstate::ElecStateLCAO<std::complex<double>>* pelec,// electronic info
202+
Parallel_Orbitals &pv, // orbital info
203+
Parallel_Grid &pgrid, // grid info
204+
Grid_Driver &gd, // search for adjacent atoms
205+
psi::Psi<std::complex<double>>* psi, // wave function
206+
Charge &chr, // charge density
207+
hamilt::HamiltLCAO<std::complex<double>, std::complex<double>>* p_hamilt, // hamiltonian
208+
TwoCenterBundle &two_center_bundle, // use two-center integration
209+
Gint_Gamma &gg, // gint for Gamma-only
210+
Gint_k &gk, // gint for multi k-points
211+
LCAO_Orbitals &orb, // LCAO orbitals
212+
ModulePW::PW_Basis* pw_rho, // charge density
213+
ModulePW::PW_Basis* pw_rhod, // dense charge density
214+
Structure_Factor &sf, // structure factor
215+
ModuleBase::matrix &vloc, // local pseudopotential
216+
#ifdef __EXX
217+
Exx_LRI_Interface<std::complex<double>, double>& exd,
218+
Exx_LRI_Interface<std::complex<double>, std::complex<double>>& exc,
219+
#endif
220+
surchem &solvent); // solvent model
221+
222+
} // end namespace

source/source_io/ctrl_runner_lcao.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace ModuleIO
1717

1818
template <typename TK, typename TR>
1919
void ctrl_runner_lcao(UnitCell& ucell, // unitcell
20-
Input_para &inp, // input
20+
const Input_para &inp, // input
2121
K_Vectors &kv, // k-point
2222
elecstate::ElecStateLCAO<TK>* pelec,// electronic info
2323
Parallel_Orbitals &pv, // orbital info

0 commit comments

Comments
 (0)