#include "fieldslice.h" #include "dataTypes.h" #include "cufft.h" #include #include using namespace std; fieldslice::fieldslice(unsigned int x_size, unsigned int y_size) { x_hat = y_hat = z_hat = NULL; //save the slice resolution R[0] = x_size; R[1] = x_size; scalarField = true; init_gpu(); } void fieldslice::toAngularSpectrum() { cufftHandle plan; cufftResult result; //create a CUFFT plan handle #ifdef PRECISION_SINGLE result = cufftPlan2d(&plan, R[0], R[1], CUFFT_C2C); #elif defined PRECISION_DOUBLE result = cufftPlan2d(&plan, R[0], R[1], CUFFT_Z2Z); #endif if(result != CUFFT_SUCCESS) { cout<<"Error creating CUFFT plan for computing the angular spectrum."<