PLaSK library
Loading...
Searching...
No Matches
fft.hpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#ifndef PLASK__SOLVER_OPTICAL_MODAL_FFT_H
15#define PLASK__SOLVER_OPTICAL_MODAL_FFT_H
16
17#include <plask/plask.hpp>
18
19#include "plask/optical/modal/config.hpp"
20
21#ifdef USE_FFTW
22# include <fftw3.h>
23#endif
24
25namespace plask { namespace optical { namespace modal { namespace FFT {
26
39
43 Forward1D();
45 Forward1D(Forward1D&& old);
47 Forward1D& operator=(Forward1D&& old);
53 Forward1D(std::size_t strid, std::size_t n, Symmetry symmetry);
54 ~Forward1D();
59 void execute(dcomplex* data, int lot=0);
60 private:
61 int n;
62 int strid;
63 Symmetry symmetry;
64#ifdef USE_FFTW
65 fftw_plan plan;
66#else
67 double *wsave;
68#endif
69};
70
74 Forward2D();
76 Forward2D(Forward2D&& old);
78 Forward2D& operator=(Forward2D&& old);
85 Forward2D(std::size_t strid, std::size_t n1, std::size_t n2, Symmetry symmetry1, Symmetry symmetry2, std::size_t ld=0);
86 ~Forward2D();
91 void execute(dcomplex* data, int lot=0);
92 private:
93 int n1, n2;
94 int strid1, strid2;
95 Symmetry symmetry1, symmetry2;
96#ifdef USE_FFTW
97 fftw_plan plan;
98#else
99 double *wsave1, *wsave2;
100#endif
101};
102
106 Backward1D();
108 Backward1D(Backward1D&& old);
110 Backward1D& operator=(Backward1D&& old);
116 Backward1D(std::size_t strid, std::size_t n, Symmetry symmetry);
117 ~Backward1D();
122 void execute(dcomplex* data, int lot=0);
123 private:
124 int n;
125 int strid;
126 Symmetry symmetry;
127#ifdef USE_FFTW
128 fftw_plan plan;
129#else
130 double *wsave;
131#endif
132};
133
137 Backward2D();
139 Backward2D(Backward2D&& old);
141 Backward2D& operator=(Backward2D&& old);
148 Backward2D(std::size_t strid, std::size_t n1, std::size_t n2, Symmetry symmetry1, Symmetry symmetry2, std::size_t ld=0);
149 ~Backward2D();
151 void execute();
156 void execute(dcomplex* data, int lot=0);
157 private:
158 int n1, n2;
159 int strid1, strid2;
160 Symmetry symmetry1, symmetry2;
161#ifdef USE_FFTW
162 fftw_plan plan;
163#else
164 double *wsave1, *wsave2;
165#endif
166};
167
168}}}} // namespace plask::optical::modal::FFT
169
170#endif // PLASK__SOLVER_OPTICAL_MODAL_FFT_H