11#include " source_estate/setup_estate_pw.h"
2+ #include " source_estate/elecstate_pw.h" // init of pelec
3+ #include " source_estate/elecstate_pw_sdft.h" // init of pelec for sdft
4+ #include " source_estate/elecstate_tools.h" // occupations
25
36template <typename T, typename Device>
47void elecstate::setup_estate_pw (UnitCell& ucell, // unitcell
5- const K_Vectors &kv, // kpoints
8+ K_Vectors &kv, // kpoints
69 Structure_Factor &sf, // structure factors
710 elecstate::ElecState *pelec, // pointer of electrons
8- const Charge &chr, // charge density
11+ Charge &chr, // charge density
912 pseudopot_cell_vl &locpp, // local pseudopotentials
1013 pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
1114 VSep* vsep_cell, // U-1/2 method
1215 ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
13- const ModulePW::PW_Basis *pw_rho, // pw for rho
14- const ModulePW::PW_Basis *pw_rhod, // pw for rhod
15- const ModulePW::PW_Basis_Big* pw_big, // pw for big grid
16+ ModulePW::PW_Basis *pw_rho, // pw for rho
17+ ModulePW::PW_Basis *pw_rhod, // pw for rhod
18+ ModulePW::PW_Basis_Big* pw_big, // pw for big grid
1619 surchem &solvent, // solvent
1720 const Input_para& inp) // input parameters
1821{
@@ -81,6 +84,7 @@ void elecstate::setup_estate_pw(UnitCell& ucell, // unitcell
8184}
8285
8386
87+ template <typename T, typename Device>
8488void elecstate::teardown_estate_pw (elecstate::ElecState *pelec, VSep* vsep_cell)
8589{
8690 ModuleBase::TITLE (" elecstate" , " teardown_estate_pw" );
@@ -100,70 +104,82 @@ void elecstate::teardown_estate_pw(elecstate::ElecState *pelec, VSep* vsep_cell)
100104
101105template void elecstate::setup_estate_pw<std::complex <float >, base_device::DEVICE_CPU>(
102106 UnitCell& ucell, // unitcell
103- const K_Vectors &kv, // kpoints
107+ K_Vectors &kv, // kpoints
104108 Structure_Factor &sf, // structure factors
105109 elecstate::ElecState *pelec, // pointer of electrons
106- const Charge &chr, // charge density
110+ Charge &chr, // charge density
107111 pseudopot_cell_vl &locpp, // local pseudopotentials
108112 pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
109113 VSep* vsep_cell, // U-1/2 method
110114 ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
111- const ModulePW::PW_Basis *pw_rho, // pw for rho
112- const ModulePW::PW_Basis *pw_rhod, // pw for rhod
113- const ModulePW::PW_Basis_Big* pw_big, // pw for big grid
115+ ModulePW::PW_Basis *pw_rho, // pw for rho
116+ ModulePW::PW_Basis *pw_rhod, // pw for rhod
117+ ModulePW::PW_Basis_Big* pw_big, // pw for big grid
114118 surchem &solvent, // solvent
115119 const Input_para& inp); // input parameters
116120
117121template void elecstate::setup_estate_pw<std::complex <double >, base_device::DEVICE_CPU>(
118122 UnitCell& ucell, // unitcell
119- const K_Vectors &kv, // kpoints
123+ K_Vectors &kv, // kpoints
120124 Structure_Factor &sf, // structure factors
121125 elecstate::ElecState *pelec, // pointer of electrons
122- const Charge &chr, // charge density
126+ Charge &chr, // charge density
123127 pseudopot_cell_vl &locpp, // local pseudopotentials
124128 pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
125129 VSep* vsep_cell, // U-1/2 method
126130 ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
127- const ModulePW::PW_Basis *pw_rho, // pw for rho
128- const ModulePW::PW_Basis *pw_rhod, // pw for rhod
129- const ModulePW::PW_Basis_Big* pw_big, // pw for big grid
131+ ModulePW::PW_Basis *pw_rho, // pw for rho
132+ ModulePW::PW_Basis *pw_rhod, // pw for rhod
133+ ModulePW::PW_Basis_Big* pw_big, // pw for big grid
130134 surchem &solvent, // solvent
131135 const Input_para& inp); // input parameters
132136
133137
138+ template void elecstate::teardown_estate_pw<std::complex <float >, base_device::DEVICE_CPU>(
139+ elecstate::ElecState *pelec, VSep* vsep_cell);
140+
141+ template void elecstate::teardown_estate_pw<std::complex <double >, base_device::DEVICE_CPU>(
142+ elecstate::ElecState *pelec, VSep* vsep_cell);
143+
134144
135145#if ((defined __CUDA) || (defined __ROCM))
136146
137147template void elecstate::setup_estate_pw<std::complex <float >, base_device::DEVICE_GPU>(
138148 UnitCell& ucell, // unitcell
139- const K_Vectors &kv, // kpoints
149+ K_Vectors &kv, // kpoints
140150 Structure_Factor &sf, // structure factors
141151 elecstate::ElecState *pelec, // pointer of electrons
142- const Charge &chr, // charge density
152+ Charge &chr, // charge density
143153 pseudopot_cell_vl &locpp, // local pseudopotentials
144154 pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
145155 VSep* vsep_cell, // U-1/2 method
146156 ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
147- const ModulePW::PW_Basis *pw_rho, // pw for rho
148- const ModulePW::PW_Basis *pw_rhod, // pw for rhod
149- const ModulePW::PW_Basis_Big* pw_big, // pw for big grid
157+ ModulePW::PW_Basis *pw_rho, // pw for rho
158+ ModulePW::PW_Basis *pw_rhod, // pw for rhod
159+ ModulePW::PW_Basis_Big* pw_big, // pw for big grid
150160 surchem &solvent, // solvent
151161 const Input_para& inp); // input parameters
152162
153163template void elecstate::setup_estate_pw<std::complex <double >, base_device::DEVICE_GPU>(
154164 UnitCell& ucell, // unitcell
155- const K_Vectors &kv, // kpoints
165+ K_Vectors &kv, // kpoints
156166 Structure_Factor &sf, // structure factors
157167 elecstate::ElecState *pelec, // pointer of electrons
158- const Charge &chr, // charge density
168+ Charge &chr, // charge density
159169 pseudopot_cell_vl &locpp, // local pseudopotentials
160170 pseudopot_cell_vnl &ppcell, // non-local pseudopotentials
161171 VSep* vsep_cell, // U-1/2 method
162172 ModulePW::PW_Basis_K *pw_wfc, // pw for wfc
163- const ModulePW::PW_Basis *pw_rho, // pw for rho
164- const ModulePW::PW_Basis *pw_rhod, // pw for rhod
165- const ModulePW::PW_Basis_Big* pw_big, // pw for big grid
173+ ModulePW::PW_Basis *pw_rho, // pw for rho
174+ ModulePW::PW_Basis *pw_rhod, // pw for rhod
175+ ModulePW::PW_Basis_Big* pw_big, // pw for big grid
166176 surchem &solvent, // solvent
167177 const Input_para& inp); // input parameters
168178
179+ template void elecstate::teardown_estate_pw<std::complex <float >, base_device::DEVICE_GPU>(
180+ elecstate::ElecState *pelec, VSep* vsep_cell);
181+
182+ template void elecstate::teardown_estate_pw<std::complex <double >, base_device::DEVICE_GPU>(
183+ elecstate::ElecState *pelec, VSep* vsep_cell);
184+
169185#endif
0 commit comments