|
1 | 1 | #include "esolver_ks.h" |
2 | 2 |
|
3 | 3 | #include <ctime> |
| 4 | +#include <iostream> |
4 | 5 | #ifdef __MPI |
5 | 6 | #include <mpi.h> |
6 | 7 | #else |
|
9 | 10 | #include "module_base/timer.h" |
10 | 11 | #include "module_cell/cal_atoms_info.h" |
11 | 12 | #include "module_io/json_output/init_info.h" |
| 13 | +#include "module_io/json_output/output_info.h" |
12 | 14 | #include "module_io/output_log.h" |
13 | 15 | #include "module_io/print_info.h" |
14 | 16 | #include "module_io/write_istate_info.h" |
15 | 17 | #include "module_parameter/parameter.h" |
16 | | - |
17 | | -#include <iostream> |
18 | 18 | //--------------Temporary---------------- |
19 | 19 | #include "module_base/global_variable.h" |
20 | 20 | #include "module_hamilt_lcao/module_dftu/dftu.h" |
|
24 | 24 | #include "module_base/parallel_common.h" |
25 | 25 | #include "module_cell/module_paw/paw_cell.h" |
26 | 26 | #endif |
27 | | -#include "module_io/json_output/output_info.h" |
28 | 27 |
|
29 | 28 | namespace ModuleESolver |
30 | 29 | { |
@@ -628,7 +627,7 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell) |
628 | 627 | { |
629 | 628 | dkin = p_chgmix->get_dkin(pelec->charge, PARAM.inp.nelec); |
630 | 629 | } |
631 | | - this->print_iter(iter, drho, dkin, duration, diag_ethr); |
| 630 | + this->pelec->print_etot(this->conv_esolver, iter, drho, dkin, duration, PARAM.inp.printe, diag_ethr); |
632 | 631 |
|
633 | 632 | // 12) Json, need to be moved to somewhere else |
634 | 633 | #ifdef __RAPIDJSON |
@@ -659,23 +658,12 @@ void ESolver_KS<T, Device>::runner(const int istep, UnitCell& ucell) |
659 | 658 | } |
660 | 659 | } // end scf iterations |
661 | 660 | std::cout << " >> Leave SCF iteration.\n * * * * * *" << std::endl; |
662 | | -#ifdef __RAPIDJSON |
663 | | - // 14) add Json of efermi energy converge |
664 | | - Json::add_output_efermi_converge(this->pelec->eferm.ef * ModuleBase::Ry_to_eV, this->conv_esolver); |
665 | | -#endif //__RAPIDJSON |
666 | 661 |
|
667 | 662 | // 15) after scf |
668 | 663 | ModuleBase::timer::tick(this->classname, "after_scf"); |
669 | 664 | this->after_scf(istep); |
670 | 665 | ModuleBase::timer::tick(this->classname, "after_scf"); |
671 | 666 |
|
672 | | - // 16) Json again |
673 | | -#ifdef __RAPIDJSON |
674 | | - // add nkstot,nkstot_ibz to output json |
675 | | - int Jnkstot = this->pelec->klist->get_nkstot(); |
676 | | - Json::add_nkstot(Jnkstot); |
677 | | -#endif //__RAPIDJSON |
678 | | - |
679 | 667 | ModuleBase::timer::tick(this->classname, "runner"); |
680 | 668 | return; |
681 | 669 | }; |
@@ -707,40 +695,13 @@ void ESolver_KS<T, Device>::after_scf(const int istep) |
707 | 695 | { |
708 | 696 | this->pelec->print_eigenvalue(GlobalV::ofs_running); |
709 | 697 | } |
710 | | -} |
711 | | - |
712 | | -//------------------------------------------------------------------------------ |
713 | | -//! the 8th function of ESolver_KS: print_iter |
714 | | -//! mohan add 2024-05-12 |
715 | | -//------------------------------------------------------------------------------ |
716 | | -template <typename T, typename Device> |
717 | | -void ESolver_KS<T, Device>::print_iter(const int iter, |
718 | | - const double drho, |
719 | | - const double dkin, |
720 | | - const double duration, |
721 | | - const double ethr) |
722 | | -{ |
723 | | - this->pelec->print_etot(this->conv_esolver, iter, drho, dkin, duration, PARAM.inp.printe, ethr); |
724 | | -} |
725 | | - |
726 | | -//------------------------------------------------------------------------------ |
727 | | -//! the 10th function of ESolver_KS: getnieter |
728 | | -//! mohan add 2024-05-12 |
729 | | -//------------------------------------------------------------------------------ |
730 | | -template <typename T, typename Device> |
731 | | -int ESolver_KS<T, Device>::get_niter() |
732 | | -{ |
733 | | - return this->niter; |
734 | | -} |
735 | | - |
736 | | -//------------------------------------------------------------------------------ |
737 | | -//! the 11th function of ESolver_KS: get_maxniter |
738 | | -//! tqzhao add 2024-05-15 |
739 | | -//------------------------------------------------------------------------------ |
740 | | -template <typename T, typename Device> |
741 | | -int ESolver_KS<T, Device>::get_maxniter() |
742 | | -{ |
743 | | - return this->maxniter; |
| 698 | + // #ifdef __RAPIDJSON |
| 699 | + // // add Json of efermi energy converge |
| 700 | + // Json::add_output_efermi_converge(this->pelec->eferm.ef * ModuleBase::Ry_to_eV, this->conv_esolver); |
| 701 | + // // add nkstot,nkstot_ibz to output json |
| 702 | + // int Jnkstot = this->pelec->klist->get_nkstot(); |
| 703 | + // Json::add_nkstot(Jnkstot); |
| 704 | + // #endif //__RAPIDJSON |
744 | 705 | } |
745 | 706 |
|
746 | 707 | //------------------------------------------------------------------------------ |
|
0 commit comments