summaryrefslogtreecommitdiff
path: root/Plasmapropagation.lpr
diff options
context:
space:
mode:
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