@@ -49,6 +49,12 @@ public:
4949 MultiFab, FabArray<BaseFab<T> > >;
5050 using cMF = FabArray<BaseFab<GpuComplex<T> > >;
5151
52+ /* *
53+ * \brief Constructor
54+ *
55+ * \param domain the forward domain (i.e., the domain of the real data)
56+ * \param info optional information
57+ */
5258 explicit R2C (Box const & domain, Info const & info = Info{});
5359
5460 ~R2C ();
@@ -58,6 +64,25 @@ public:
5864 R2C& operator = (R2C const &) = delete ;
5965 R2C& operator = (R2C &&) = delete ;
6066
67+ /* *
68+ * \brief Forward and then backward transform
69+ *
70+ * This function is available only when this class template is
71+ * instantiated for transforms in both directions. It's more efficient
72+ * than calling the forward function that stores the spectral data in a
73+ * caller provided container followed by the backward function, because
74+ * this can avoid parallel communication between the internal data and
75+ * the caller's data container.
76+ *
77+ * \param inmf input data in MultiFab or FabArray<BaseFab<float>>
78+ * \param outmf output data in MultiFab or FabArray<BaseFab<float>>
79+ * \param post_forward a callable object for processing the post-forward
80+ * data before the backward transform. Its interface
81+ * is `(int,int,int,GpuComplex<T>&)`, where the integers
82+ * are indices in the spectral space, and the reference
83+ * to the complex number allows for the modification of
84+ * the spectral data at that location.
85+ */
6186 template <typename F, Direction DIR=D,
6287 std::enable_if_t <DIR == Direction::both, int > = 0 >
6388 void forwardThenBackward (MF const & inmf, MF& outmf, F const & post_forward)
@@ -67,21 +92,65 @@ public:
6792 this ->backward (outmf);
6893 }
6994
95+ /* *
96+ * \brief Forward transform
97+ *
98+ * The output is stored in this object's internal data. This function is
99+ * not available when this class template is instantiated for
100+ * backward-only transform.
101+ *
102+ * \param inmf input data in MultiFab or FabArray<BaseFab<float>>
103+ */
70104 template <Direction DIR=D, std::enable_if_t <DIR == Direction::forward ||
71105 DIR == Direction::both, int > = 0 >
72106 void forward (MF const & inmf);
73107
108+ /* *
109+ * \brief Forward transform
110+ *
111+ * This function is not available when this class template is
112+ * instantiated for backward-only transform.
113+ *
114+ * \param inmf input data in MultiFab or FabArray<BaseFab<float>>
115+ * \param outmf output data in FabArray<BaseFab<GpuComplex<T>>>
116+ */
74117 template <Direction DIR=D, std::enable_if_t <DIR == Direction::forward ||
75118 DIR == Direction::both, int > = 0 >
76119 void forward (MF const & inmf, cMF& outmf);
77120
121+ /* *
122+ * \brief Backward transform
123+ *
124+ * This function is available only when this class template is
125+ * instantiated for transforms in both directions.
126+ *
127+ * \param outmf output data in MultiFab or FabArray<BaseFab<float>>
128+ */
78129 template <Direction DIR=D, std::enable_if_t <DIR == Direction::both, int > = 0 >
79130 void backward (MF& outmf);
80131
132+ /* *
133+ * \brief Backward transform
134+ *
135+ * This function is not available when this class template is
136+ * instantiated for forward-only transform.
137+ *
138+ * \param inmf input data in FabArray<BaseFab<GpuComplex<T>>>
139+ * \param outmf output data in MultiFab or FabArray<BaseFab<float>>
140+ */
81141 template <Direction DIR=D, std::enable_if_t <DIR == Direction::backward ||
82142 DIR == Direction::both, int > = 0 >
83143 void backward (cMF const & inmf, MF& outmf);
84144
145+ /* *
146+ * \brief Get the internal spectral data
147+ *
148+ * This function is not available when this class template is
149+ * instantiated for backward-only transform. For performance reasons,
150+ * the returned data array does not have the usual ordering of
151+ * `(x,y,z)`. The order is specified in the second part of the return
152+ * value.
153+ */
85154 template <Direction DIR=D, std::enable_if_t <DIR == Direction::forward ||
86155 DIR == Direction::both, int > = 0 >
87156 std::pair<cMF*,IntVect> getSpectralData ();
0 commit comments