Skip to content

Commit b40629d

Browse files
committed
change ft into ft1
1 parent dfaad66 commit b40629d

File tree

3 files changed

+56
-60
lines changed

3 files changed

+56
-60
lines changed

source/module_base/module_fft/fft_temp.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,10 @@ void FFT_TEMP::initfft(int nx_in, int ny_in, int nz_in, int lixy_in, int rixy_in
7878
if (this->precision=="single")
7979
{
8080
float_flag = true;
81-
}
82-
else if (this->precision=="double")
83-
{
8481
double_flag = true;
8582
}
86-
else if (this->precision=="mixing")
83+
else if (this->precision=="double")
8784
{
88-
float_flag = true;
8985
double_flag = true;
9086
}
9187
if (float_flag)

source/module_basis/module_pw/pw_transform.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ void PW_Basis::real2recip(const std::complex<FPTYPE>* in,
2929
#endif
3030
for(int ir = 0 ; ir < this->nrxx ; ++ir)
3131
{
32-
this->ft.get_auxr_data<FPTYPE>()[ir] = in[ir];
32+
this->ft1.get_auxr_data<FPTYPE>()[ir] = in[ir];
3333
}
34-
this->ft.fftxyfor(ft.get_auxr_data<FPTYPE>(),ft.get_auxr_data<FPTYPE>());
34+
this->ft1.fftxyfor(ft1.get_auxr_data<FPTYPE>(),ft1.get_auxr_data<FPTYPE>());
3535

36-
this->gatherp_scatters(this->ft.get_auxr_data<FPTYPE>(), this->ft.get_auxg_data<FPTYPE>());
36+
this->gatherp_scatters(this->ft1.get_auxr_data<FPTYPE>(), this->ft1.get_auxg_data<FPTYPE>());
3737

38-
this->ft.fftzfor(ft.get_auxg_data<FPTYPE>(),ft.get_auxg_data<FPTYPE>());
38+
this->ft1.fftzfor(ft1.get_auxg_data<FPTYPE>(),ft1.get_auxg_data<FPTYPE>());
3939

4040
if(add)
4141
{
@@ -45,7 +45,7 @@ void PW_Basis::real2recip(const std::complex<FPTYPE>* in,
4545
#endif
4646
for(int ig = 0 ; ig < this->npw ; ++ig)
4747
{
48-
out[ig] += tmpfac * this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
48+
out[ig] += tmpfac * this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
4949
}
5050
}
5151
else
@@ -56,7 +56,7 @@ void PW_Basis::real2recip(const std::complex<FPTYPE>* in,
5656
#endif
5757
for(int ig = 0 ; ig < this->npw ; ++ig)
5858
{
59-
out[ig] = tmpfac * this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
59+
out[ig] = tmpfac * this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
6060
}
6161
}
6262
ModuleBase::timer::tick(this->classname, "real2recip");
@@ -83,11 +83,11 @@ void PW_Basis::real2recip(const FPTYPE* in, std::complex<FPTYPE>* out, const boo
8383
{
8484
for(int ipy = 0 ; ipy < npy ; ++ipy)
8585
{
86-
this->ft.get_rspace_data<FPTYPE>()[ix*npy + ipy] = in[ix*npy + ipy];
86+
this->ft1.get_rspace_data<FPTYPE>()[ix*npy + ipy] = in[ix*npy + ipy];
8787
}
8888
}
8989

90-
this->ft.fftxyr2c(ft.get_rspace_data<FPTYPE>(),ft.get_auxr_data<FPTYPE>());
90+
this->ft1.fftxyr2c(ft1.get_rspace_data<FPTYPE>(),ft1.get_auxr_data<FPTYPE>());
9191
}
9292
else
9393
{
@@ -96,13 +96,13 @@ void PW_Basis::real2recip(const FPTYPE* in, std::complex<FPTYPE>* out, const boo
9696
#endif
9797
for(int ir = 0 ; ir < this->nrxx ; ++ir)
9898
{
99-
this->ft.get_auxr_data<FPTYPE>()[ir] = std::complex<FPTYPE>(in[ir],0);
99+
this->ft1.get_auxr_data<FPTYPE>()[ir] = std::complex<FPTYPE>(in[ir],0);
100100
}
101-
this->ft.fftxyfor(ft.get_auxr_data<FPTYPE>(),ft.get_auxr_data<FPTYPE>());
101+
this->ft1.fftxyfor(ft1.get_auxr_data<FPTYPE>(),ft1.get_auxr_data<FPTYPE>());
102102
}
103-
this->gatherp_scatters(this->ft.get_auxr_data<FPTYPE>(), this->ft.get_auxg_data<FPTYPE>());
103+
this->gatherp_scatters(this->ft1.get_auxr_data<FPTYPE>(), this->ft1.get_auxg_data<FPTYPE>());
104104

105-
this->ft.fftzfor(ft.get_auxg_data<FPTYPE>(),ft.get_auxg_data<FPTYPE>());
105+
this->ft1.fftzfor(ft1.get_auxg_data<FPTYPE>(),ft1.get_auxg_data<FPTYPE>());
106106

107107
if(add)
108108
{
@@ -112,7 +112,7 @@ void PW_Basis::real2recip(const FPTYPE* in, std::complex<FPTYPE>* out, const boo
112112
#endif
113113
for(int ig = 0 ; ig < this->npw ; ++ig)
114114
{
115-
out[ig] += tmpfac * this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
115+
out[ig] += tmpfac * this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
116116
}
117117
}
118118
else
@@ -123,7 +123,7 @@ void PW_Basis::real2recip(const FPTYPE* in, std::complex<FPTYPE>* out, const boo
123123
#endif
124124
for(int ig = 0 ; ig < this->npw ; ++ig)
125125
{
126-
out[ig] = tmpfac * this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
126+
out[ig] = tmpfac * this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]];
127127
}
128128
}
129129
ModuleBase::timer::tick(this->classname, "real2recip");
@@ -149,21 +149,21 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in,
149149
#endif
150150
for(int i = 0 ; i < this->nst * this->nz ; ++i)
151151
{
152-
ft.get_auxg_data<FPTYPE>()[i] = std::complex<FPTYPE>(0, 0);
152+
ft1.get_auxg_data<FPTYPE>()[i] = std::complex<FPTYPE>(0, 0);
153153
}
154154

155155
#ifdef _OPENMP
156156
#pragma omp parallel for schedule(static, 4096/sizeof(FPTYPE))
157157
#endif
158158
for(int ig = 0 ; ig < this->npw ; ++ig)
159159
{
160-
this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]] = in[ig];
160+
this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]] = in[ig];
161161
}
162-
this->ft.fftzbac(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
162+
this->ft1.fftzbac(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
163163

164-
this->gathers_scatterp(this->ft.get_auxg_data<FPTYPE>(),this->ft.get_auxr_data<FPTYPE>());
164+
this->gathers_scatterp(this->ft1.get_auxg_data<FPTYPE>(),this->ft1.get_auxr_data<FPTYPE>());
165165

166-
this->ft.fftxybac(ft.get_auxr_data<FPTYPE>(),ft.get_auxr_data<FPTYPE>());
166+
this->ft1.fftxybac(ft1.get_auxr_data<FPTYPE>(),ft1.get_auxr_data<FPTYPE>());
167167

168168
if(add)
169169
{
@@ -172,7 +172,7 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in,
172172
#endif
173173
for(int ir = 0 ; ir < this->nrxx ; ++ir)
174174
{
175-
out[ir] += factor * this->ft.get_auxr_data<FPTYPE>()[ir];
175+
out[ir] += factor * this->ft1.get_auxr_data<FPTYPE>()[ir];
176176
}
177177
}
178178
else
@@ -182,7 +182,7 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in,
182182
#endif
183183
for(int ir = 0 ; ir < this->nrxx ; ++ir)
184184
{
185-
out[ir] = this->ft.get_auxr_data<FPTYPE>()[ir];
185+
out[ir] = this->ft1.get_auxr_data<FPTYPE>()[ir];
186186
}
187187
}
188188
ModuleBase::timer::tick(this->classname, "recip2real");
@@ -204,23 +204,23 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in, FPTYPE* out, const boo
204204
#endif
205205
for(int i = 0 ; i < this->nst * this->nz ; ++i)
206206
{
207-
ft.get_auxg_data<FPTYPE>()[i] = std::complex<double>(0, 0);
207+
ft1.get_auxg_data<FPTYPE>()[i] = std::complex<double>(0, 0);
208208
}
209209

210210
#ifdef _OPENMP
211211
#pragma omp parallel for schedule(static, 4096/sizeof(FPTYPE))
212212
#endif
213213
for(int ig = 0 ; ig < this->npw ; ++ig)
214214
{
215-
this->ft.get_auxg_data<FPTYPE>()[this->ig2isz[ig]] = in[ig];
215+
this->ft1.get_auxg_data<FPTYPE>()[this->ig2isz[ig]] = in[ig];
216216
}
217-
this->ft.fftzbac(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
217+
this->ft1.fftzbac(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
218218

219-
this->gathers_scatterp(this->ft.get_auxg_data<FPTYPE>(), this->ft.get_auxr_data<FPTYPE>());
219+
this->gathers_scatterp(this->ft1.get_auxg_data<FPTYPE>(), this->ft1.get_auxr_data<FPTYPE>());
220220

221221
if(this->gamma_only)
222222
{
223-
this->ft.fftxyc2r(ft.get_auxr_data<FPTYPE>(),ft.get_rspace_data<FPTYPE>());
223+
this->ft1.fftxyc2r(ft1.get_auxr_data<FPTYPE>(),ft1.get_rspace_data<FPTYPE>());
224224

225225
// r2c in place
226226
const int npy = this->ny * this->nplane;
@@ -234,7 +234,7 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in, FPTYPE* out, const boo
234234
{
235235
for(int ipy = 0 ; ipy < npy ; ++ipy)
236236
{
237-
out[ix*npy + ipy] += factor * this->ft.get_rspace_data<FPTYPE>()[ix*npy + ipy];
237+
out[ix*npy + ipy] += factor * this->ft1.get_rspace_data<FPTYPE>()[ix*npy + ipy];
238238
}
239239
}
240240
}
@@ -247,22 +247,22 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in, FPTYPE* out, const boo
247247
{
248248
for(int ipy = 0 ; ipy < npy ; ++ipy)
249249
{
250-
out[ix*npy + ipy] = this->ft.get_rspace_data<FPTYPE>()[ix*npy + ipy];
250+
out[ix*npy + ipy] = this->ft1.get_rspace_data<FPTYPE>()[ix*npy + ipy];
251251
}
252252
}
253253
}
254254
}
255255
else
256256
{
257-
this->ft.fftxybac(ft.get_auxr_data<FPTYPE>(),ft.get_auxr_data<FPTYPE>());
257+
this->ft1.fftxybac(ft1.get_auxr_data<FPTYPE>(),ft1.get_auxr_data<FPTYPE>());
258258
if(add)
259259
{
260260
#ifdef _OPENMP
261261
#pragma omp parallel for schedule(static, 4096/sizeof(FPTYPE))
262262
#endif
263263
for(int ir = 0 ; ir < this->nrxx ; ++ir)
264264
{
265-
out[ir] += factor * this->ft.get_auxr_data<FPTYPE>()[ir].real();
265+
out[ir] += factor * this->ft1.get_auxr_data<FPTYPE>()[ir].real();
266266
}
267267
}
268268
else
@@ -272,7 +272,7 @@ void PW_Basis::recip2real(const std::complex<FPTYPE>* in, FPTYPE* out, const boo
272272
#endif
273273
for(int ir = 0 ; ir < this->nrxx ; ++ir)
274274
{
275-
out[ir] = this->ft.get_auxr_data<FPTYPE>()[ir].real();
275+
out[ir] = this->ft1.get_auxr_data<FPTYPE>()[ir].real();
276276
}
277277
}
278278
}

source/module_basis/module_pw/pw_transform_k.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ void PW_Basis_K::real2recip(const std::complex<FPTYPE>* in,
3232
ModuleBase::timer::tick(this->classname, "real2recip");
3333

3434
assert(this->gamma_only == false);
35-
auto* auxr = this->ft.get_auxr_data<FPTYPE>();
35+
auto* auxr = this->ft1.get_auxr_data<FPTYPE>();
3636
#ifdef _OPENMP
3737
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
3838
#endif
3939
for (int ir = 0; ir < this->nrxx; ++ir)
4040
{
4141
auxr[ir] = in[ir];
4242
}
43-
this->ft.fftxyfor(ft.get_auxr_data<FPTYPE>(), ft.get_auxr_data<FPTYPE>());
43+
this->ft1.fftxyfor(ft1.get_auxr_data<FPTYPE>(), ft1.get_auxr_data<FPTYPE>());
4444

45-
this->gatherp_scatters(this->ft.get_auxr_data<FPTYPE>(), this->ft.get_auxg_data<FPTYPE>());
45+
this->gatherp_scatters(this->ft1.get_auxr_data<FPTYPE>(), this->ft1.get_auxg_data<FPTYPE>());
4646

47-
this->ft.fftzfor(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
47+
this->ft1.fftzfor(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
4848

4949
const int startig = ik * this->npwk_max;
5050
const int npwk = this->npwk[ik];
51-
auto* auxg = this->ft.get_auxg_data<FPTYPE>();
51+
auto* auxg = this->ft1.get_auxg_data<FPTYPE>();
5252
if (add)
5353
{
5454
FPTYPE tmpfac = factor / FPTYPE(this->nxyz);
@@ -98,7 +98,7 @@ void PW_Basis_K::real2recip(const FPTYPE* in,
9898
assert(this->gamma_only == true);
9999
// for(int ir = 0 ; ir < this->nrxx ; ++ir)
100100
// {
101-
// this->ft.get_rspace_data<FPTYPE>()[ir] = in[ir];
101+
// this->ft1.get_rspace_data<FPTYPE>()[ir] = in[ir];
102102
// }
103103
// r2c in place
104104
const int npy = this->ny * this->nplane;
@@ -109,19 +109,19 @@ void PW_Basis_K::real2recip(const FPTYPE* in,
109109
{
110110
for (int ipy = 0; ipy < npy; ++ipy)
111111
{
112-
this->ft.get_rspace_data<FPTYPE>()[ix * npy + ipy] = in[ix * npy + ipy];
112+
this->ft1.get_rspace_data<FPTYPE>()[ix * npy + ipy] = in[ix * npy + ipy];
113113
}
114114
}
115115

116-
this->ft.fftxyr2c(ft.get_rspace_data<FPTYPE>(), ft.get_auxr_data<FPTYPE>());
116+
this->ft1.fftxyr2c(ft1.get_rspace_data<FPTYPE>(), ft1.get_auxr_data<FPTYPE>());
117117

118-
this->gatherp_scatters(this->ft.get_auxr_data<FPTYPE>(), this->ft.get_auxg_data<FPTYPE>());
118+
this->gatherp_scatters(this->ft1.get_auxr_data<FPTYPE>(), this->ft1.get_auxg_data<FPTYPE>());
119119

120-
this->ft.fftzfor(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
120+
this->ft1.fftzfor(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
121121

122122
const int startig = ik * this->npwk_max;
123123
const int npwk = this->npwk[ik];
124-
auto* auxg = this->ft.get_auxg_data<FPTYPE>();
124+
auto* auxg = this->ft1.get_auxg_data<FPTYPE>();
125125
if (add)
126126
{
127127
FPTYPE tmpfac = factor / FPTYPE(this->nxyz);
@@ -170,25 +170,25 @@ void PW_Basis_K::recip2real(const std::complex<FPTYPE>* in,
170170
{
171171
ModuleBase::timer::tick(this->classname, "recip2real");
172172
assert(this->gamma_only == false);
173-
ModuleBase::GlobalFunc::ZEROS(ft.get_auxg_data<FPTYPE>(), this->nst * this->nz);
173+
ModuleBase::GlobalFunc::ZEROS(ft1.get_auxg_data<FPTYPE>(), this->nst * this->nz);
174174

175175
const int startig = ik * this->npwk_max;
176176
const int npwk = this->npwk[ik];
177-
auto* auxg = this->ft.get_auxg_data<FPTYPE>();
177+
auto* auxg = this->ft1.get_auxg_data<FPTYPE>();
178178
#ifdef _OPENMP
179179
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
180180
#endif
181181
for (int igl = 0; igl < npwk; ++igl)
182182
{
183183
auxg[this->igl2isz_k[igl + startig]] = in[igl];
184184
}
185-
this->ft.fftzbac(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
185+
this->ft1.fftzbac(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
186186

187-
this->gathers_scatterp(this->ft.get_auxg_data<FPTYPE>(), this->ft.get_auxr_data<FPTYPE>());
187+
this->gathers_scatterp(this->ft1.get_auxg_data<FPTYPE>(), this->ft1.get_auxr_data<FPTYPE>());
188188

189-
this->ft.fftxybac(ft.get_auxr_data<FPTYPE>(), ft.get_auxr_data<FPTYPE>());
189+
this->ft1.fftxybac(ft1.get_auxr_data<FPTYPE>(), ft1.get_auxr_data<FPTYPE>());
190190

191-
auto* auxr = this->ft.get_auxr_data<FPTYPE>();
191+
auto* auxr = this->ft1.get_auxr_data<FPTYPE>();
192192
if (add)
193193
{
194194
#ifdef _OPENMP
@@ -234,32 +234,32 @@ void PW_Basis_K::recip2real(const std::complex<FPTYPE>* in,
234234
{
235235
ModuleBase::timer::tick(this->classname, "recip2real");
236236
assert(this->gamma_only == true);
237-
ModuleBase::GlobalFunc::ZEROS(ft.get_auxg_data<FPTYPE>(), this->nst * this->nz);
237+
ModuleBase::GlobalFunc::ZEROS(ft1.get_auxg_data<FPTYPE>(), this->nst * this->nz);
238238

239239
const int startig = ik * this->npwk_max;
240240
const int npwk = this->npwk[ik];
241-
auto* auxg = this->ft.get_auxg_data<FPTYPE>();
241+
auto* auxg = this->ft1.get_auxg_data<FPTYPE>();
242242
#ifdef _OPENMP
243243
#pragma omp parallel for schedule(static, 4096 / sizeof(FPTYPE))
244244
#endif
245245
for (int igl = 0; igl < npwk; ++igl)
246246
{
247247
auxg[this->igl2isz_k[igl + startig]] = in[igl];
248248
}
249-
this->ft.fftzbac(ft.get_auxg_data<FPTYPE>(), ft.get_auxg_data<FPTYPE>());
249+
this->ft1.fftzbac(ft1.get_auxg_data<FPTYPE>(), ft1.get_auxg_data<FPTYPE>());
250250

251-
this->gathers_scatterp(this->ft.get_auxg_data<FPTYPE>(), this->ft.get_auxr_data<FPTYPE>());
251+
this->gathers_scatterp(this->ft1.get_auxg_data<FPTYPE>(), this->ft1.get_auxr_data<FPTYPE>());
252252

253-
this->ft.fftxyc2r(ft.get_auxr_data<FPTYPE>(), ft.get_rspace_data<FPTYPE>());
253+
this->ft1.fftxyc2r(ft1.get_auxr_data<FPTYPE>(), ft1.get_rspace_data<FPTYPE>());
254254

255255
// for(int ir = 0 ; ir < this->nrxx ; ++ir)
256256
// {
257-
// out[ir] = this->ft.get_rspace_data<FPTYPE>()[ir] / this->nxyz;
257+
// out[ir] = this->ft1.get_rspace_data<FPTYPE>()[ir] / this->nxyz;
258258
// }
259259

260260
// r2c in place
261261
const int npy = this->ny * this->nplane;
262-
auto* rspace = this->ft.get_rspace_data<FPTYPE>();
262+
auto* rspace = this->ft1.get_rspace_data<FPTYPE>();
263263
if (add)
264264
{
265265
#ifdef _OPENMP

0 commit comments

Comments
 (0)