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