Skip to content

Commit b158b78

Browse files
committed
change ucell in module_ri/exx_opt-print.hpp
1 parent 22a95ef commit b158b78

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

source/module_ri/exx_opt_orb-print.cpp

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "exx_abfs-jle.h"
44

55
void Exx_Opt_Orb::print_matrix(
6+
const UnitCell& ucell,
67
const K_Vectors &kv,
78
const std::string& file_name,
89
const std::vector<RI::Tensor<double>> &matrix_Q,
@@ -15,47 +16,47 @@ void Exx_Opt_Orb::print_matrix(
1516
{
1617
auto print_header = [&]( std::ofstream &ofs )
1718
{
18-
ofs << GlobalC::ucell.lat0 << std::endl;
19+
ofs << ucell.lat0 << std::endl;
1920

20-
ofs << GlobalC::ucell.latvec.e11 << " " << GlobalC::ucell.latvec.e12 << " " << GlobalC::ucell.latvec.e13 << std::endl;
21-
ofs << GlobalC::ucell.latvec.e21 << " " << GlobalC::ucell.latvec.e22 << " " << GlobalC::ucell.latvec.e23 << std::endl;
22-
ofs << GlobalC::ucell.latvec.e31 << " " << GlobalC::ucell.latvec.e32 << " " << GlobalC::ucell.latvec.e33 << std::endl;
21+
ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << std::endl;
22+
ofs << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << std::endl;
23+
ofs << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << std::endl;
2324

2425
if( TA==TB )
2526
{
2627
ofs << 1 << " ntype" << std::endl;
27-
ofs << GlobalC::ucell.atoms[TA].label << " label" << std::endl;
28+
ofs << ucell.atoms[TA].label << " label" << std::endl;
2829
if( IA==IB )
2930
{
3031
ofs << 1 << " na" << std::endl;
31-
ofs << GlobalC::ucell.atoms[TA].tau[IA].x << " "
32-
<< GlobalC::ucell.atoms[TA].tau[IA].y << " "
33-
<< GlobalC::ucell.atoms[TA].tau[IA].z << std::endl;
32+
ofs << ucell.atoms[TA].tau[IA].x << " "
33+
<< ucell.atoms[TA].tau[IA].y << " "
34+
<< ucell.atoms[TA].tau[IA].z << std::endl;
3435
}
3536
else
3637
{
3738
ofs << 2 << " na" << std::endl;
38-
ofs << GlobalC::ucell.atoms[TA].tau[IA].x << " "
39-
<< GlobalC::ucell.atoms[TA].tau[IA].y << " "
40-
<< GlobalC::ucell.atoms[TA].tau[IA].z << std::endl;
41-
ofs << GlobalC::ucell.atoms[TB].tau[IB].x << " "
42-
<< GlobalC::ucell.atoms[TB].tau[IB].y << " "
43-
<< GlobalC::ucell.atoms[TB].tau[IB].z << std::endl;
39+
ofs << ucell.atoms[TA].tau[IA].x << " "
40+
<< ucell.atoms[TA].tau[IA].y << " "
41+
<< ucell.atoms[TA].tau[IA].z << std::endl;
42+
ofs << ucell.atoms[TB].tau[IB].x << " "
43+
<< ucell.atoms[TB].tau[IB].y << " "
44+
<< ucell.atoms[TB].tau[IB].z << std::endl;
4445
}
4546
}
4647
else
4748
{
4849
ofs << 2 << " ntype" << std::endl;
49-
ofs << GlobalC::ucell.atoms[TA].label << " label" << std::endl;
50+
ofs << ucell.atoms[TA].label << " label" << std::endl;
5051
ofs << 1 << " na" << std::endl;
51-
ofs << GlobalC::ucell.atoms[TA].tau[IA].x << " "
52-
<< GlobalC::ucell.atoms[TA].tau[IA].y << " "
53-
<< GlobalC::ucell.atoms[TA].tau[IA].z << std::endl;
54-
ofs << GlobalC::ucell.atoms[TB].label << " label" << std::endl;
52+
ofs << ucell.atoms[TA].tau[IA].x << " "
53+
<< ucell.atoms[TA].tau[IA].y << " "
54+
<< ucell.atoms[TA].tau[IA].z << std::endl;
55+
ofs << ucell.atoms[TB].label << " label" << std::endl;
5556
ofs << 1 << " na" << std::endl;
56-
ofs << GlobalC::ucell.atoms[TB].tau[IB].x << " "
57-
<< GlobalC::ucell.atoms[TB].tau[IB].y << " "
58-
<< GlobalC::ucell.atoms[TB].tau[IB].z << std::endl;
57+
ofs << ucell.atoms[TB].tau[IB].x << " "
58+
<< ucell.atoms[TB].tau[IB].y << " "
59+
<< ucell.atoms[TB].tau[IB].z << std::endl;
5960
}
6061

6162
// ecutwfc_jlq determine the jlq corresponding to plane wave calculation.

source/module_ri/exx_opt_orb.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
208208
{ms_jys_abfs.at(T).at(I).at(T).at(I)},
209209
ms_abfs_abfs_I,
210210
{ms_jys_abfs.at(T).at(I).at(T).at(I)})}};
211-
print_matrix(kv,
211+
print_matrix(ucell,
212+
kv,
212213
"matrix",
213214
m_lcaoslcaos_jys_proj,
214215
m_jys_jys_proj,
@@ -219,7 +220,8 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
219220
}
220221
else
221222
{
222-
print_matrix(kv,
223+
print_matrix(ucell,
224+
kv,
223225
"matrix",
224226
ms_lcaoslcaos_jys.at(T).at(I).at(T).at(I),
225227
{{ms_jys_jys.at(T).at(I).at(T).at(I)}},
@@ -276,7 +278,8 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
276278
{ ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) },
277279
ms_abfs_abfs_I,
278280
{ ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) }) }};
279-
print_matrix(kv,
281+
print_matrix(ucell,
282+
kv,
280283
"matrix",
281284
m_lcaoslcaos_jys_proj,
282285
m_jys_jys_proj,
@@ -287,7 +290,8 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
287290
}
288291
else
289292
{
290-
print_matrix(kv,
293+
print_matrix(ucell,
294+
kv,
291295
"matrix",
292296
ms_lcaoslcaos_jys.at(TA).at(IA).at(TB).at(IB),
293297
{{ms_jys_jys.at(TA).at(IA).at(TA).at(IA), ms_jys_jys.at(TA).at(IA).at(TB).at(IB)},

source/module_ri/exx_opt_orb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Exx_Opt_Orb
2424
const std::vector<std::vector<RI::Tensor<double>>> & m_middle,
2525
const std::vector<RI::Tensor<double>> & m_right ) const;
2626
void print_matrix(
27+
const UnitCell& ucell,
2728
const K_Vectors &kv,
2829
const std::string& file_name,
2930
const std::vector<RI::Tensor<double>> &matrix_Q,

0 commit comments

Comments
 (0)