Skip to content

Commit 07c4c20

Browse files
committed
add back wannier90
1 parent f772962 commit 07c4c20

File tree

2 files changed

+27
-35
lines changed

2 files changed

+27
-35
lines changed

source/module_io/ctrl_output_lcao.cpp

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "module_io/cal_pLpR.h" // use AngularMomentumCalculator()
1616
#include "module_hamilt_lcao/module_deltaspin/spin_constrain.h" // use spinconstrain::SpinConstrain<TK>
1717
#include "module_io/berryphase.h" // use berryphase
18+
#include "module_io/to_wannier90_lcao.h" // use toWannier90_LCAO
19+
#include "module_io/to_wannier90_lcao_in_pw.h" // use toWannier90_LCAO_IN_PW
1820
#include "module_io/to_qo.h" // use toQO
1921

2022
namespace ModuleIO
@@ -34,6 +36,8 @@ void ctrl_output_lcao(UnitCell& ucell,
3436
const ModulePW::PW_Basis_K* pw_wfc, // for berryphase
3537
const ModulePW::PW_Basis* pw_rho, // for berryphase
3638
Grid_Technique &gt, // for berryphase
39+
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
40+
const Structure_Factor& sf, // for Wannier90
3741
const int istep)
3842
{
3943
ModuleBase::TITLE("ModuleIO", "ctrl_output_lcao");
@@ -161,13 +165,13 @@ void ctrl_output_lcao(UnitCell& ucell,
161165
hamilt::HS_Matrix_K<TK> hsk(&pv, true);
162166
hamilt::HContainer<TR> hR(&pv);
163167
hamilt::Operator<TK>* ekinetic
164-
= new hamilt::EkineticNew<hamilt::OperatorLCAO<TK, TR>>(&hsk,
165-
kv.kvec_d,
166-
&hR,
167-
&ucell,
168-
orb.cutoffs(),
169-
&gd,
170-
two_center_bundle.kinetic_orb.get());
168+
= new hamilt::EkineticNew<hamilt::OperatorLCAO<TK, TR>>(&hsk,
169+
kv.kvec_d,
170+
&hR,
171+
&ucell,
172+
orb.cutoffs(),
173+
&gd,
174+
two_center_bundle.kinetic_orb.get());
171175

172176
const int nspin_k = (nspin == 2 ? 2 : 1);
173177
for (int ik = 0; ik < kv.get_nks() / nspin_k; ++ik)
@@ -261,26 +265,8 @@ void ctrl_output_lcao(UnitCell& ucell,
261265
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Berry phase calculation");
262266
}
263267

264-
/*
265-
//------------------------------------------------------------------
266-
//! 12) Output quasi orbitals
267-
//------------------------------------------------------------------
268-
if (PARAM.inp.qo_switch)
269-
{
270-
toQO tqo(PARAM.inp.qo_basis, PARAM.inp.qo_strategy, PARAM.inp.qo_thr, PARAM.inp.qo_screening_coeff);
271-
tqo.initialize(global_out_dir,
272-
PARAM.inp.pseudo_dir,
273-
PARAM.inp.orbital_dir,
274-
&ucell,
275-
kv.kvec_d,
276-
GlobalV::ofs_running,
277-
GlobalV::MY_RANK,
278-
GlobalV::NPROC);
279-
tqo.calculate();
280-
}
281-
282268
//------------------------------------------------------------------
283-
//! 13) Wannier90 interface in LCAO basis
269+
//! 12) Wannier90 interface in LCAO basis
284270
// added by jingan in 2018.11.7
285271
//------------------------------------------------------------------
286272
if (PARAM.inp.calculation == "nscf" && PARAM.inp.towannier90)
@@ -314,34 +300,32 @@ void ctrl_output_lcao(UnitCell& ucell,
314300
}
315301
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Wave function to Wannier90");
316302
}
317-
*/
318303

319-
/*
320-
#ifdef __EXX
321304

305+
#ifdef __EXX
322306
//------------------------------------------------------------------
323-
//! Output Hexx matrix in LCAO basis
307+
//! 13) Output Hexx matrix in LCAO basis
324308
// (see `out_chg` in docs/advanced/input_files/input-main.md)
325309
//------------------------------------------------------------------
326310
if (PARAM.inp.out_chg[0])
327311
{
328312
if (GlobalC::exx_info.info_global.cal_exx && PARAM.inp.calculation != "nscf") // Peize Lin add if 2022.11.14
329313
{
330-
const std::string file_name_exx = PARAM.globalv.global_out_dir
314+
const std::string file_name_exx = global_out_dir
331315
+ "HexxR" + std::to_string(GlobalV::MY_RANK);
332316
if (GlobalC::exx_info.info_ri.real_number)
333317
{
334-
ModuleIO::write_Hexxs_csr(file_name_exx, ucell, this->exd->get_Hexxs());
318+
ModuleIO::write_Hexxs_csr(file_name_exx, ucell, exd->get_Hexxs());
335319
}
336320
else
337321
{
338-
ModuleIO::write_Hexxs_csr(file_name_exx, ucell, this->exc->get_Hexxs());
322+
ModuleIO::write_Hexxs_csr(file_name_exx, ucell, exc->get_Hexxs());
339323
}
340324
}
341325
}
342326

343327
//------------------------------------------------------------------
344-
// 17) Write RPA information in LCAO basis
328+
//! 14) Write RPA information in LCAO basis
345329
//------------------------------------------------------------------
346330
if (PARAM.inp.rpa)
347331
{
@@ -355,7 +339,6 @@ void ctrl_output_lcao(UnitCell& ucell,
355339
rpa_lri_double.out_for_RPA(ucell, pv, *psi, pelec);
356340
}
357341
#endif
358-
*/
359342

360343
/*
361344
//------------------------------------------------------------------
@@ -424,6 +407,8 @@ template void ModuleIO::ctrl_output_lcao<double, double>(UnitCell& ucell,
424407
const ModulePW::PW_Basis_K* pw_wfc, // for berryphase
425408
const ModulePW::PW_Basis* pw_rho, // for berryphase
426409
Grid_Technique &gt, // for berryphase
410+
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
411+
const Structure_Factor& sf, // for Wannier90
427412
const int istep);
428413

429414
// For multiple k-points
@@ -440,6 +425,8 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, double>(UnitCell&
440425
const ModulePW::PW_Basis_K* pw_wfc, // for berryphase
441426
const ModulePW::PW_Basis* pw_rho, // for berryphase
442427
Grid_Technique &gt, // for berryphase
428+
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
429+
const Structure_Factor& sf, // for Wannier90
443430
const int istep);
444431

445432
template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<double>>(UnitCell& ucell,
@@ -455,5 +442,7 @@ template void ModuleIO::ctrl_output_lcao<std::complex<double>, std::complex<doub
455442
const ModulePW::PW_Basis_K* pw_wfc, // for berryphase
456443
const ModulePW::PW_Basis* pw_rho, // for berryphase
457444
Grid_Technique &gt, // for berryphase
445+
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
446+
const Structure_Factor& sf, // for Wannier90
458447
const int istep);
459448

source/module_io/ctrl_output_lcao.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "module_basis/module_nao/two_center_bundle.h" // use TwoCenterBundle
1212
#include "module_hamilt_lcao/module_gint/gint_k.h" // use Gint_k
1313
#include "module_basis/module_pw/pw_basis_k.h" // use ModulePW::PW_Basis_K and ModulePW::PW_Basis
14+
#include "module_hamilt_pw/hamilt_pwdft/structure_factor.h" // use Structure_Factor
1415

1516
namespace ModuleIO
1617
{
@@ -29,6 +30,8 @@ namespace ModuleIO
2930
const ModulePW::PW_Basis_K* pw_wfc, // for berryphase
3031
const ModulePW::PW_Basis* pw_rho, // for berryphase
3132
Grid_Technique &gt, // for berryphase
33+
const ModulePW::PW_Basis_Big* pw_big, // for Wannier90
34+
const Structure_Factor& sf, // for Wannier90
3235
const int istep);
3336
}
3437
#endif

0 commit comments

Comments
 (0)