Bridge++  Ver. 2.0.2
fft_xyz_1dim.h
Go to the documentation of this file.
1 
14 #ifndef FFT_XYZ_1DIM_INCLUDED
15 #define FFT_XYZ_1DIM_INCLUDED
16 
17 #ifdef USE_FFTWLIB
18 
19 #include "fft.h"
20 
22 
30 class FFT_xyz_1dim : 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_Nsize_in_p, m_start_in_p;
49  ptrdiff_t m_Nsize_out_p, m_start_out_p;
50 #endif
51 
52 
53  public:
54  FFT_xyz_1dim()
55  : m_vl(CommonParameters::Vlevel()) {}
56 
57  FFT_xyz_1dim(const Parameters& params)
58  : m_vl(CommonParameters::Vlevel())
59  {
60  set_parameters(params);
61  }
62 
63  ~FFT_xyz_1dim() {}
64 
65  void fft(Field& field); // field is overwritten
66  void fft(Field& field_out, const Field& field_in);
67  void fft(Field& field_out, const Field& field_in, const Direction dir);
68 
69  void set_parameters(const Parameters&);
70  void set_parameters(const std::string& str_fft_direction);
71 
72  void get_parameters(Parameters&) const;
73 
74 #ifdef USE_FACTORY
75  private:
76  static FFT *create_object()
77  {
78  return new FFT_xyz_1dim();
79  }
80 
81  static FFT *create_object_with_params(const Parameters& params)
82  {
83  return new FFT_xyz_1dim(params);
84  }
85 
86  public:
87  static bool register_factory()
88  {
89  bool init = true;
90  init &= FFT::Factory::Register("FFT_xyz_1dim", create_object);
91  init &= FFT::Factory_params::Register("FFT_xyz_1dim", create_object_with_params);
92  return init;
93  }
94 #endif
95 };
96 //- #endif of #ifdef USE_FFTWLIB
97 #endif
98 #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