21 template class FFT<1>;
22 template class FFT<2>;
23 template class FFT<3>;
28 void FFT<1>::makePlans(RField<1>& rField, RFieldDft<1>& kField,
29 CField<1>& cFieldIn, CField<1>& cFieldOut)
32 int nThread = omp_get_max_threads();
35 fftw_plan_with_nthreads(nThread);
39 unsigned int flags = FFTW_ESTIMATE;
40 rcfPlan_ = fftw_plan_dft_r2c_1d(n0, &rField[0], &kField[0], flags);
41 criPlan_ = fftw_plan_dft_c2r_1d(n0, &kField[0], &rField[0], flags);
42 int sign = FFTW_FORWARD;
43 ccfPlan_ = fftw_plan_dft_1d(n0, &cFieldIn[0], &cFieldOut[0],
46 cciPlan_ = fftw_plan_dft_1d(n0, &cFieldOut[0], &cFieldIn[0],
51 void FFT<2>::makePlans(RField<2>& rField, RFieldDft<2>& kField,
52 CField<2>& cFieldIn, CField<2>& cFieldOut)
55 int nThread = omp_get_max_threads();
58 fftw_plan_with_nthreads(nThread);
61 unsigned int flags = FFTW_ESTIMATE;
62 int n0 = meshDimensions_[0];
63 int n1 = meshDimensions_[1];
64 rcfPlan_ = fftw_plan_dft_r2c_2d(n0, n1, &rField[0], &kField[0], flags);
65 criPlan_ = fftw_plan_dft_c2r_2d(n0, n1, &kField[0], &rField[0], flags);
66 int sign = FFTW_FORWARD;
67 ccfPlan_ = fftw_plan_dft_2d(n0, n1, &cFieldIn[0], &cFieldOut[0],
70 cciPlan_ = fftw_plan_dft_2d(n0, n1, &cFieldOut[0], &cFieldIn[0],
75 void FFT<3>::makePlans(RField<3>& rField, RFieldDft<3>& kField,
76 CField<3>& cFieldIn, CField<3>& cFieldOut)
79 int nThread = omp_get_max_threads();
82 fftw_plan_with_nthreads(nThread);
85 unsigned int flags = FFTW_ESTIMATE;
86 int n0 = meshDimensions_[0];
87 int n1 = meshDimensions_[1];
88 int n2 = meshDimensions_[2];
89 rcfPlan_ = fftw_plan_dft_r2c_3d(n0, n1, n2,
90 &rField[0], &kField[0], flags);
91 criPlan_ = fftw_plan_dft_c2r_3d(n0, n1, n2,
92 &kField[0], &rField[0], flags);
93 int sign = FFTW_FORWARD;
94 ccfPlan_ = fftw_plan_dft_3d(n0, n1, n2,
95 &cFieldIn[0], &cFieldOut[0], sign, flags);
97 cciPlan_ = fftw_plan_dft_3d(n0, n1, n2,
98 &cFieldIn[0], &cFieldOut[0], sign, flags);
PSCF package top-level namespace.
Utility classes for scientific computation.