Skip to content
Snippets Groups Projects
Commit 331210f3 authored by Christoph Pflaum's avatar Christoph Pflaum
Browse files

FFT grid symmetrisch gemacht

parent 856f8fca
No related merge requests found
......@@ -85,7 +85,7 @@ void VariableFFT::interpolate(Variable2D<std::complex<double> >& v,
VariableFFT::VariableFFT(int tx, int ty, Rechteck& ugRectangle) :
Variable2D<std::complex<double> >(
*(blockgrid = new Blockgrid2D(&ugRectangle,powerTwo(tx)-1,powerTwo(ty)-1))) {
*(blockgrid = new Blockgrid2D(&ugRectangle,powerTwo(tx),powerTwo(ty)))) {
ownBlockGrid = true;
init();
......@@ -154,17 +154,17 @@ VariableFFT::~VariableFFT() {
void VariableFFT::FFT() {
Update<rectangleEl>(0);
for(int j=0;j<=Ny;++j) {
for(int j=0;j<Ny;++j) {
std::complex<double>* startValue = &(data_rectangles[0][( Nx+1 ) *j]);
FourierTransform::FFT(startValue,Nx+1);
FourierTransform::FFT(startValue,Nx);
}
for(int i=0;i<=Nx;++i) {
for(int j=0;j<=Ny;++j) {
for(int i=0;i<Nx;++i) {
for(int j=0;j<Ny;++j) {
startValueY[j] = data_rectangles[0][i + ( Nx+1 ) *j];
}
FourierTransform::FFT(startValueY,Ny+1);
for(int j=0;j<=Ny;++j) {
FourierTransform::FFT(startValueY,Ny);
for(int j=0;j<Ny;++j) {
data_rectangles[0][i + ( Nx+1 ) *j] = startValueY[j];
}
}
......@@ -176,19 +176,19 @@ void VariableFFT::FFT() {
void VariableFFT::inversFFT() {
Update<rectangleEl>(0);
for(int i=0;i<=Nx;++i) {
for(int j=0;j<=Ny;++j) {
for(int i=0;i<Nx;++i) {
for(int j=0;j<Ny;++j) {
startValueY[j] = data_rectangles[0][i + ( Nx+1 ) *j];
}
FourierTransform::iFFT(startValueY,Nx+1);
for(int j=0;j<=Ny;++j) {
FourierTransform::iFFT(startValueY,Nx);
for(int j=0;j<Ny;++j) {
data_rectangles[0][i + ( Nx+1 ) *j] = startValueY[j];
}
}
for(int j=0;j<=Ny;++j) {
for(int j=0;j<Ny;++j) {
complex<double>* startValue = &(data_rectangles[0][( Nx+1 ) *j]);
FourierTransform::iFFT(startValue,Nx+1);
FourierTransform::iFFT(startValue,Nx);
}
Update_back(0);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment