@@ -18,26 +18,26 @@ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::constr
1818{
1919 std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs ( files_abfs.size () );
2020 for ( size_t T=0 ; T!=files_abfs.size (); ++T )
21- abfs[T] = construct_abfs_T (
21+ abfs[T] = construct_abfs_T (
2222 files_abfs[T],
2323 T,
2424 static_cast <int >(orbs.get_kmesh () * kmesh_times) | 1 , // Nk must be odd
2525// orbs.get_dk() / kmesh_times,
2626 orbs.get_dk (), // Peize Lin change 2017-04-16
27- orbs.get_dr_uniform () );
28-
27+ orbs.get_dr_uniform () );
28+
2929 return abfs;
3030}
3131
32- std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::construct_abfs (
32+ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::construct_abfs (
3333 const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> & abfs_pre,
3434 const LCAO_Orbitals &orbs,
3535 const std::vector<std::string> &files_abfs,
3636 const double kmesh_times )
3737{
38- std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
38+ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>
3939 &&abfs = construct_abfs ( orbs, files_abfs, kmesh_times );
40-
40+
4141 assert ( abfs.size () == abfs_pre.size () );
4242 for ( size_t T=0 ; T!=abfs.size (); ++T )
4343 {
@@ -47,12 +47,12 @@ std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> Exx_Abfs::IO::constr
4747 {
4848 abfs[T][L].insert ( abfs[T][L].begin (), abfs_pre[T][L].begin (), abfs_pre[T][L].end () );
4949 }
50- }
51-
50+ }
51+
5252 return abfs;
5353}
5454
55- std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T (
55+ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T (
5656 const std::string & file_name,
5757 const int &T,
5858 const int &nk,
@@ -65,28 +65,28 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
6565 size_t meshr;
6666 double dr;
6767 std::map<size_t ,std::map<size_t ,std::vector<double >>> psis;
68-
68+
6969 /* ----------------------
7070 1.read abfs
7171 ----------------------*/
7272 std::string word;
73-
73+
7474 std::ifstream ifs ( file_name.c_str () );
7575 if (!ifs)
76- throw std::runtime_error (" Can't find the abfs ORBITAL file." );
77-
76+ throw std::runtime_error (" Can't find the abfs ORBITAL file." );
77+
7878 while ( ifs.good () )
7979 {
8080 ifs >> word;
81-
81+
8282 if ( " Element" ==word )
8383 {
8484 ModuleBase::GlobalFunc::READ_VALUE ( ifs, label );
8585 }
8686 else if ( " Lmax" ==word )
8787 {
8888 ModuleBase::GlobalFunc::READ_VALUE ( ifs, L_size );
89-
89+
9090 if ( L_size>=9 )
9191 {
9292 std::stringstream ss;
@@ -133,12 +133,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
133133 else if ( " END" ==word )
134134 {
135135 break ;
136- }
136+ }
137137 }
138-
138+
139139 ModuleBase::CHECK_NAME (ifs, " Mesh" );
140140 ifs >> meshr;
141-
141+
142142 ModuleBase::CHECK_NAME (ifs, " dr" );
143143 ifs >> dr;
144144
@@ -149,21 +149,21 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
149149 {
150150 std::string s_L, s_N;
151151 ifs >> s_L >> s_N;
152-
152+
153153 size_t T,L,N;
154154 ifs >> T >> L >> N;
155-
155+
156156 psis[L][N].resize (meshr);
157157 for (int ir=0 ; ir!=meshr; ir++)
158158 {
159159 ifs >> psis[L][N][ir];
160- }
160+ }
161161 }
162162
163163 }
164164 ifs.close ();
165165
166-
166+
167167 /* ----------------------
168168 2.check L,N orbital
169169 ----------------------*/
@@ -183,12 +183,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
183183 throw std::domain_error (ss.str ());
184184 }
185185
186-
186+
187187 /* ----------------------
188188 3.rab, radial
189- ----------------------*/
189+ ----------------------*/
190190 if (meshr%2 ==0 ) ++meshr;
191-
191+
192192 std::vector<double > rab (meshr);
193193 std::vector<double > radial (meshr);
194194 for ( int ir=0 ; ir!=meshr; ++ir )
@@ -197,12 +197,12 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
197197 radial[ir] = ir*dr; // mohan 2010-04-19
198198 }
199199
200-
200+
201201 /* ----------------------
202202 4.normalize psi
203203 ----------------------*/
204204 for ( size_t L=0 ; L<=L_size; ++L )
205- {
205+ {
206206 for ( size_t N=0 ; N!=N_size[L]; ++N )
207207 {
208208 std::vector<double > psir (meshr);
@@ -213,7 +213,7 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
213213 psir[ir] = psis[L][N][ir] * radial[ir];
214214 inner[ir] = psir[ir] * psir[ir];
215215 }
216- double unit = 0.0 ;
216+ double unit = 0.0 ;
217217 ModuleBase::Integral::Simpson_Integral (meshr, ModuleBase::GlobalFunc::VECTOR_TO_PTR (inner), ModuleBase::GlobalFunc::VECTOR_TO_PTR (rab), unit);
218218 for ( int ir=0 ; ir!=meshr; ++ir )
219219 {
@@ -222,10 +222,10 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
222222 }
223223 }
224224
225-
225+
226226 /* ----------------------
227227 5.construct abfs
228- ----------------------*/
228+ ----------------------*/
229229 std::vector<std::vector<Numerical_Orbital_Lm>> abfs_T;
230230
231231 abfs_T.resize (L_size+1 );
@@ -248,9 +248,9 @@ std::vector<std::vector<Numerical_Orbital_Lm>> Exx_Abfs::IO::construct_abfs_T(
248248 dk,
249249 dr_uniform,
250250 false ,
251- true , PARAM.inp .cal_force );
251+ true , PARAM.inp .cal_force );
252252 }
253253 }
254-
254+
255255 return abfs_T;
256256}
0 commit comments