Skip to content
Snippets Groups Projects
Commit 528ebdd5 authored by David Daverio's avatar David Daverio
Browse files

bug in FFTs 2

parent 27cc9c44
No related branches found
No related tags found
Loading
/*! file poissonSolver.cpp
Created by David Daverio.
A simple example of LATfield2d usage. This exec solve the poisson equation in fourier space.
*/
......@@ -25,14 +25,14 @@ int main(int argc, char **argv)
int comp = 1;
double sigma2=0.5;
double res =0.5;
for (int i=1 ; i < argc ; i++ ){
if ( argv[i][0] != '-' )
continue;
switch(argv[i][1]) {
case 'n':
n = atoi(argv[++i]);
n = atoi(argv[++i]);
break;
case 'm':
m = atoi(argv[++i]);
......@@ -42,52 +42,52 @@ int main(int argc, char **argv)
break;
}
}
parallel.initialize(n,m);
Lattice lat(dim,BoxSize,halo);
//Real to complex fourier transform
Lattice latKreal;
latKreal.initializeRealFFT(lat, khalo);
Site x(lat);
rKSite kReal(latKreal);
Field<Real> phi;
phi.initialize(lat,comp);
Field<Imag> phiK;
phiK.initialize(latK,comp);
PlanFFT<Imag> planReal(&phi,&phiK);
planReal.execute(FFT_FORWARD);
planReal.execute(FFT_BACKWARD);
//complex to complex fourier transform
Lattice latKcomplex;
latKcomplex.initializeComplexFFT(lat, khalo);
Site x(lat);
cKSite kComplex(latKreal);
Field<Imag> rho;
rho.initialize(lat,comp);
Field<Imag> rhoK;
rhoK.initialize(latK,comp);
rhoK.initialize(latKcomplex,comp);
PlanFFT<Imag> planComplex(&rho,&rhoK);
planComplex.execute(FFT_FORWARD);
planComplex.execute(FFT_BACKWARD);
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment