Skip to content

Commit e003633

Browse files
authored
Merge branch 'deepmodeling:develop' into hamilt
2 parents 4536ed1 + e555490 commit e003633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+518
-437
lines changed

source/module_esolver/esolver_gets.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ void ESolver_GetS::runner(UnitCell& ucell, const int istep)
136136
if (PARAM.inp.out_mat_r)
137137
{
138138
cal_r_overlap_R r_matrix;
139-
r_matrix.init(pv, orb_);
140-
r_matrix.out_rR(istep);
139+
r_matrix.init(ucell,pv, orb_);
140+
r_matrix.out_rR(ucell,istep);
141141
}
142142

143143
ModuleBase::timer::tick("ESolver_GetS", "runner");

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,8 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
920920
PARAM.inp.out_dm1,
921921
false,
922922
PARAM.inp.out_app_flag,
923+
ucell.get_iat2iwt(),
924+
&ucell.nat,
923925
istep);
924926

925927
//! 4) write density matrix
@@ -1228,7 +1230,8 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12281230
PARAM.inp.nnkpfile,
12291231
PARAM.inp.wannier_spin);
12301232

1231-
myWannier.calculate(this->pelec->ekb,
1233+
myWannier.calculate(ucell,
1234+
this->pelec->ekb,
12321235
this->pw_wfc,
12331236
this->pw_big,
12341237
this->sf,
@@ -1247,7 +1250,7 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12471250
PARAM.inp.wannier_spin,
12481251
orb_);
12491252

1250-
myWannier.calculate(this->pelec->ekb, this->kv, *(this->psi), &(this->pv));
1253+
myWannier.calculate(ucell,this->pelec->ekb, this->kv, *(this->psi), &(this->pv));
12511254
}
12521255
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Wave function to Wannier90");
12531256
}
@@ -1259,12 +1262,13 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep)
12591262
{
12601263
std::cout << FmtCore::format("\n * * * * * *\n << Start %s.\n", "Berry phase calculation");
12611264
berryphase bp(&(this->pv));
1262-
bp.lcao_init(this->kv,
1265+
bp.lcao_init(ucell,
1266+
this->kv,
12631267
this->GridT,
12641268
orb_); // additional step before calling
12651269
// macroscopic_polarization (why capitalize
12661270
// the function name?)
1267-
bp.Macroscopic_polarization(this->pw_wfc->npwk_max, this->psi, this->pw_rho, this->pw_wfc, this->kv);
1271+
bp.Macroscopic_polarization(ucell,this->pw_wfc->npwk_max, this->psi, this->pw_rho, this->pw_wfc, this->kv);
12681272
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Berry phase calculation");
12691273
}
12701274
}

source/module_esolver/esolver_ks_lcao_tddft.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,16 @@ void ESolver_KS_LCAO_TDDFT::after_scf(UnitCell& ucell, const int istep)
287287
{
288288
std::stringstream ss_dipole;
289289
ss_dipole << PARAM.globalv.global_out_dir << "SPIN" << is + 1 << "_DIPOLE";
290-
ModuleIO::write_dipole(pelec->charge->rho_save[is], pelec->charge->rhopw, is, istep, ss_dipole.str());
290+
ModuleIO::write_dipole(ucell,pelec->charge->rho_save[is], pelec->charge->rhopw, is, istep, ss_dipole.str());
291291
}
292292
}
293293
if (TD_Velocity::out_current == true)
294294
{
295295
elecstate::DensityMatrix<std::complex<double>, double>* tmp_DM
296296
= dynamic_cast<elecstate::ElecStateLCAO<std::complex<double>>*>(this->pelec)->get_DM();
297297

298-
ModuleIO::write_current(istep,
298+
ModuleIO::write_current(ucell,
299+
istep,
299300
this->psi,
300301
pelec,
301302
kv,

source/module_esolver/esolver_ks_pw.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep)
585585
PARAM.inp.out_wannier_wvfn_formatted,
586586
PARAM.inp.nnkpfile,
587587
PARAM.inp.wannier_spin);
588-
589-
wan.calculate(this->pelec->ekb, this->pw_wfc, this->pw_big, this->kv, this->psi);
588+
wan.set_tpiba_omega(ucell.tpiba, ucell.omega);
589+
wan.calculate(ucell,this->pelec->ekb, this->pw_wfc, this->pw_big, this->kv, this->psi);
590590
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Wannier functions calculation");
591591
}
592592

@@ -595,7 +595,7 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep)
595595
{
596596
std::cout << FmtCore::format("\n * * * * * *\n << Start %s.\n", "Berry phase polarization");
597597
berryphase bp;
598-
bp.Macroscopic_polarization(this->pw_wfc->npwk_max, this->psi, this->pw_rho, this->pw_wfc, this->kv);
598+
bp.Macroscopic_polarization(ucell,this->pw_wfc->npwk_max, this->psi, this->pw_rho, this->pw_wfc, this->kv);
599599
std::cout << FmtCore::format(" >> Finish %s.\n * * * * * *\n", "Berry phase polarization");
600600
}
601601
}
@@ -783,7 +783,7 @@ void ESolver_KS_PW<T, Device>::after_all_runners(UnitCell& ucell)
783783
//! 6) Print out electronic wave functions in real space
784784
if (PARAM.inp.out_wfc_r == 1) // Peize Lin add 2021.11.21
785785
{
786-
ModuleIO::write_psi_r_1(this->psi[0], this->pw_wfc, "wfc_realspace", true, this->kv);
786+
ModuleIO::write_psi_r_1(ucell,this->psi[0], this->pw_wfc, "wfc_realspace", true, this->kv);
787787
}
788788

789789
//! 7) Use Kubo-Greenwood method to compute conductivities

source/module_esolver/lcao_others.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
4848
if (cal_type == "test_memory")
4949
{
5050
std::cout << FmtCore::format("\n * * * * * *\n << Start %s.\n", "testing memory");
51-
Cal_Test::test_memory(this->pw_rho,
51+
Cal_Test::test_memory(ucell.nat,
52+
ucell.ntype,
53+
ucell.GGT,
54+
this->pw_rho,
5255
this->pw_wfc,
5356
this->p_chgmix->get_mixing_mode(),
5457
this->p_chgmix->get_mixing_ndim());
@@ -324,7 +327,8 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
324327
IState_Envelope IEP(this->pelec);
325328
if (PARAM.globalv.gamma_only_local)
326329
{
327-
IEP.begin(this->psi,
330+
IEP.begin(ucell,
331+
this->psi,
328332
this->pw_rhod,
329333
this->pw_wfc,
330334
this->pw_big,
@@ -344,7 +348,8 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
344348
}
345349
else
346350
{
347-
IEP.begin(this->psi,
351+
IEP.begin(ucell,
352+
this->psi,
348353
this->pw_rhod,
349354
this->pw_wfc,
350355
this->pw_big,

source/module_esolver/pw_others.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,17 @@ void ESolver_KS_PW<T, Device>::others(UnitCell& ucell, const int istep)
5656
const std::string cal_type = PARAM.inp.calculation;
5757

5858
if (cal_type == "test_memory") {
59-
Cal_Test::test_memory(this->pw_rho,
59+
Cal_Test::test_memory(ucell.nat,
60+
ucell.ntype,
61+
ucell.GGT,
62+
this->pw_rho,
6063
this->pw_wfc,
6164
this->p_chgmix->get_mixing_mode(),
6265
this->p_chgmix->get_mixing_ndim());
6366
} else if (cal_type == "gen_bessel") {
6467
Numerical_Descriptor nc;
65-
nc.output_descriptor(this->psi[0],
68+
nc.output_descriptor(ucell,
69+
this->psi[0],
6670
PARAM.inp.bessel_descriptor_lmax,
6771
PARAM.inp.bessel_descriptor_rcut,
6872
PARAM.inp.bessel_descriptor_tolerence,

source/module_hamilt_lcao/module_gint/gint_gamma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Gint_Gamma : public Gint
3636

3737
//! in gint_gamma_env.cpp
3838
//! calcualte the electronic wave functions via grid integral
39-
void cal_env(const double* wfc, double* rho,UnitCell &ucell);
39+
void cal_env(const double* wfc, double* rho,const UnitCell &ucell);
4040

4141
//! transfer this->hRGint to Veff::hR
4242
void transfer_pvpR(hamilt::HContainer<double>* hR,const UnitCell* ucell);

source/module_hamilt_lcao/module_gint/gint_gamma_env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "module_basis/module_ao/ORB_read.h"
77
#include "module_hamilt_pw/hamilt_pwdft/global.h"
88

9-
void Gint_Gamma::cal_env(const double* wfc, double* rho, UnitCell& ucell)
9+
void Gint_Gamma::cal_env(const double* wfc, double* rho,const UnitCell& ucell)
1010
{
1111
ModuleBase::TITLE("Grid_Integral", "cal_env");
1212

source/module_hamilt_lcao/module_gint/gint_k.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Gint_k : public Gint {
6565
double* rho,
6666
const std::vector<ModuleBase::Vector3<double>>& kvec_c,
6767
const std::vector<ModuleBase::Vector3<double>>& kvec_d,
68-
UnitCell& ucell);
68+
const UnitCell& ucell);
6969

7070
//------------------------------------------------------
7171
// in gint_k_sparse1.cpp

source/module_hamilt_lcao/module_gint/gint_k_env.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void Gint_k::cal_env_k(int ik,
1313
double* rho,
1414
const std::vector<ModuleBase::Vector3<double>>& kvec_c,
1515
const std::vector<ModuleBase::Vector3<double>>& kvec_d,
16-
UnitCell& ucell)
16+
const UnitCell& ucell)
1717
{
1818
ModuleBase::TITLE("Gint_k", "cal_env_k");
1919
ModuleBase::timer::tick("Gint_k", "cal_env_k");

0 commit comments

Comments
 (0)