Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fft_3d_local.h
Go to the documentation of this file.
1 
14 #ifndef FFT_3D_LOCAL_INCLUDED
15 #define FFT_3D_LOCAL_INCLUDED
16 
17 #ifdef USE_FFTWLIB
18 
19 #include "fft.h"
20 
21 #ifdef USE_MPI
22 #include <fftw3-mpi.h>
23 #else
24 #include <fftw3.h>
25 #endif
26 
27 class FFT_3d_local : public FFT
28 {
29  public:
30  static const std::string class_name;
31 
32  public:
33  FFT_3d_local();
34  virtual ~FFT_3d_local();
35 
36  void fft(Field& dst, const Field& src, enum Direction dir);
37  void fft(Field& dst, const Field& src);
38  void fft(Field& field);
39 
40  void set_parameters(const Parameters& params);
41  void set_parameters(const std::string& direction);
42 
43  private:
44 
45  void initialize();
46  void finalize();
47 
48  bool check_ok();
49 
50  void initialize_plan(const Field& src);
51  void clear_plan();
52 
53  // size info
54  int m_ndim;
55  int m_nsize[4]; // assume atmost 4dimensional
56  int m_vol;
57  int m_nv; // number of complex elements
58 
59  fftw_complex *m_buf_in;
60  fftw_complex *m_buf_out;
61  fftw_plan m_plan_fw;
62  fftw_plan m_plan_bw;
63 
64  Direction m_direction;
65 
66 
67 #ifdef USE_FACTORY
68  private:
69  static FFT *create_object()
70  {
71  return new FFT_3d_local();
72  }
73 
74  public:
75  static bool register_factory()
76  {
77  return FFT::Factory::Register("FFT_3d_local", create_object);
78  }
79 #endif
80 };
81 
82 #endif /* USE_FFTWLIB */
83 
84 #endif /* FFT_3D_LOCAL_INCLUDED */
Container of Field-type object.
Definition: field.h:45
Class for parameters.
Definition: parameters.h:46
Direction
Definition: bridge_defs.h:24