Poisson equation using FFTW with rectanguar domain
I am trying to solve Poisson equation by using FFTW library with rectangular domain(-4<=x<=4 and -2<=y<=2). I have correct result if domain is square and it is wrong if domain is rectangular. Please give me some suggestion. Thank you so much. Here is my code. #include <stdio.h> #include <math.h> #include <cmath> #include <fftw3.h> #include <iostream> #include <vector> using namespace std; int main() { int N1=64; int N2=32; double pi = 3.141592653589793; double L1 = 8.0; double dx = L1/(double)(N1-1); double L2= 4.0; double dy=L2/(double)(N2-1); std::vector<double> in1(N1*N2,0.0); std::vector