I have been working on a code using FFTW3 and i have gotten the program down to giving only one error: " error: expression must have pointer-to-object type" but multiple times.
The parts giving me trouble are the pointers for fftw_complex, here is everywhere these pointers (fourier_u,fourier_v, and fourier_w) are referenced in my code:
Code:
fftw_complex *fourier_u,*fourier_v,*fourier_w;
...
fourier_u = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * DIM2 );
fourier_v = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * DIM2 );
fourier_w = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * DIM2 );
...
l = 0;
for(k=0;k<(nz/2)+1;k++)
for(j=0;j<ny;j++)
for(i=0;i<nx;i++)
{
fur = (double)creal(vt[j][k][0]);
fui = (double)cimag(vt[j][k][0]);
fvr = (double)creal(vt[j][k][1]);
fvi = (double)cimag(vt[j][k][1]);
fwr = (double)creal(vt[j][k][2]);
fwi = (double)cimag(vt[j][k][2]);
fourier_u[l][0] = fur;
fourier_u[l][1] = fui;
fourier_v[l][0] = fvr;
fourier_v[l][1] = fvi;
fourier_w[l][0] = fwr;
fourier_w[l][1] = fwi;
l++
}
...
I have tested the code and as expected, fur, fui,fvr,fvi,fwr,fwi are all of type double. I tried following an example but when I compile my program (using mpicc) I get the following error message for the last few lines of the portion of the code shown above:
Code:
FinalTurbulence.c(176): error: expression must have pointer-to-object type
fourier_u[l][0] = fur;
^
FinalTurbulence.c(177): error: expression must have pointer-to-object type
fourier_u[l][1] = fui;
^
FinalTurbulence.c(178): error: expression must have pointer-to-object type
fourier_v[l][0] = fvr;
^
FinalTurbulence.c(179): error: expression must have pointer-to-object type
fourier_v[l][1] = fvi;
^
FinalTurbulence.c(180): error: expression must have pointer-to-object type
fourier_w[l][0] = fwr;
^
FinalTurbulence.c(181): error: expression must have pointer-to-object type
fourier_w[l][1] = fwi;
^
I have searched extensively for a solution but have had no luck. Any help would be greatly appreciated. And I can provide more information if needed, but as stated above I included all of the code where the questionable pointers are used. Thanks.