Bridge++  Ver. 2.0.2
fft_xyz_3dim.h
Go to the documentation of this file.
1 
14 #ifndef FFT_XYZ_3DIM_INCLUDED
15 #define FFT_XYZ_3DIM_INCLUDED
16 
17 #ifdef USE_FFTWLIB
18 
19 #include "fft.h"
20 
22 
30 class FFT_xyz_3dim : public FFT
31 {
32  public:
33  static const std::string class_name;
34 
35  private:
37 
38  bool m_is_forward;
39 
40  Index_lex m_index;
41 
42  fftw_complex *m_in;
43  fftw_complex *m_out;
44 
45  fftw_plan m_plan;
46 
47 #ifdef USE_MPI
48  ptrdiff_t m_Nz_p, m_z_start_p;
49 #endif
50 
51 
52  public:
53  FFT_xyz_3dim()
54  : m_vl(CommonParameters::Vlevel())
55  {
56  init();
57  }
58 
59  FFT_xyz_3dim(const Parameters& params)
60  : m_vl(CommonParameters::Vlevel())
61  {
62  init();
63  set_parameters(params);
64  }
65 
66  ~FFT_xyz_3dim()
67  {
68  tidy_up();
69  }
70 
71  void fft(Field& field); // field is overwritten
72  void fft(Field& field_out, const Field& field_in);
73  void fft(Field& field_out, const Field& field_in, const Direction dir);
74 
75  void set_parameters(const Parameters&);
76  void set_parameters(const std::string& str_fft_direction);
77 
78  void get_parameters(Parameters&) const;
79 
80  private:
81  void init();
82  void tidy_up();
83 
84 #ifdef USE_FACTORY
85  private:
86  static FFT *create_object()
87  {
88  return new FFT_xyz_3dim();
89  }
90 
91  static FFT *create_object_with_params(const Parameters& params)
92  {
93  return new FFT_xyz_3dim(params);
94  }
95 
96  public:
97  static bool register_factory()
98  {
99  bool init = true;
100  init &= FFT::Factory::Register("FFT_xyz_3dim", create_object);
101  init &= FFT::Factory_params::Register("FFT_xyz_3dim", create_object_with_params);
102  return init;
103  }
104 #endif
105 };
106 //- #endif of #ifdef USE_FFTWLIB
107 #endif
108 #endif
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
Index_lex
Lexical site index.
Definition: index_lex.h:34
Parameters
Class for parameters.
Definition: parameters.h:46
Direction
Direction
Definition: bridge_defs.h:24
fft.h
Field
Container of Field-type object.
Definition: field.h:46
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42