@@ -12,20 +12,16 @@ namespace ModuleIO
1212{
1313
1414template <typename TK>
15- Output_Mulliken<TK>::Output_Mulliken(Parallel_Orbitals* pv,
16- hamilt::Hamilt<TK>* p_ham,
17- const K_Vectors& kv,
18- const elecstate::ElecStateLCAO<TK>* pelec,
19- const UnitCell& ucell,
20- const int nspin)
15+ Output_Mulliken<TK>::Output_Mulliken(Output_Sk<TK>* output_sk,
16+ Output_DMK<TK>* output_dmk,
17+ Parallel_Orbitals* ParaV,
18+ CellIndex* cell_index,
19+ const std::vector<int >& isk,
20+ int nspin)
21+ : output_sk_(output_sk), output_dmk_(output_dmk), ParaV_(ParaV), cell_index_(cell_index), isk_(isk), nspin_(nspin)
2122{
22- this ->cell_index_
23- = new CellIndex (ucell.get_atomLabels (), ucell.get_atomCounts (), ucell.get_lnchiCounts (), PARAM.inp .nspin );
24- this ->output_sk_ = new ModuleIO::Output_Sk<TK>(p_ham, pv, PARAM.inp .nspin , kv.get_nks ());
25- this ->output_dmk_ = new ModuleIO::Output_DMK<TK>(pelec->get_DM (), pv, PARAM.inp .nspin , kv.get_nks ());
26- this ->isk_ = kv.isk ;
2723 this ->set_nspin (nspin);
28- this ->set_ParaV (pv );
24+ this ->set_ParaV (ParaV );
2925 this ->cal_orbMulP ();
3026}
3127
@@ -65,40 +61,6 @@ void Output_Mulliken<TK>::write(int istep, std::string out_dir)
6561 os.close ();
6662}
6763
68- template <>
69- void Output_Mulliken<std::complex <double >>::cal_mag(UnitCell& ucell, const int istep, const bool print)
70- {
71- auto atom_chg = this ->get_atom_chg ();
72- // / used in updating mag info in STRU file
73- ucell.atom_mulliken = this ->get_atom_mulliken (atom_chg);
74- if (print && GlobalV::MY_RANK == 0 )
75- {
76- // / write the Orbital file
77- this ->cell_index_ ->write_orb_info (PARAM.globalv .global_out_dir );
78- // / write mulliken.txt
79- this ->write (istep, PARAM.globalv .global_out_dir );
80- // / write atomic mag info in running log file
81- this ->print_atom_mag (atom_chg, GlobalV::ofs_running);
82- }
83- }
84-
85- template <>
86- void Output_Mulliken<double >::cal_mag(UnitCell& ucell, const int istep, const bool print)
87- {
88- auto atom_chg = this ->get_atom_chg ();
89- // / used in updating mag info in STRU file
90- ucell.atom_mulliken = this ->get_atom_mulliken (atom_chg);
91- if (print && GlobalV::MY_RANK == 0 )
92- {
93- // / write the Orbital file
94- this ->cell_index_ ->write_orb_info (PARAM.globalv .global_out_dir );
95- // / write mulliken.txt
96- this ->write (istep, PARAM.globalv .global_out_dir );
97- // / write atomic mag info in running log file
98- this ->print_atom_mag (atom_chg, GlobalV::ofs_running);
99- }
100- }
101-
10264template <typename TK>
10365void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
10466 const std::vector<double >& tot_chg,
0 commit comments