Skip to content

Commit ea19823

Browse files
committed
change ucell in Matrix.cpp
1 parent 372de4c commit ea19823

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

source/module_ri/Matrix_Orbs11.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Matrix_Orbs11
6363

6464
template <typename Tdata>
6565
std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, RI::Tensor<Tdata>>>>> cal_overlap_matrix_all(
66+
const UnitCell &ucell,
6667
const ModuleBase::Element_Basis_Index::IndexLNM& index_r,
6768
const ModuleBase::Element_Basis_Index::IndexLNM& index_c) const;
6869

source/module_ri/Matrix_Orbs11.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ std::array<RI::Tensor<Tdata>,3> Matrix_Orbs11::cal_grad_overlap_matrix(
126126

127127
template <typename Tdata>
128128
std::map<size_t,std::map<size_t,std::map<size_t,std::map<size_t,RI::Tensor<Tdata>>>>> Matrix_Orbs11::cal_overlap_matrix_all(
129+
const UnitCell &ucell,
129130
const ModuleBase::Element_Basis_Index::IndexLNM &index_r,
130131
const ModuleBase::Element_Basis_Index::IndexLNM &index_c ) const
131132
{
@@ -136,16 +137,16 @@ std::map<size_t,std::map<size_t,std::map<size_t,std::map<size_t,RI::Tensor<Tdata
136137
for( const auto &co1 : center2_orb11_s )
137138
{
138139
const size_t TA = co1.first;
139-
for (size_t IA=0; IA!=GlobalC::ucell.atoms[TA].na; ++IA)
140+
for (size_t IA=0; IA!=ucell.atoms[TA].na; ++IA)
140141
{
141-
const ModuleBase::Vector3<double> &tauA( GlobalC::ucell.atoms[TA].tau[IA] );
142+
const ModuleBase::Vector3<double> &tauA( ucell.atoms[TA].tau[IA] );
142143

143144
for( const auto &co2 : co1.second )
144145
{
145146
const size_t TB = co2.first;
146-
for (size_t IB=0; IB!=GlobalC::ucell.atoms[TB].na; ++IB)
147+
for (size_t IB=0; IB!=ucell.atoms[TB].na; ++IB)
147148
{
148-
const ModuleBase::Vector3<double> &tauB( GlobalC::ucell.atoms[TB].tau[IB] );
149+
const ModuleBase::Vector3<double> &tauB( ucell.atoms[TB].tau[IB] );
149150

150151
matrixes[TA][IA][TB][IB] = cal_overlap_matrix<Tdata>( TA, TB, tauA, tauB, index_r, index_c, Matrix_Order::AB );
151152
}

source/module_ri/Matrix_Orbs21.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ class Matrix_Orbs21
7070

7171
template <typename Tdata>
7272
std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, std::vector<RI::Tensor<Tdata>>>>>>
73-
cal_overlap_matrix_all(const ModuleBase::Element_Basis_Index::IndexLNM& index_A1,
73+
cal_overlap_matrix_all(const UnitCell& ucell,
74+
const ModuleBase::Element_Basis_Index::IndexLNM& index_A1,
7475
const ModuleBase::Element_Basis_Index::IndexLNM& index_A2,
7576
const ModuleBase::Element_Basis_Index::IndexLNM& index_B) const;
7677

source/module_ri/Matrix_Orbs21.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ std::array<RI::Tensor<Tdata>,3> Matrix_Orbs21::cal_grad_overlap_matrix(
170170

171171
template <typename Tdata>
172172
std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, std::vector<RI::Tensor<Tdata>>>>>> Matrix_Orbs21::cal_overlap_matrix_all(
173+
const UnitCell &ucell,
173174
const ModuleBase::Element_Basis_Index::IndexLNM &index_A1,
174175
const ModuleBase::Element_Basis_Index::IndexLNM &index_A2,
175176
const ModuleBase::Element_Basis_Index::IndexLNM &index_B) const

source/module_ri/Matrix_Orbs22.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class Matrix_Orbs22
9393

9494
template <typename Tdata>
9595
std::map<size_t, std::map<size_t, std::map<size_t, std::map<size_t, RI::Tensor<Tdata>>>>> cal_overlap_matrix_all(
96+
const UnitCell &ucell,
9697
const ModuleBase::Element_Basis_Index::IndexLNM& index_A1,
9798
const ModuleBase::Element_Basis_Index::IndexLNM& index_A2,
9899
const ModuleBase::Element_Basis_Index::IndexLNM& index_B1,

source/module_ri/Matrix_Orbs22.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ std::array<RI::Tensor<Tdata>,3> Matrix_Orbs22::cal_grad_overlap_matrix(
275275
// 4-parameter interface, for opt_orb
276276
template<typename Tdata>
277277
std::map < size_t, std::map<size_t, std::map<size_t, std::map<size_t, RI::Tensor<Tdata>>>>> Matrix_Orbs22::cal_overlap_matrix_all(
278+
const UnitCell &ucell,
278279
const ModuleBase::Element_Basis_Index::IndexLNM &index_A1,
279280
const ModuleBase::Element_Basis_Index::IndexLNM &index_A2,
280281
const ModuleBase::Element_Basis_Index::IndexLNM &index_B1,

source/module_ri/exx_opt_orb.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
8080
#else
8181
m_lcaoslcaos_lcaoslcaos.init_radial_table();
8282
#endif
83-
return m_lcaoslcaos_lcaoslcaos.cal_overlap_matrix_all<double>( index_lcaos, index_lcaos, index_lcaos, index_lcaos);
83+
return m_lcaoslcaos_lcaoslcaos.cal_overlap_matrix_all<double>(ucell,index_lcaos, index_lcaos, index_lcaos, index_lcaos);
8484
}();
8585

8686
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;
@@ -96,7 +96,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
9696
#else
9797
m_jyslcaos_lcaos.init_radial_table();
9898
#endif
99-
return m_jyslcaos_lcaos.cal_overlap_matrix_all<double>( index_jys, index_lcaos, index_lcaos );
99+
return m_jyslcaos_lcaos.cal_overlap_matrix_all<double>(ucell,index_jys, index_lcaos, index_lcaos );
100100
}();
101101

102102
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;
@@ -112,7 +112,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
112112
#else
113113
m_jys_jys.init_radial_table();
114114
#endif
115-
return m_jys_jys.cal_overlap_matrix_all<double>( index_jys, index_jys );
115+
return m_jys_jys.cal_overlap_matrix_all<double>(ucell,index_jys, index_jys );
116116
}();
117117

118118
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;
@@ -128,7 +128,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
128128
#else
129129
m_abfs_abfs.init_radial_table();
130130
#endif
131-
return m_abfs_abfs.cal_overlap_matrix_all<double>( index_abfs, index_abfs );
131+
return m_abfs_abfs.cal_overlap_matrix_all<double>(ucell,index_abfs, index_abfs );
132132
}();
133133

134134
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;
@@ -144,7 +144,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
144144
#else
145145
m_abfslcaos_lcaos.init_radial_table();
146146
#endif
147-
return m_abfslcaos_lcaos.cal_overlap_matrix_all<double>( index_abfs, index_lcaos, index_lcaos );
147+
return m_abfslcaos_lcaos.cal_overlap_matrix_all<double>(ucell,index_abfs, index_lcaos, index_lcaos );
148148
}();
149149

150150
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;
@@ -160,7 +160,7 @@ void Exx_Opt_Orb::generate_matrix(const K_Vectors &kv, const UnitCell& ucell, co
160160
#else
161161
m_jys_abfs.init_radial_table();
162162
#endif
163-
return m_jys_abfs.cal_overlap_matrix_all<double>( index_jys, index_abfs );
163+
return m_jys_abfs.cal_overlap_matrix_all<double>(ucell,index_jys, index_abfs );
164164
}();
165165

166166
// ofs_mpi<<"memory:\t"<<get_memory(10)<<std::endl;

0 commit comments

Comments
 (0)