PSCF v1.1
FFT.cpp
1/*
2* PSCF Package
3*
4* Copyright 2016 - 2022, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "FFT.tpp"
9
10namespace Pscf {
11namespace Pspc {
12
13 using namespace Util;
14
15 // Explicit class instantiations
16
17 template class FFT<1>;
18 template class FFT<2>;
19 template class FFT<3>;
20
21
22 // Planning functions, explicit specializations.
23
24 template<>
25 void FFT<1>::makePlans(RField<1>& rField, RFieldDft<1>& kField)
26 {
27 unsigned int flags = FFTW_ESTIMATE;
28 fPlan_ = fftw_plan_dft_r2c_1d(rSize_, &rField[0], &kField[0], flags);
29 iPlan_ = fftw_plan_dft_c2r_1d(rSize_, &kField[0], &rField[0], flags);
30 }
31
32 template <>
33 void FFT<2>::makePlans(RField<2>& rField, RFieldDft<2>& kField)
34 {
35 unsigned int flags = FFTW_ESTIMATE;
36 fPlan_ = fftw_plan_dft_r2c_2d(meshDimensions_[0], meshDimensions_[1],
37 &rField[0], &kField[0], flags);
38 iPlan_ = fftw_plan_dft_c2r_2d(meshDimensions_[0], meshDimensions_[1],
39 &kField[0], &rField[0], flags);
40 }
41
42 template <>
43 void FFT<3>::makePlans(RField<3>& rField, RFieldDft<3>& kField)
44 {
45 unsigned int flags = FFTW_ESTIMATE;
46 fPlan_ = fftw_plan_dft_r2c_3d(meshDimensions_[0], meshDimensions_[1],
47 meshDimensions_[2], &rField[0], &kField[0],
48 flags);
49 iPlan_ = fftw_plan_dft_c2r_3d(meshDimensions_[0], meshDimensions_[1],
50 meshDimensions_[2], &kField[0], &rField[0],
51 flags);
52 }
53
54}
55}
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.
Definition: accumulators.mod:1