Skip to content

Commit 9bb0813

Browse files
committed
change ucell in module_ri/exx_opt.cpp
1 parent b158b78 commit 9bb0813

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

source/module_ri/exx_opt_orb.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
5353
// ofs_mpi<<range_abfs<<std::endl;
5454
// ofs_mpi<<range_jys<<std::endl;
5555

56-
std::map<size_t,std::map<size_t,std::set<double>>> radial_R = get_radial_R();
56+
std::map<size_t,std::map<size_t,std::set<double>>> radial_R = get_radial_R(ucell);
5757
#if TEST_EXX_RADIAL==2
5858
{
5959
for(const auto & rA : radial_R)
@@ -172,13 +172,13 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
172172
// ofs_matrixes(GlobalC::exx_lcao.test_dir.matrix+"ms_lcaoslcaos_abfs",ms_lcaoslcaos_abfs);
173173
// ofs_matrixes(GlobalC::exx_lcao.test_dir.matrix+"ms_jys_abfs",ms_jys_abfs);
174174

175-
for( size_t TA=0; TA!=GlobalC::ucell.ntype; ++TA )
175+
for( size_t TA=0; TA!=ucell.ntype; ++TA )
176176
{
177-
for( size_t IA=0; IA!=GlobalC::ucell.atoms[TA].na; ++IA )
177+
for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA )
178178
{
179-
for( size_t TB=0; TB!=GlobalC::ucell.ntype; ++TB )
179+
for( size_t TB=0; TB!=ucell.ntype; ++TB )
180180
{
181-
for( size_t IB=0; IB!=GlobalC::ucell.atoms[TB].na; ++IB )
181+
for( size_t IB=0; IB!=ucell.atoms[TB].na; ++IB )
182182
{
183183
if( TA==TB && IA==IB )
184184
{
@@ -358,23 +358,23 @@ std::vector<std::vector<RI::Tensor<double>>> Exx_Opt_Orb::cal_I(
358358
}
359359
}
360360

361-
std::map<size_t,std::map<size_t,std::set<double>>> Exx_Opt_Orb::get_radial_R() const
361+
std::map<size_t,std::map<size_t,std::set<double>>> Exx_Opt_Orb::get_radial_R(const UnitCell& ucell) const
362362
{
363363
ModuleBase::TITLE("Exx_Opt_Orb::get_radial_R");
364364
std::map<size_t,std::map<size_t,std::set<double>>> radial_R;
365-
for( size_t TA=0; TA!=GlobalC::ucell.ntype; ++TA ) {
366-
for( size_t IA=0; IA!=GlobalC::ucell.atoms[TA].na; ++IA ) {
367-
for( size_t TB=0; TB!=GlobalC::ucell.ntype; ++TB ) {
368-
for( size_t IB=0; IB!=GlobalC::ucell.atoms[TB].na; ++IB )
365+
for( size_t TA=0; TA!=ucell.ntype; ++TA ) {
366+
for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA ) {
367+
for( size_t TB=0; TB!=ucell.ntype; ++TB ) {
368+
for( size_t IB=0; IB!=ucell.atoms[TB].na; ++IB )
369369
{
370-
const ModuleBase::Vector3<double> &tauA = GlobalC::ucell.atoms[TA].tau[IA];
371-
const ModuleBase::Vector3<double> &tauB = GlobalC::ucell.atoms[TB].tau[IB];
370+
const ModuleBase::Vector3<double> &tauA = ucell.atoms[TA].tau[IA];
371+
const ModuleBase::Vector3<double> &tauB = ucell.atoms[TB].tau[IB];
372372
const double delta_R = (-tauA+tauB).norm();
373373
radial_R[TA][TB].insert( delta_R );
374374
radial_R[TB][TA].insert( delta_R );
375375
}
376-
}
377-
}
378-
}
376+
}
377+
}
378+
}
379379
return radial_R;
380380
}

source/module_ri/exx_opt_orb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Exx_Opt_Orb
3434
const std::vector<double>& orb_cutoff,
3535
const ModuleBase::Element_Basis_Index::Range &range_jles,
3636
const ModuleBase::Element_Basis_Index::IndexLNM &index_jles) const;
37-
std::map<size_t,std::map<size_t,std::set<double>>> get_radial_R() const;
37+
std::map<size_t,std::map<size_t,std::set<double>>> get_radial_R(const UnitCell& ucell) const;
3838

3939
int kmesh_times = 4;
4040
};

0 commit comments

Comments
 (0)