summaryrefslogtreecommitdiff
path: root/Plasmapropagation.lpr
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-08-25 16:00:38 +0200
committerErich Eckner <git@eckner.net>2015-08-25 16:00:38 +0200
commit306cd0f09a4d45be12a062442a46ff9b915ad356 (patch)
tree53e5c7aa3b1f3a2c16c3cd8d50dc704621bc4c95 /Plasmapropagation.lpr
parentab9808b04e22fae1fb867703be71a537ecf604b9 (diff)
downloadPlasmapropagation-306cd0f09a4d45be12a062442a46ff9b915ad356.tar.xz
Tagesendstand, Kampf gegen fftw in vollem Gange
Diffstat (limited to 'Plasmapropagation.lpr')
-rw-r--r--Plasmapropagation.lpr41
1 files changed, 40 insertions, 1 deletions
diff --git a/Plasmapropagation.lpr b/Plasmapropagation.lpr
index 5559f51..d3b8f0a 100644
--- a/Plasmapropagation.lpr
+++ b/Plasmapropagation.lpr
@@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
Classes, SysUtils, CustApp,
{ you can add units after this }
- math, Physikunit, protokollunit;
+ math, Physikunit, protokollunit, fftw_l;
type
@@ -30,7 +30,46 @@ var
start,zeitPhysik,zeitDatei: extended;
prot: tProtokollant;
s,t,u: string;
+
+ xlen,ylen,i,j: longint;
+ ein: Pcomplex_extended;
+ aus: Pextended;
+ plan: fftw_plan_extended;
begin
+
+ xlen:=4;
+ ylen:=4;
+
+ fftw_getmem(ein,xlen*ylen*sizeof(complex_extended));
+ fftw_getmem(aus,xlen*ylen*sizeof(extended));
+
+ plan:=fftw_plan_many_dft_c2r(1,@xlen,ylen,ein,nil,ylen,1,aus,nil,ylen,1,[fftw_measure]);
+
+ for i:=0 to xlen-1 do
+ for j:=0 to ylen-1 do begin
+ (ein+j+i*ylen)^.re:=j;
+ (ein+j+i*ylen)^.im:=i;
+ end;
+ for i:=0 to xlen-1 do begin
+ for j:=0 to ylen-1 do
+ write((ein+j+i*ylen)^.re,' + ',(ein+j+i*ylen)^.im,' *I ; ');
+ writeln;
+ end;
+
+ fftw_execute(plan);
+
+ for i:=0 to xlen-1 do begin
+ for j:=0 to ylen-1 do
+ write((aus+j+i*ylen)^,' ');
+ writeln;
+ end;
+
+ fftw_destroy_plan(plan);
+ fftw_freemem(ein);
+ fftw_freemem(aus);
+
+ halt;
+
prot:=tProtokollant.create('error');
if paramcount<>1 then begin