Allgemeine Relativitätstheorie mit dem Computer 
General Theory of Relativity on the Computer 

Vorlesung gehalten an der J.W.Goethe-Universität in Frankfurt am Main (Sommersemester 2016) 
von Dr.phil.nat. Dr.rer.pol. Matthias Hanauske
Frankfurt am Main 11.04.2016

Dritter Vorlesungsteil: Computersimulationen mit dem Einstein-Toolkit 
III.5) Migration eines instabilen Neutronensterns

<< SimulationTools`
<< h5mma`
SimulationTools`$SimulationPath={"/media/hanauske/79e09806-79c8-4fad-ad62-dabe9db9d8d8/VARTC/ET/output/"};
SimulationNames[];
SimName="migration";

Auflistung der Ausgabedateien der Simulation

FindSimulationFiles[SimName,"*.h5"]

Welche Iterationszeitpunkte wurden ausgegeben und wie groß ist der Abstand zwischen ihnen:

ListIterations:=ReadIterations[SimName,"rho","x"]
itend:=Length[ReadIterations[SimName,"rho","x"]]-1
dt:=ListIterations[[2]]-ListIterations[[1]]

Darstellung des Dichteprofils (rho(x) bzw. Log(rho(x)) am Anfang der Simulation (t=0).

rhox[t_]:=ReadGridFunction[SimName,"rho","x",Iteration->t];
time:=dt*0
Rend:=30
P1:=ListLinePlot[rhox[time],PlotRange->{{0,Rend},{0,0.008}}];
P2:=ListLinePlot[Log[rhox[time]],PlotRange->{{0,Rend},All}];
GraphicsGrid[{{P1,P2}},ImageSize->900]

Zeitliche Animation des Dichteprofils (rho(x) bzw. Log(rho(x)). Bem.: Im Logarithmischen Plot erkennt man gut, dass die Abmessungen des Gitters (30 )viel zu klein sind (man hätte hier mehrere Refinement-Levels mit weit größeren Abmessung wählen sollen).

A1:=Animate[ListLinePlot[rhox[itr*dt],PlotRange->{{0,Rend},{0,0.008}}],{itr,0,itend,1},DisplayAllSteps->True,AnimationRunning->False];
A2:=Animate[ListLinePlot[Log[rhox[itr*dt]],PlotRange->{{0,Rend},All}],{itr,0,itend,1},DisplayAllSteps->True,AnimationRunning->False];
GraphicsGrid[{{A1,A2}},ImageSize->900]

Darstellung des Dichteprofils rho(x,y), der Lapse Funktion alpha(x,y) und der Flüssigkeits-Geschwindigkeitskomponente in x-Richtung vx(x,y) am Anfang der Simulation (t=0) und zur Iterationszeit 20*dt=400 .

itr=0;
rhoxy[t_]:=ReadGridFunction[SimName,"rho","xy",Iteration->t*dt]
alpha[t_]:=ReadGridFunction[SimName,"alp","xy",Iteration->t*dt]
velXxy[t_]:=ReadGridFunction[SimName,"vel[0]","xy",Iteration->t*dt]
Pa1=ListPlot3D[rhoxy[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["rho.xy",Black,18]]];
Pa2=ListPlot3D[alpha[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["alp.xy",Black,18]]];
Pa3=ListPlot3D[velXxy[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["vel[0].xy",Black,18]]];
GraphicsGrid[{{Pa1,Pa2,Pa3}},ImageSize->1600]
itr=15;
Pb1=ListPlot3D[rhoxy[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["rho.xy",Black,18]]];
Pb2=ListPlot3D[alpha[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["alp.xy",Black,18]]];
Pb3=ListPlot3D[velXxy[itr],AxesLabel->{"x","y",""},ColorFunction->ColorData["TemperatureMap"],BoxRatios->{Automatic,Automatic,10},PlotRange->All,PlotLabel->Text[Style["vel[0].xy",Black,18]]];
GraphicsGrid[{{Pb1,Pb2,Pb3}},ImageSize->1600]

Animation des Dichteprofils rho(x,y) und Log(rho(x,y))

Rend:=30;
A3:=Animate[ArrayPlot[rhoxy[itr],PlotRange->{{0,Rend},{0,Rend}},ColorFunction->ColorData[{"TemperatureMap",{0,1}}],FrameTicks->True,FrameLabel->{"y","x"},PlotLabel->"equitorial density",PlotRange->All],{itr,0,itend,1},DisplayAllSteps->True,AnimationRunning->False];
A4:=Animate[ArrayPlot[Log[rhoxy[itr]],PlotRange->{{0,Rend},{0,Rend}},ColorFunction->ColorData[{"TemperatureMap",{0,1}}],FrameTicks->True,FrameLabel->{"y","x"},PlotLabel->"equitorial density",PlotRange->All],{itr,0,itend,1},DisplayAllSteps->True,AnimationRunning->False];
GraphicsGrid[{{A3,A4}},ImageSize->900]

Zeitliche Entwicklung des Maximalwertes der Dichte

str=OpenRead[StringJoin["/media/hanauske/simdata/outloewe/",SimName,"/rho.maximum.asc"]];
Skip[str,String,6];
rhomax=ReadList[str,Table[Real,{i,1,3}]];
NP:=Dimensions[rhomax][[1]]-1
NP
data=Table[{rhomax[[n,2]],rhomax[[n,3]]},{n,1,NP}];
ListLinePlot[data,PlotRange->{All,All}]

Export["dens.avi",A3]