@@ -17,8 +17,8 @@ int main(int argc, char *argv[]) {
1717 // Create input field
1818 // DiscreteField<double, 3> input(decomp);
1919
20- auto dimensions = get_inbox_size ( decomp) ;
21- auto offsets = get_inbox_offset ( decomp) ;
20+ auto dimensions = decomp. m_inbox . size ;
21+ auto offsets = decomp. m_inbox . low ;
2222 auto origin = get_origin (world);
2323 auto discretization = get_spacing (world);
2424 DiscreteField<double , 3 > input (dimensions, offsets, origin, discretization);
@@ -30,21 +30,21 @@ int main(int argc, char *argv[]) {
3030 // Fill input field with random numbers
3131 apply (input, [&](auto , auto , auto ) { return dis (gen); });
3232
33+ auto plan_options = heffte::default_options<heffte::backend::fftw>();
34+ FFT fft (decomp, MPI_COMM_WORLD, plan_options, world);
35+
3336 // Create output array to store FFT results. If requested array is of type T =
3437 // complex<double>, then array will be constructed using complex indices so
3538 // that it matches the Fourier-space, i.e. first dimension is floor(Lx/2) + 1.
36- Array<complex <double >, 3 > output (decomp );
39+ Array<complex <double >, 3 > output (get_outbox_size (fft) );
3740
3841 std::cout << " input: " << input << std::endl; // this is {4, 3, 2}
3942 std::cout << " output: " << output << std::endl; // this is {3, 3, 2}
4043
4144 // This would construct an array of type T = <double> with different indices
42- // Array<double, 3> output2(decomp );
45+ // Array<double, 3> output2(fft );
4346 // std::cout << output2 << std::endl; // this is {4, 3, 2}
4447
45- auto plan_options = heffte::default_options<heffte::backend::fftw>();
46- FFT fft (decomp, MPI_COMM_WORLD, plan_options, world);
47-
4848 fft.forward (input, output);
4949
5050 // Display results
0 commit comments