Skip to content

Commit 4b23da0

Browse files
committed
change HRGint to hr_gint
1 parent 312699d commit 4b23da0

File tree

11 files changed

+102
-102
lines changed

11 files changed

+102
-102
lines changed

source/module_hamilt_lcao/module_gint/temp_gint/gint_common.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
namespace ModuleGint
77
{
88

9-
void compose_hRGint(std::shared_ptr<HContainer<double>> hRGint)
9+
void compose_hr_gint(std::shared_ptr<HContainer<double>> hr_gint)
1010
{
11-
for (int iap = 0; iap < hRGint->size_atom_pairs(); iap++)
11+
for (int iap = 0; iap < hr_gint->size_atom_pairs(); iap++)
1212
{
13-
auto& ap = hRGint->get_atom_pair(iap);
13+
auto& ap = hr_gint->get_atom_pair(iap);
1414
const int iat1 = ap.get_atom_i();
1515
const int iat2 = ap.get_atom_j();
1616
if (iat1 > iat2)
1717
{
1818
// fill lower triangle matrix with upper triangle matrix
1919
// the upper <IJR> is <iat2, iat1>
20-
const hamilt::AtomPair<double>* upper_ap = hRGint->find_pair(iat2, iat1);
21-
const hamilt::AtomPair<double>* lower_ap = hRGint->find_pair(iat1, iat2);
20+
const hamilt::AtomPair<double>* upper_ap = hr_gint->find_pair(iat2, iat1);
21+
const hamilt::AtomPair<double>* lower_ap = hr_gint->find_pair(iat1, iat2);
2222
#ifdef __DEBUG
2323
assert(upper_ap != nullptr);
2424
#endif
@@ -39,20 +39,20 @@ void compose_hRGint(std::shared_ptr<HContainer<double>> hRGint)
3939
}
4040
}
4141

42-
void compose_hRGint(std::vector<std::shared_ptr<HContainer<double>>> hRGint_part,
43-
std::shared_ptr<HContainer<std::complex<double>>> hRGint_full)
42+
void compose_hr_gint(std::vector<std::shared_ptr<HContainer<double>>> hr_gint_part,
43+
std::shared_ptr<HContainer<std::complex<double>>> hr_gint_full)
4444
{
45-
for (int iap = 0; iap < hRGint_full->size_atom_pairs(); iap++)
45+
for (int iap = 0; iap < hr_gint_full->size_atom_pairs(); iap++)
4646
{
47-
auto* ap = &hRGint_full->get_atom_pair(iap);
47+
auto* ap = &hr_gint_full->get_atom_pair(iap);
4848
const int iat1 = ap->get_atom_i();
4949
const int iat2 = ap->get_atom_j();
5050
if (iat1 <= iat2)
5151
{
5252
hamilt::AtomPair<std::complex<double>>* upper_ap = ap;
53-
hamilt::AtomPair<std::complex<double>>* lower_ap = hRGint_full->find_pair(iat2, iat1);
54-
const hamilt::AtomPair<double>* ap_nspin_0 = hRGint_part[0]->find_pair(iat1, iat2);
55-
const hamilt::AtomPair<double>* ap_nspin_3 = hRGint_part[3]->find_pair(iat1, iat2);
53+
hamilt::AtomPair<std::complex<double>>* lower_ap = hr_gint_full->find_pair(iat2, iat1);
54+
const hamilt::AtomPair<double>* ap_nspin_0 = hr_gint_part[0]->find_pair(iat1, iat2);
55+
const hamilt::AtomPair<double>* ap_nspin_3 = hr_gint_part[3]->find_pair(iat1, iat2);
5656
for (int ir = 0; ir < upper_ap->get_R_size(); ir++)
5757
{
5858
const auto R_index = upper_ap->get_R_index(ir);
@@ -72,8 +72,8 @@ void compose_hRGint(std::vector<std::shared_ptr<HContainer<double>>> hRGint_part
7272

7373
if (PARAM.globalv.domag)
7474
{
75-
const hamilt::AtomPair<double>* ap_nspin_1 = hRGint_part[1]->find_pair(iat1, iat2);
76-
const hamilt::AtomPair<double>* ap_nspin_2 = hRGint_part[2]->find_pair(iat1, iat2);
75+
const hamilt::AtomPair<double>* ap_nspin_1 = hr_gint_part[1]->find_pair(iat1, iat2);
76+
const hamilt::AtomPair<double>* ap_nspin_2 = hr_gint_part[2]->find_pair(iat1, iat2);
7777
const auto mat_nspin_1 = ap_nspin_1->find_matrix(R_index);
7878
const auto mat_nspin_2 = ap_nspin_2->find_matrix(R_index);
7979
for (int irow = 0; irow < mat_nspin_1->get_row_size(); ++irow)
@@ -104,21 +104,21 @@ void compose_hRGint(std::vector<std::shared_ptr<HContainer<double>>> hRGint_part
104104
}
105105

106106
template <typename T>
107-
void transfer_hRGint_to_hR(std::shared_ptr<const HContainer<T>> hRGint, HContainer<T>* hR)
107+
void transfer_hr_gint_to_hR(std::shared_ptr<const HContainer<T>> hr_gint, HContainer<T>* hR)
108108
{
109109
#ifdef __MPI
110110
int size = 0;
111111
MPI_Comm_size(MPI_COMM_WORLD, &size);
112112
if (size == 1)
113113
{
114-
hR->add(*hRGint);
114+
hR->add(*hr_gint);
115115
}
116116
else
117117
{
118-
hamilt::transferSerials2Parallels(*hRGint, hR);
118+
hamilt::transferSerials2Parallels(*hr_gint, hR);
119119
}
120120
#else
121-
hR->add(*hRGint);
121+
hR->add(*hr_gint);
122122
#endif
123123
}
124124

@@ -191,6 +191,6 @@ void transfer_dm_2d_to_gint(
191191
}
192192

193193

194-
template void transfer_hRGint_to_hR(std::shared_ptr<const HContainer<double>> hRGint, HContainer<double>* hR);
195-
template void transfer_hRGint_to_hR(std::shared_ptr<const HContainer<std::complex<double>>> hRGint, HContainer<std::complex<double>>* hR);
194+
template void transfer_hr_gint_to_hR(std::shared_ptr<const HContainer<double>> hr_gint, HContainer<double>* hR);
195+
template void transfer_hr_gint_to_hR(std::shared_ptr<const HContainer<std::complex<double>>> hr_gint, HContainer<std::complex<double>>* hR);
196196
}

source/module_hamilt_lcao/module_gint/temp_gint/gint_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace ModuleGint
66
{
77
// fill the lower triangle matrix with the upper triangle matrix
8-
void compose_hRGint(std::shared_ptr<HContainer<double>> hRGint);
8+
void compose_hr_gint(std::shared_ptr<HContainer<double>> hr_gint);
99
// for nspin=4 case
10-
void compose_hRGint(std::vector<std::shared_ptr<HContainer<double>>> hRGint_part,
11-
std::shared_ptr<HContainer<std::complex<double>>> hRGint_full);
10+
void compose_hr_gint(std::vector<std::shared_ptr<HContainer<double>>> hr_gint_part,
11+
std::shared_ptr<HContainer<std::complex<double>>> hr_gint_full);
1212

1313
template <typename T>
14-
void transfer_hRGint_to_hR(std::shared_ptr<const HContainer<T>> hRGint, HContainer<T>* hR);
14+
void transfer_hr_gint_to_hR(std::shared_ptr<const HContainer<T>> hr_gint, HContainer<T>* hR);
1515

1616
void transfer_dm_2d_to_gint(
1717
std::shared_ptr<const GintInfo> gint_info,

source/module_hamilt_lcao/module_gint/temp_gint/gint_info.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void GintInfo::init_atoms_(int ntype, const Atom* atoms, const Numerical_Orbital
142142

143143
void GintInfo::init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd)
144144
{
145-
HContainer<double> hRGint_local(ucell.nat);
145+
HContainer<double> hr_gint_local(ucell.nat);
146146
// prepare the row_index and col_index for construct AtomPairs, they are
147147
// same, name as orb_index
148148
std::vector<int> orb_index(ucell.nat + 1);
@@ -166,7 +166,7 @@ void GintInfo::init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd)
166166
const int iat2 = ucell.itia2iat(T2, I2);
167167
const Atom* atom2 = &(ucell.atoms[T2]);
168168

169-
// NOTE: hRGint wil save total number of atom pairs,
169+
// NOTE: hr_gint wil save total number of atom pairs,
170170
// if only upper triangle is saved, the lower triangle will
171171
// be lost in 2D-block parallelization. if the adjacent atom
172172
// is in this processor.
@@ -186,7 +186,7 @@ void GintInfo::init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd)
186186
if (distance < rcut - 1.0e-15) {
187187
// calculate R index
188188
auto& R_index = gd.getBox(ad);
189-
// insert this atom-pair into this->hRGint
189+
// insert this atom-pair into this->hr_gint
190190
hamilt::AtomPair<double> tmp_atom_pair(
191191
iat1,
192192
iat2,
@@ -196,14 +196,14 @@ void GintInfo::init_ijr_info_(const UnitCell& ucell, Grid_Driver& gd)
196196
orb_index.data(),
197197
orb_index.data(),
198198
ucell.nat);
199-
hRGint_local.insert_pair(tmp_atom_pair);
199+
hr_gint_local.insert_pair(tmp_atom_pair);
200200
}
201201
}
202202
}
203203
}
204204
}
205205
}
206-
this->ijr_info_ = hRGint_local.get_ijr_info();
206+
this->ijr_info_ = hr_gint_local.get_ijr_info();
207207
return;
208208
}
209209

source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ namespace ModuleGint
99

1010
void Gint_vl::cal_gint()
1111
{
12-
init_hRGint_();
13-
cal_hRGint_();
14-
compose_hRGint(hRGint_);
15-
transfer_hRGint_to_hR(toConstSharedPtr(hRGint_), hR_);
12+
init_hr_gint_();
13+
cal_hr_gint_();
14+
compose_hr_gint(hr_gint_);
15+
transfer_hr_gint_to_hR(toConstSharedPtr(hr_gint_), hR_);
1616
}
1717

1818
//========================
1919
// Private functions
2020
//========================
2121

22-
void Gint_vl::init_hRGint_()
22+
void Gint_vl::init_hr_gint_()
2323
{
24-
hRGint_ = gint_info_->get_hr<double>();
24+
hr_gint_ = gint_info_->get_hr<double>();
2525
}
2626

27-
void Gint_vl::cal_hRGint_()
27+
void Gint_vl::cal_hr_gint_()
2828
{
2929
// be careful!!
30-
// each thread will have a copy of hRGint_, this may cause a lot of memory usage
30+
// each thread will have a copy of hr_gint_, this may cause a lot of memory usage
3131
#pragma omp parallel
3232
{
3333
PhiOperator phi_op;
3434
std::vector<double> phi;
3535
std::vector<double> phi_vldr3;
36-
HContainer<double> hRGint_local(*hRGint_);
36+
HContainer<double> hr_gint_local(*hr_gint_);
3737
#pragma omp for schedule(dynamic)
3838
for(const auto& biggrid: gint_info_->get_biggrids())
3939
{
@@ -47,12 +47,12 @@ void Gint_vl::cal_hRGint_()
4747
phi_vldr3.resize(phi_len);
4848
phi_op.set_phi(phi.data());
4949
phi_op.phi_mul_vldr3(vr_eff_, dr3_, phi.data(), phi_vldr3.data());
50-
phi_op.phi_mul_phi_vldr3(phi.data(), phi_vldr3.data(), &hRGint_local);
50+
phi_op.phi_mul_phi_vldr3(phi.data(), phi_vldr3.data(), &hr_gint_local);
5151
}
5252
#pragma omp critical
5353
{
54-
BlasConnector::axpy(hRGint_local.get_nnr(), 1.0, hRGint_local.get_wrapper(),
55-
1, hRGint_->get_wrapper(), 1);
54+
BlasConnector::axpy(hr_gint_local.get_nnr(), 1.0, hr_gint_local.get_wrapper(),
55+
1, hr_gint_->get_wrapper(), 1);
5656
}
5757
}
5858
}

source/module_hamilt_lcao/module_gint/temp_gint/gint_vl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class Gint_vl : public Gint
2121

2222
private:
2323

24-
void init_hRGint_();
24+
void init_hr_gint_();
2525

2626
// note that only the upper triangle matrix of hR is calculated
27-
// that's why we need compose_hRGint() to fill the lower triangle matrix.
28-
void cal_hRGint_();
27+
// that's why we need compose_hr_gint() to fill the lower triangle matrix.
28+
void cal_hr_gint_();
2929

3030
// input
3131
const double* vr_eff_;
@@ -38,7 +38,7 @@ class Gint_vl : public Gint
3838
//========================
3939
double dr3_;
4040

41-
std::shared_ptr<HContainer<double>> hRGint_;
41+
std::shared_ptr<HContainer<double>> hr_gint_;
4242
};
4343

4444
}

source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ namespace ModuleGint
99

1010
void Gint_vl_metagga::cal_gint()
1111
{
12-
init_hRGint_();
13-
cal_hRGint_();
14-
compose_hRGint(hRGint_);
15-
transfer_hRGint_to_hR(toConstSharedPtr(hRGint_), hR_);
12+
init_hr_gint_();
13+
cal_hr_gint_();
14+
compose_hr_gint(hr_gint_);
15+
transfer_hr_gint_to_hR(toConstSharedPtr(hr_gint_), hR_);
1616
}
1717

1818
//========================
1919
// Private functions
2020
//========================
2121

22-
void Gint_vl_metagga::init_hRGint_()
22+
void Gint_vl_metagga::init_hr_gint_()
2323
{
24-
hRGint_ = gint_info_->get_hr<double>();
24+
hr_gint_ = gint_info_->get_hr<double>();
2525
}
2626

27-
void Gint_vl_metagga::cal_hRGint_()
27+
void Gint_vl_metagga::cal_hr_gint_()
2828
{
2929
// be careful!!
30-
// each thread will have a copy of hRGint_, this may cause a lot of memory usage
30+
// each thread will have a copy of hr_gint_, this may cause a lot of memory usage
3131
#pragma omp parallel
3232
{
3333
PhiOperator phi_op;
@@ -39,7 +39,7 @@ void Gint_vl_metagga::cal_hRGint_()
3939
std::vector<double> dphi_x_vldr3;
4040
std::vector<double> dphi_y_vldr3;
4141
std::vector<double> dphi_z_vldr3;
42-
HContainer<double> hRGint_local(*hRGint_);
42+
HContainer<double> hr_gint_local(*hr_gint_);
4343
#pragma omp for schedule(dynamic)
4444
for(const auto& biggrid: gint_info_->get_biggrids())
4545
{
@@ -62,15 +62,15 @@ void Gint_vl_metagga::cal_hRGint_()
6262
phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_x.data(), dphi_x_vldr3.data());
6363
phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_y.data(), dphi_y_vldr3.data());
6464
phi_op.phi_mul_vldr3(vofk_, dr3_, dphi_z.data(), dphi_z_vldr3.data());
65-
phi_op.phi_mul_phi_vldr3(phi.data(), phi_vldr3.data(), &hRGint_local);
66-
phi_op.phi_mul_phi_vldr3(dphi_x.data(), dphi_x_vldr3.data(), &hRGint_local);
67-
phi_op.phi_mul_phi_vldr3(dphi_y.data(), dphi_y_vldr3.data(), &hRGint_local);
68-
phi_op.phi_mul_phi_vldr3(dphi_z.data(), dphi_z_vldr3.data(), &hRGint_local);
65+
phi_op.phi_mul_phi_vldr3(phi.data(), phi_vldr3.data(), &hr_gint_local);
66+
phi_op.phi_mul_phi_vldr3(dphi_x.data(), dphi_x_vldr3.data(), &hr_gint_local);
67+
phi_op.phi_mul_phi_vldr3(dphi_y.data(), dphi_y_vldr3.data(), &hr_gint_local);
68+
phi_op.phi_mul_phi_vldr3(dphi_z.data(), dphi_z_vldr3.data(), &hr_gint_local);
6969
}
7070
#pragma omp critical
7171
{
72-
BlasConnector::axpy(hRGint_local.get_nnr(), 1.0, hRGint_local.get_wrapper(),
73-
1, hRGint_->get_wrapper(), 1);
72+
BlasConnector::axpy(hr_gint_local.get_nnr(), 1.0, hr_gint_local.get_wrapper(),
73+
1, hr_gint_->get_wrapper(), 1);
7474
}
7575
}
7676
}

source/module_hamilt_lcao/module_gint/temp_gint/gint_vl_metagga.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class Gint_vl_metagga : public Gint
2222

2323
private:
2424

25-
void init_hRGint_();
25+
void init_hr_gint_();
2626

2727
// note that only the upper triangle matrix of hR is calculated
28-
// that's why we need compose_hRGint() to fill the lower triangle matrix.
29-
void cal_hRGint_();
28+
// that's why we need compose_hr_gint() to fill the lower triangle matrix.
29+
void cal_hr_gint_();
3030

3131
// input
3232
const double* vr_eff_;
@@ -40,7 +40,7 @@ class Gint_vl_metagga : public Gint
4040
//========================
4141
double dr3_;
4242

43-
std::shared_ptr<HContainer<double>> hRGint_;
43+
std::shared_ptr<HContainer<double>> hr_gint_;
4444

4545
};
4646

0 commit comments

Comments
 (0)