Skip to content

Commit 33539b5

Browse files
committed
update Exx_Opt_Orb::print_matrix()
1 parent 2a12722 commit 33539b5

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

source/module_ri/exx_opt_orb-print.cpp

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ void Exx_Opt_Orb::print_matrix(
1414
const ModuleBase::Element_Basis_Index::Range &range_jles,
1515
const ModuleBase::Element_Basis_Index::IndexLNM &index_jles)
1616
{
17-
auto print_header = [&]( std::ofstream &ofs )
17+
std::ofstream ofs(file_name+"_"+std::to_string(TA)+"_"+std::to_string(IA)+"_"+std::to_string(TB)+"_"+std::to_string(IB));
18+
constexpr double scale = 1.0;
19+
20+
//---------------------
21+
// header
22+
//---------------------
1823
{
1924
ofs << GlobalC::ucell.lat0 << std::endl;
2025

@@ -108,14 +113,13 @@ void Exx_Opt_Orb::print_matrix(
108113
ofs << "</WEIGHT_OF_KPOINTS>" << std::endl;
109114

110115
ofs << std::endl;
111-
};
116+
}
112117

113118

114-
auto print_Q = [&]( std::ofstream &ofs )
119+
//---------------------
120+
// < Psi | jY >
121+
//---------------------
115122
{
116-
//---------------------
117-
// < Psi | jY >
118-
//---------------------
119123
ofs<< "<OVERLAP_Q>" << std::endl;
120124

121125
for( size_t iw0=0; iw0!=matrix_V.shape[0]; ++iw0 )
@@ -140,14 +144,13 @@ void Exx_Opt_Orb::print_matrix(
140144
}
141145

142146
ofs<< "</OVERLAP_Q>" << std::endl << std::endl;
143-
};
147+
}
144148

145149

146-
auto print_S = [&]( std::ofstream &ofs, const double scale=1 )
150+
//---------------------
151+
// < jY | jY >
152+
//---------------------
147153
{
148-
//---------------------
149-
// < jY | jY >
150-
//---------------------
151154
ofs<< "<OVERLAP_Sq>" <<std::endl;
152155

153156
for( size_t iat1=0; iat1!=matrix_S.size(); ++iat1 )
@@ -179,14 +182,12 @@ void Exx_Opt_Orb::print_matrix(
179182
}
180183

181184
ofs<< "</OVERLAP_Sq>" << std::endl << std::endl;
182-
};
183-
185+
}
184186

185-
auto print_V = [&]( std::ofstream &ofs, const double scale=1 )
187+
//---------------------
188+
// < Psi | Psi >
189+
//---------------------
186190
{
187-
//---------------------
188-
// < Psi | Psi >
189-
//---------------------
190191
ofs << "<OVERLAP_V>" << std::endl;
191192

192193
for( size_t iw0=0; iw0!=matrix_V.shape[0]; ++iw0 )
@@ -205,12 +206,5 @@ void Exx_Opt_Orb::print_matrix(
205206
}
206207

207208
ofs << "</OVERLAP_V>" << std::endl << std::endl;
208-
};
209-
210-
std::ofstream ofs(file_name+"_"+std::to_string(TA)+"_"+std::to_string(IA)+"_"+std::to_string(TB)+"_"+std::to_string(IB));
211-
print_header(ofs);
212-
print_Q(ofs);
213-
print_S(ofs);
214-
print_V(ofs);
215-
ofs.close();
209+
}
216210
}

0 commit comments

Comments
 (0)