|
1 | 1 | #include "esolver_fp.h" |
2 | 2 |
|
3 | 3 | #include "module_base/global_variable.h" |
| 4 | +#include "module_elecstate/module_charge/symmetry_rho.h" |
4 | 5 | #include "module_hamilt_pw/hamilt_pwdft/global.h" |
| 6 | +#include "module_io/cif_io.h" |
5 | 7 | #include "module_io/cube_io.h" |
6 | 8 | #include "module_io/output_log.h" |
| 9 | +#include "module_io/print_info.h" |
| 10 | +#include "module_io/rhog_io.h" |
7 | 11 | #include "module_io/write_elecstat_pot.h" |
8 | 12 | #include "module_io/write_elf.h" |
9 | 13 | #include "module_parameter/parameter.h" |
10 | | -#include "module_io/rhog_io.h" |
11 | | -#include "module_io/cif_io.h" |
12 | | -#include "module_elecstate/module_charge/symmetry_rho.h" |
13 | 14 |
|
14 | 15 | namespace ModuleESolver |
15 | 16 | { |
@@ -116,7 +117,7 @@ void ESolver_FP::before_all_runners(const Input_para& inp, UnitCell& cell) |
116 | 117 | "data_?"); |
117 | 118 |
|
118 | 119 | //! 4) print some information |
119 | | - this->print_rhofft(inp, GlobalV::ofs_running); |
| 120 | + ModuleIO::print_rhofft(this->pw_rhod, this->pw_rho, this->pw_big, GlobalV::ofs_running); |
120 | 121 |
|
121 | 122 | //! 5) initialize the charge extrapolation method if necessary |
122 | 123 | this->CE.Init_CE(PARAM.inp.nspin, GlobalC::ucell.nat, this->pw_rhod->nrxx, inp.chg_extrap); |
@@ -357,135 +358,4 @@ void ESolver_FP::init_after_vc(const Input_para& inp, UnitCell& cell) |
357 | 358 | return; |
358 | 359 | } |
359 | 360 |
|
360 | | -void ESolver_FP::print_rhofft(const Input_para& inp, std::ofstream& ofs) |
361 | | -{ |
362 | | - std::cout << " UNIFORM GRID DIM : " << pw_rho->nx << " * " << pw_rho->ny << " * " << pw_rho->nz << std::endl; |
363 | | - std::cout << " UNIFORM GRID DIM(BIG) : " << pw_big->nbx << " * " << pw_big->nby << " * " << pw_big->nbz |
364 | | - << std::endl; |
365 | | - if ( PARAM.globalv.double_grid) |
366 | | - { |
367 | | - std::cout << " UNIFORM GRID DIM(DENSE) : " << pw_rhod->nx << " * " << pw_rhod->ny << " * " << pw_rhod->nz |
368 | | - << std::endl; |
369 | | - } |
370 | | - |
371 | | - ofs << "\n\n\n\n"; |
372 | | - ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" |
373 | | - ">>>>" |
374 | | - << std::endl; |
375 | | - ofs << " | " |
376 | | - " |" |
377 | | - << std::endl; |
378 | | - ofs << " | Setup plane waves of charge/potential: " |
379 | | - " |" |
380 | | - << std::endl; |
381 | | - ofs << " | Use the energy cutoff and the lattice vectors to generate the " |
382 | | - " |" |
383 | | - << std::endl; |
384 | | - ofs << " | dimensions of FFT grid. The number of FFT grid on each " |
385 | | - "processor |" |
386 | | - << std::endl; |
387 | | - ofs << " | is 'nrxx'. The number of plane wave basis in reciprocal space " |
388 | | - "is |" |
389 | | - << std::endl; |
390 | | - ofs << " | different for charege/potential and wave functions. We also set " |
391 | | - " |" |
392 | | - << std::endl; |
393 | | - ofs << " | the 'sticks' for the parallel of FFT. The number of plane waves " |
394 | | - " |" |
395 | | - << std::endl; |
396 | | - ofs << " | is 'npw' in each processor. " |
397 | | - " |" |
398 | | - << std::endl; |
399 | | - ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" |
400 | | - "<<<<" |
401 | | - << std::endl; |
402 | | - ofs << "\n\n\n\n"; |
403 | | - ofs << "\n SETUP THE PLANE WAVE BASIS" << std::endl; |
404 | | - |
405 | | - double ecut = 4 * PARAM.inp.ecutwfc; |
406 | | - if (inp.nx * inp.ny * inp.nz > 0) |
407 | | - { |
408 | | - ecut = this->pw_rho->gridecut_lat * this->pw_rho->tpiba2; |
409 | | - ofs << "use input fft dimensions for wave functions." << std::endl; |
410 | | - ofs << "calculate energy cutoff from nx, ny, nz:" << std::endl; |
411 | | - } |
412 | | - |
413 | | - ModuleBase::GlobalFunc::OUT(ofs, "energy cutoff for charge/potential (unit:Ry)", ecut); |
414 | | - |
415 | | - ModuleBase::GlobalFunc::OUT(ofs, |
416 | | - "fft grid for charge/potential", |
417 | | - this->pw_rho->nx, |
418 | | - this->pw_rho->ny, |
419 | | - this->pw_rho->nz); |
420 | | - ModuleBase::GlobalFunc::OUT(ofs, "fft grid division", pw_big->bx, pw_big->by, pw_big->bz); |
421 | | - ModuleBase::GlobalFunc::OUT(ofs, "big fft grid for charge/potential", pw_big->nbx, pw_big->nby, pw_big->nbz); |
422 | | - ModuleBase::GlobalFunc::OUT(ofs, "nbxx", pw_big->nbxx); |
423 | | - ModuleBase::GlobalFunc::OUT(ofs, "nrxx", this->pw_rho->nrxx); |
424 | | - |
425 | | - ofs << "\n SETUP PLANE WAVES FOR CHARGE/POTENTIAL" << std::endl; |
426 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of plane waves", this->pw_rho->npwtot); |
427 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of sticks", this->pw_rho->nstot); |
428 | | - |
429 | | - ofs << "\n PARALLEL PW FOR CHARGE/POTENTIAL" << std::endl; |
430 | | - ofs << " " << std::setw(8) << "PROC" << std::setw(15) << "COLUMNS(POT)" << std::setw(15) << "PW" << std::endl; |
431 | | - |
432 | | - for (int i = 0; i < GlobalV::NPROC_IN_POOL; ++i) |
433 | | - { |
434 | | - ofs << " " << std::setw(8) << i + 1 << std::setw(15) << this->pw_rho->nst_per[i] << std::setw(15) |
435 | | - << this->pw_rho->npw_per[i] << std::endl; |
436 | | - } |
437 | | - ofs << " --------------- sum -------------------" << std::endl; |
438 | | - ofs << " " << std::setw(8) << GlobalV::NPROC_IN_POOL << std::setw(15) << this->pw_rho->nstot << std::setw(15) |
439 | | - << this->pw_rho->npwtot << std::endl; |
440 | | - |
441 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of |g|", this->pw_rho->ngg); |
442 | | - ModuleBase::GlobalFunc::OUT(ofs, "max |g|", this->pw_rho->gg_uniq[this->pw_rho->ngg - 1]); |
443 | | - ModuleBase::GlobalFunc::OUT(ofs, "min |g|", this->pw_rho->gg_uniq[0]); |
444 | | - |
445 | | - if ( PARAM.globalv.double_grid) |
446 | | - { |
447 | | - ofs << std::endl; |
448 | | - ofs << std::endl; |
449 | | - ofs << std::endl; |
450 | | - double ecut = PARAM.inp.ecutrho; |
451 | | - if (inp.ndx * inp.ndy * inp.ndz > 0) |
452 | | - { |
453 | | - ecut = this->pw_rhod->gridecut_lat * this->pw_rhod->tpiba2; |
454 | | - ofs << "use input fft dimensions for the dense part of charge " |
455 | | - "density." |
456 | | - << std::endl; |
457 | | - ofs << "calculate energy cutoff from ndx, ndy, ndz:" << std::endl; |
458 | | - } |
459 | | - ModuleBase::GlobalFunc::OUT(ofs, "energy cutoff for dense charge/potential (unit:Ry)", ecut); |
460 | | - |
461 | | - ModuleBase::GlobalFunc::OUT(ofs, |
462 | | - "fft grid for dense charge/potential", |
463 | | - this->pw_rhod->nx, |
464 | | - this->pw_rhod->ny, |
465 | | - this->pw_rhod->nz); |
466 | | - |
467 | | - ModuleBase::GlobalFunc::OUT(ofs, "nrxx", this->pw_rhod->nrxx); |
468 | | - |
469 | | - ofs << "\n SETUP PLANE WAVES FOR dense CHARGE/POTENTIAL" << std::endl; |
470 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of plane waves", this->pw_rhod->npwtot); |
471 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of sticks", this->pw_rhod->nstot); |
472 | | - |
473 | | - ofs << "\n PARALLEL PW FOR dense CHARGE/POTENTIAL" << std::endl; |
474 | | - ofs << " " << std::setw(8) << "PROC" << std::setw(15) << "COLUMNS(POT)" << std::setw(15) << "PW" << std::endl; |
475 | | - |
476 | | - for (int i = 0; i < GlobalV::NPROC_IN_POOL; ++i) |
477 | | - { |
478 | | - ofs << " " << std::setw(8) << i + 1 << std::setw(15) << this->pw_rhod->nst_per[i] << std::setw(15) |
479 | | - << this->pw_rhod->npw_per[i] << std::endl; |
480 | | - } |
481 | | - ofs << " --------------- sum -------------------" << std::endl; |
482 | | - ofs << " " << std::setw(8) << GlobalV::NPROC_IN_POOL << std::setw(15) << this->pw_rhod->nstot << std::setw(15) |
483 | | - << this->pw_rhod->npwtot << std::endl; |
484 | | - |
485 | | - ModuleBase::GlobalFunc::OUT(ofs, "number of |g|", this->pw_rhod->ngg); |
486 | | - ModuleBase::GlobalFunc::OUT(ofs, "max |g|", this->pw_rhod->gg_uniq[this->pw_rhod->ngg - 1]); |
487 | | - ModuleBase::GlobalFunc::OUT(ofs, "min |g|", this->pw_rhod->gg_uniq[0]); |
488 | | - } |
489 | | -} |
490 | | - |
491 | 361 | } // namespace ModuleESolver |
0 commit comments