@@ -17,7 +17,7 @@ Bessel_Basis::~Bessel_Basis()
1717
1818
1919// the function is called in numerical_basis.
20- void Bessel_Basis::init (
20+ void Bessel_Basis::init (
2121 const bool start_from_file,
2222 const double &ecutwfc,
2323 const int &ntype,
@@ -57,7 +57,7 @@ void Bessel_Basis::init(
5757// GlobalV::ofs_running << "\n" << TableOne.ptr[i];
5858// }
5959
60- if ( start_from_file )
60+ if ( start_from_file )
6161 {
6262 // setup C4
6363 this ->allocate_C4 (ntype, lmax_in, GlobalC::ucell.nmax , Ecut_number);
@@ -80,7 +80,7 @@ double Bessel_Basis::Polynomial_Interpolation2
8080 const int iq = static_cast <int >(position);
8181 /*
8282 if(iq >= kmesh-4)
83- {
83+ {
8484 std::cout << "\n iq = " << iq;
8585 std::cout << "\n kmesh = " << kmesh;
8686 ModuleBase::QUIT();
@@ -117,7 +117,7 @@ double Bessel_Basis::Polynomial_Interpolation(
117117 return y;
118118}
119119
120- void Bessel_Basis::init_Faln (
120+ void Bessel_Basis::init_Faln (
121121 const int &ntype,
122122 const int &lmax,
123123 const int &nmax,
@@ -195,7 +195,7 @@ void Bessel_Basis::init_TableOne(
195195 double *g = new double [rmesh]; // smooth function
196196 double *function = new double [rmesh];
197197 double *en = new double [ecut_number];
198-
198+
199199 for (int ir=0 ; ir<rmesh; ir++)
200200 {
201201 r[ir] = static_cast <double >(ir) * dr;
@@ -205,7 +205,7 @@ void Bessel_Basis::init_TableOne(
205205 g[ir] = 1.0 - std::exp (-( (r[ir]-rcut)*(r[ir]-rcut)/2.0 /sigma_in/sigma_in ) );
206206 }
207207 }
208-
208+
209209 // caoyu add 2021-3-10
210210 // =========output .orb format=============
211211 std::stringstream ss;
@@ -215,9 +215,9 @@ void Bessel_Basis::init_TableOne(
215215 ofs << std::setiosflags (ios::left) << std::setw (28 ) << " Energy Cutoff(Ry)" << ecut << std::endl;
216216 ofs << std::setiosflags (ios::left) << std::setw (28 ) << " Radius Cutoff(a.u.)" << rcut << std::endl;
217217 ofs << std::setiosflags (ios::left) << std::setw (28 ) << " Lmax" << lmax << std::endl;
218- for (int l = 0 ; l < lmax + 1 ; l++)
218+ for (int l = 0 ; l < lmax + 1 ; l++)
219219 {
220- switch (l)
220+ switch (l)
221221 {
222222 case 0 :
223223 ofs << std::setiosflags (ios::left) << std::setw (28 ) << " Number of Sorbitals-->" << ecut_number << std::endl;
@@ -250,25 +250,25 @@ void Bessel_Basis::init_TableOne(
250250
251251 // calculate eigenvalue for l
252252 ModuleBase::Sphbes::Spherical_Bessel_Roots (ecut_number, l, tolerence, en, rcut);
253- // for (int ie=0; ie<ecut_number; ie++)
253+ // for (int ie=0; ie<ecut_number; ie++)
254254// {
255255// std::cout << "\n en[" << ie << "]=" << en[ie];
256256// }
257257
258258 // for each eigenvalue
259259 for (int ie=0 ; ie<ecut_number; ie++)
260260 {
261- // calculate J_{l}( en[ir]*r)
261+ // calculate J_{l}( en[ir]*r)
262262 ModuleBase::Sphbes::Spherical_Bessel (rmesh, r, en[ie], l, jle);
263263
264264 // caoyu add 2021-3-10
265265 // =========output .orb format=============
266266 ofs << std::setiosflags (ios::right) << std::setw (20 ) << " Type" << std::setw (20 ) << " L" << std::setw (20 ) << " N" << std::endl;
267267 ofs << std::setiosflags (ios::right) << std::setw (20 ) << " 0" << std::setw (20 ) << l << std::setw (20 ) << ie << std::endl;
268- for (int ir = 0 ; ir < rmesh; ir++)
269- {
270- ofs << std::setiosflags (ios::scientific)
271- << std::setprecision (12 ) << jle[ir]<< " " ; if ((ir+1 ) % 4 == 0 ) ofs << std::endl;
268+ for (int ir = 0 ; ir < rmesh; ir++)
269+ {
270+ ofs << std::setiosflags (ios::scientific)
271+ << std::setprecision (12 ) << jle[ir]<< " " ; if ((ir+1 ) % 4 == 0 ) ofs << std::endl;
272272 }
273273 ofs << std::endl;
274274 // =========output .orb format=============
@@ -283,7 +283,7 @@ void Bessel_Basis::init_TableOne(
283283// ss << GlobalV::global_out_dir << l << "." << ie << ".txt";
284284// std::ofstream ofs(ss.str().c_str());
285285
286- // for(int ir=0; ir<rmesh; ir++) ofs << r[ir] << " " << jle[ir] << " " << jle[ir]*g[ir] << std::endl;
286+ // for(int ir=0; ir<rmesh; ir++) ofs << r[ir] << " " << jle[ir] << " " << jle[ir]*g[ir] << std::endl;
287287
288288// ofs.close();
289289 // ====== output ========
@@ -296,7 +296,7 @@ void Bessel_Basis::init_TableOne(
296296 jle[ir] *= g[ir];
297297 }
298298 }
299-
299+
300300 for (int ik=0 ; ik<kmesh; ik++)
301301 {
302302 // calculate J_{l}( ik*dk*r )
@@ -307,15 +307,15 @@ void Bessel_Basis::init_TableOne(
307307 {
308308 function[ir] = jle[ir] * jlk[ir];
309309 }
310-
310+
311311 // make table value
312312 ModuleBase::Integral::Simpson_Integral (rmesh, function, rab, this ->TableOne (l, ie, ik) );
313313 }
314-
314+
315315 }// end ie
316316 }// end ;
317-
318- if (ofs)
317+
318+ if (ofs)
319319 {
320320 ofs.close (); // caoyu add 2020-3-10
321321 }
@@ -345,7 +345,7 @@ void Bessel_Basis::readin_C4(
345345
346346 std::ifstream ifs ( name.c_str () );
347347
348- if (!ifs)
348+ if (!ifs)
349349 {
350350 GlobalV::ofs_warning << " File name : " << name << std::endl;
351351 ModuleBase::WARNING_QUIT (" Bessel_Basis::readin_C4" ," Can not find file." );
@@ -366,8 +366,8 @@ void Bessel_Basis::readin_C4(
366366 // std::cout << "\n" << std::setw(5) << it << std::setw(5) << il << std::setw(5) << in;
367367 // std::cout << "\n file=" << filec4;
368368 std::ifstream inc4 ( filec4.c_str () );
369-
370- if (!inc4)
369+
370+ if (!inc4)
371371 {
372372 GlobalV::ofs_warning << " File name : " << filec4 << std::endl;
373373 ModuleBase::WARNING_QUIT (" Bessel_Basis::readin_C4" ," Can not find file." );
@@ -377,16 +377,16 @@ void Bessel_Basis::readin_C4(
377377 {
378378 double tmp_ecut;
379379 double tmp_rcut;
380- double tmp_enumber;
380+ double tmp_enumber;
381381 double tmp_tolerence;
382- ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_ecut);
383- ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_rcut);
384- ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_enumber);
385- ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_tolerence);
386- assert ( tmp_ecut = this ->ecut );
387- assert ( tmp_rcut = this ->rcut );
388- assert ( tmp_enumber = this ->Ecut_number );
389- assert ( tmp_tolerence = this ->tolerence );
382+ ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_ecut);
383+ ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_rcut);
384+ ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_enumber);
385+ ModuleBase::GlobalFunc::READ_VALUE ( inc4, tmp_tolerence);
386+ assert ( tmp_ecut == this ->ecut );
387+ assert ( tmp_rcut == this ->rcut );
388+ assert ( tmp_enumber == this ->Ecut_number );
389+ assert ( tmp_tolerence == this ->tolerence );
390390 }
391391
392392 bool find = false ;
@@ -403,7 +403,7 @@ void Bessel_Basis::readin_C4(
403403 int tmp_type, tmp_l, tmp_n;
404404 inc4 >> tmp_type >> tmp_l >> tmp_n;
405405 // std::cout << "\n Find T=" << tmp_type << " L=" << tmp_l << " N=" << tmp_n;
406-
406+
407407 if (tmp_l == il && tmp_n == in)
408408 // if(tmp_type == it && tmp_l == il && tmp_n == in) // mohan modify 2009-11-29
409409 {
@@ -443,12 +443,12 @@ void Bessel_Basis::readin_C4(
443443
444444void Bessel_Basis::allocate_C4 (
445445 const int &ntype,
446- const int &lmax,
446+ const int &lmax,
447447 const int &nmax,
448448 const int &ecut_number)
449449{
450450 ModuleBase::TITLE (" Bessel_Basis" ," allocate_C4" );
451-
451+
452452 this ->C4 .create (ntype, lmax+1 , nmax, ecut_number);
453453
454454 for (int it=0 ; it<ntype; it++)
@@ -471,7 +471,7 @@ void Bessel_Basis::bcast(void)
471471{
472472#ifdef __MPI
473473 ModuleBase::TITLE (" Bessel_Basis" , " bcast" );
474-
474+
475475 Parallel_Common::bcast_double ( ecut );
476476 Parallel_Common::bcast_double ( rcut );
477477 Parallel_Common::bcast_double ( tolerence );
@@ -513,7 +513,7 @@ void Bessel_Basis::readin(const std::string &name)
513513 ifs.close ();
514514 }
515515#ifdef __MPI
516- Parallel_Common::bcast_bool (smooth);
516+ Parallel_Common::bcast_bool (smooth);
517517 Parallel_Common::bcast_double (sigma);
518518 Parallel_Common::bcast_double (ecut);
519519 Parallel_Common::bcast_double (rcut);
0 commit comments