11#include " source_io/ctrl_output_fp.h" // use ctrl_output_fp()
2- #include " source_io/write_elecstat_pot.h"
2+ #include " source_estate/module_charge/symmetry_rho.h" // use Symmetry_rho
3+ #include " source_io/write_elecstat_pot.h" // use write_elecstat_pot
34#include " source_io/write_elf.h"
5+ #include " cube_io.h" // use write_vdata_palgrid
46
57#ifdef USE_LIBXC
68#include " source_io/write_libxc_r.h"
9+ #include " source_hamilt/module_xc/xc_functional.h" // use XC_Functional::get_func_id()
710#endif
811
912namespace ModuleIO
1013{
1114
1215void ctrl_output_fp (UnitCell& ucell,
1316 elecstate::ElecState* pelec,
17+ ModulePW::PW_Basis_Big* pw_big,
18+ ModulePW::PW_Basis* pw_rhod,
19+ Charge &chr,
20+ surchem &solvent,
21+ Parallel_Grid ¶_grid,
1422 const int istep)
1523{
1624 ModuleBase::TITLE (" ModuleIO" , " ctrl_output_fp" );
@@ -48,7 +56,7 @@ void ctrl_output_fp(UnitCell& ucell,
4856 {
4957 for (int is = 0 ; is < nspin; ++is)
5058 {
51- this -> pw_rhod ->real2recip (this -> chr .rho_save [is], this -> chr .rhog_save [is]);
59+ pw_rhod->real2recip (chr.rho_save [is], chr.rhog_save [is]);
5260
5361 std::string fn =PARAM.globalv .global_out_dir + " chg" ;
5462
@@ -64,8 +72,8 @@ void ctrl_output_fp(UnitCell& ucell,
6472
6573 fn += spin_block + geom_block + " .cube" ;
6674
67- ModuleIO::write_vdata_palgrid (Pgrid ,
68- this -> chr .rho_save [is],
75+ ModuleIO::write_vdata_palgrid (para_grid ,
76+ chr.rho_save [is],
6977 is,
7078 nspin,
7179 istep_in,
@@ -81,8 +89,8 @@ void ctrl_output_fp(UnitCell& ucell,
8189
8290 fn += spin_block + geom_block + " .cube" ;
8391
84- ModuleIO::write_vdata_palgrid (Pgrid ,
85- this -> chr .kin_r_save [is],
92+ ModuleIO::write_vdata_palgrid (para_grid ,
93+ chr.kin_r_save [is],
8694 is,
8795 nspin,
8896 istep,
@@ -112,7 +120,7 @@ void ctrl_output_fp(UnitCell& ucell,
112120
113121 fn += spin_block + geom_block + " .cube" ;
114122
115- ModuleIO::write_vdata_palgrid (Pgrid ,
123+ ModuleIO::write_vdata_palgrid (para_grid ,
116124 pelec->pot ->get_effective_v (is),
117125 is,
118126 nspin,
@@ -131,41 +139,41 @@ void ctrl_output_fp(UnitCell& ucell,
131139
132140 ModuleIO::write_elecstat_pot (
133141#ifdef __MPI
134- this -> pw_big ->bz ,
135- this -> pw_big ->nbz ,
142+ pw_big->bz ,
143+ pw_big->nbz ,
136144#endif
137145 fn,
138146 istep,
139- this -> pw_rhod ,
140- &this -> chr ,
147+ pw_rhod,
148+ &chr,
141149 &(ucell),
142150 pelec->pot ->get_fixed_v (),
143- this -> solvent );
151+ solvent);
144152 }
145153
146154 // 6) write ELF
147155 if (PARAM.inp .out_elf [0 ] > 0 )
148156 {
149- this -> chr .cal_elf = true ;
157+ chr.cal_elf = true ;
150158 Symmetry_rho srho;
151159 for (int is = 0 ; is < nspin; is++)
152160 {
153- srho.begin (is, this -> chr , this -> pw_rhod , ucell.symm );
161+ srho.begin (is, chr, pw_rhod, ucell.symm );
154162 }
155163
156164 std::string out_dir =PARAM.globalv .global_out_dir ;
157165 ModuleIO::write_elf (
158166#ifdef __MPI
159- this -> pw_big ->bz ,
160- this -> pw_big ->nbz ,
167+ pw_big->bz ,
168+ pw_big->nbz ,
161169#endif
162170 out_dir,
163171 istep,
164172 nspin,
165- this -> chr .rho ,
166- this -> chr .kin_r ,
167- this -> pw_rhod ,
168- this -> Pgrid ,
173+ chr.rho ,
174+ chr.kin_r ,
175+ pw_rhod,
176+ para_grid ,
169177 &(ucell),
170178 PARAM.inp .out_elf [1 ]);
171179 }
@@ -177,12 +185,12 @@ void ctrl_output_fp(UnitCell& ucell,
177185 ModuleIO::write_libxc_r (
178186 PARAM.inp .out_xc_r [0 ],
179187 XC_Functional::get_func_id (),
180- this -> pw_rhod ->nrxx , // number of real-space grid
188+ pw_rhod->nrxx , // number of real-space grid
181189 ucell.omega , // volume of cell
182190 ucell.tpiba ,
183- this -> chr ,
184- *this -> pw_big ,
185- *this -> pw_rhod );
191+ chr,
192+ *pw_big,
193+ *pw_rhod);
186194 }
187195#endif
188196
0 commit comments