program Plasmapropagation; {$mode objfpc}{$H+} {$INCLUDE Compilerswitches.inc} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, SysUtils, CustApp, { you can add units after this } math, Physikunit, protokollunit, lowlevelunit, fftw, compilerswitchupdateunit; type { TPlasmapropagation } TPlasmapropagation = class(TCustomApplication) protected procedure DoRun; override; public constructor Create(TheOwner: TComponent); override; destructor Destroy; override; end; { TPlasmapropagation } procedure TPlasmapropagation.DoRun; var simulation: tSimulation; start,zeitPhysik,zeitDatei: double; prot: tProtokollant; s,t,u: string; begin prot:=tProtokollant.create('error'); if paramcount<>1 then begin prot.schreibe('Bitte genau einen Parameter übergeben, nämlich die Parameterdatei!',true); prot.destroyAll; halt(1); end; start:=now; s:=extractfilepath(paramstr(0))+'fftWisdom.dat'; if fileexists(s) then if fftw_import_wisdom_from_filename(pChar(s))=0 then begin prot.schreibe('Kann vorhandene Weisheitsdatei '''+s+''' nicht lesen!'); prot.destroyAll; halt(1); end; zeitDatei:=0; zeitPhysik:=0; simulation:=tSimulation.create(paramstr(1),prot,'simulation'); if fftw_export_wisdom_to_filename(pChar(s))=0 then begin prot.schreibe('Kann Weisheitsdatei '''+s+''' nicht schreiben!'); prot.destroyAll; halt(1); end; while simulation.iteriereSchritt(start,zeitPhysik,zeitDatei) do ; case errorCode of 2: prot.schreibe('Simulation wurde auf halbem Wege abgebrochen wegen Überlaufs.',true); 3: prot.schreibe('Simulation wurde auf halbem Wege abgebrochen wegen Benutzereingriffs.',true); end{of case}; simulation.free; prot.schreibe('fertig!',true); s:=timetostr(now-start); t:=timetostr(zeitDatei); u:=timetostr(zeitPhysik); while length(s)