On 5 Nov 2017, at 09:28, Nisa Amir nisaamir@math.qau.edu.pk wrote:
Actually, when in the einsteinexact thorn there is a mathematica package named EinsteinExact. The documentation said that if you want to add some new space time add the space time in that mathematica package. I want to add non kerr which is in polar coordinates to that package, so that it generates a new thorn but I dont know how to do that. Kindly guide me.
Hi,
Yes, you can add a new spacetime to the Metrics package (in Cactus/arrangements/EinsteinExact/m/Metrics/metrics). See the examples in there. For example, Schwarzschild.m:
(* ::Package:: *)
{ "Name" -> "Schwarzschild", "Description" -> "Schwarzschild spacetime", "Dimensions" -> 4, "Coordinates" -> {t, r, [Theta], [Phi]}, "Parameters" -> {M}, "Metric" -> {{-1 + 2 M / r, 0, 0, 0}, {0, 1/(1 - 2 M / r), 0, 0}, {0, 0, r^2, 0}, {0, 0, 0, r^2 Sin[[Theta]]^2}}, "SignDet" -> -1 }
The EinsteinExact package then uses this information to generate an exact solution thorn, which can be used for initial data in a numerical relativity evolution. However, it only supports metrics which are explicitly given in Cartesian coordinates, so for example, the Schwarzschild example won't work with it (the Metrics package is generic, and is used also in other contexts, outside EinsteinExact).
There is a check in arrangements/EinsteinExact/m/EinsteinExact.m that the metric is in Cartesian coordinates. I suspect that the only reason for this check is that it wouldn't know what Cactus gridfunctions to use for anything else.
Since you want to do the evolution in polar coordinates, I assume that you are going to have some mapping between x, y and z, and r, th and ph? I must admit I have never tried to do something like this.
There are people on this list who have done evolutions in polar coordinates; maybe one of them could give some advice about whether what you are trying to do is feasible? Maybe you could give more details about what you are trying to do?
PS: *please* include users@einsteintoolkit.org in the CC when you reply. If you reply just to me, then nobody else benefits from the discussion, and nobody else has the opportunity to help you.
Yes, the mathematica package is given but it accepts the metric only in cartesian coordinates. I want to add the spacetime non kerr which is in polar coordinates to the mathematica package in Einstein Exact thorn. What transformations should I made?
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Mon, Nov 6, 2017 at 9:11 PM, Ian Hinder ian.hinder@aei.mpg.de wrote:
On 5 Nov 2017, at 09:28, Nisa Amir nisaamir@math.qau.edu.pk wrote:
Actually, when in the einsteinexact thorn there is a mathematica package
named EinsteinExact. The documentation said that if you want to add some new space time add the space time in that mathematica package. I want to add non kerr which is in polar coordinates to that package, so that it generates a new thorn but I dont know how to do that.
Kindly guide me.
Hi,
Yes, you can add a new spacetime to the Metrics package (in Cactus/arrangements/EinsteinExact/m/Metrics/metrics). See the examples in there. For example, Schwarzschild.m:
(* ::Package:: *)
{ "Name" -> "Schwarzschild", "Description" -> "Schwarzschild spacetime", "Dimensions" -> 4, "Coordinates" -> {t, r, [Theta], [Phi]}, "Parameters" -> {M}, "Metric" -> {{-1 + 2 M / r, 0, 0, 0}, {0, 1/(1 - 2 M / r), 0, 0}, {0, 0, r^2, 0}, {0, 0, 0, r^2 Sin[[Theta]]^2}}, "SignDet" -> -1 }
The EinsteinExact package then uses this information to generate an exact solution thorn, which can be used for initial data in a numerical relativity evolution. However, it only supports metrics which are explicitly given in Cartesian coordinates, so for example, the Schwarzschild example won't work with it (the Metrics package is generic, and is used also in other contexts, outside EinsteinExact).
There is a check in arrangements/EinsteinExact/m/EinsteinExact.m that the metric is in Cartesian coordinates. I suspect that the only reason for this check is that it wouldn't know what Cactus gridfunctions to use for anything else.
Since you want to do the evolution in polar coordinates, I assume that you are going to have some mapping between x, y and z, and r, th and ph? I must admit I have never tried to do something like this.
There are people on this list who have done evolutions in polar coordinates; maybe one of them could give some advice about whether what you are trying to do is feasible? Maybe you could give more details about what you are trying to do?
PS: *please* include users@einsteintoolkit.org in the CC when you reply. If you reply just to me, then nobody else benefits from the discussion, and nobody else has the opportunity to help you.
-- Ian Hinder http://members.aei.mpg.de/ianhin
On 7 Nov 2017, at 14:04, Nisa Amir nisaamir@math.qau.edu.pk wrote:
Yes, the mathematica package is given but it accepts the metric only in cartesian coordinates. I want to add the spacetime non kerr which is in polar coordinates to the mathematica package in Einstein Exact thorn. What transformations should I made?
Hi,
You can apply the usual basis transformations in Mathematica to generate the metric in a quasi-Cartesian basis and coordinates. This will then allow you to construct the spacetime numerically in these coordinates, and the thorns in the toolkit which expect quasi-Cartesian coordinates will just work, for example the horizon finder. You would then evolve in 3+1 dimensions. I have done this for Kerr in Boyer-Lindquist coordinates using the xAct tensor manipulation package. This is not straightforward, and it's not something that I would take on lightly if you don't have much experience with EinsteinExact or xAct.
However, you have said that you want to store the gridfunctions in polar coordinates, and do the evolution in polar coordinates. I have no experience with this, and many of the thorns in the toolkit which expect quasi-Cartesian coordinates will just not work (e.g. the horizon finder). That is why I asked you what you are trying to do. Please can you answer that, before we go into a lot of detail about how to do it in one particular way, which may in the end not help you?
Thanks!
I am just trying to add this spacetime, I dont want to use it in some other thorns of the toolkit. and I am not familiar with xAct package.
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Tue, Nov 7, 2017 at 8:31 PM, Ian Hinder ian.hinder@aei.mpg.de wrote:
On 7 Nov 2017, at 14:04, Nisa Amir nisaamir@math.qau.edu.pk wrote:
Yes, the mathematica package is given but it accepts the metric only in cartesian coordinates. I want to add the spacetime non kerr which is in polar coordinates to the mathematica package in Einstein Exact thorn. What transformations should I made?
Hi,
You can apply the usual basis transformations in Mathematica to generate the metric in a quasi-Cartesian basis and coordinates. This will then allow you to construct the spacetime numerically in these coordinates, and the thorns in the toolkit which expect quasi-Cartesian coordinates will just work, for example the horizon finder. You would then evolve in 3+1 dimensions. I have done this for Kerr in Boyer-Lindquist coordinates using the xAct tensor manipulation package. This is not straightforward, and it's not something that I would take on lightly if you don't have much experience with EinsteinExact or xAct.
However, you have said that you want to store the gridfunctions in polar coordinates, and do the evolution in polar coordinates. I have no experience with this, and many of the thorns in the toolkit which expect quasi-Cartesian coordinates will just not work (e.g. the horizon finder). That is why I asked you what you are trying to do. Please can you answer that, before we go into a lot of detail about how to do it in one particular way, which may in the end not help you?
Thanks!
-- Ian Hinder http://members.aei.mpg.de/ianhin
On 7 Nov 2017, at 17:37, Nisa Amir nisaamir@math.qau.edu.pk wrote:
I am just trying to add this spacetime, I dont want to use it in some other thorns of the toolkit. and I am not familiar with xAct package.
Hi,
The below patch modifies EinsteinExact so that it is able to generate thorns from metrics which are in spherical polar coordinates. It achieves this by mapping the polar coordinate r,th,ph to the CartGrid3D x,y,z required by ADMBase. You can use this to generate the existing Schwarzschild metric from the Metrics package. Note that this means that your x, y, z coordinates in the simulation are really r, th and ph, and that much of the rest of the toolkit will not know how to deal with this, but if you really don't want to use any other thorns, then that shouldn't be a problem.
diff --git a/m/EinsteinExact.m b/m/EinsteinExact.m index 80eaff2..93b7fff 100644 --- a/m/EinsteinExact.m +++ b/m/EinsteinExact.m @@ -247,11 +247,12 @@ idThorn[spacetime_, thorn_] := Print["Generating thorn ", thorn, " for ", spacetime, " spacetime."];
(* Load the spacetime: coordinates, metric, inverse metric *) - coordRule = {t -> T, x -> X, y -> Y, z -> Z, None -> {}}; + coordRule = {t -> T, x -> X, y -> Y, z -> Z, None -> {}, + r -> X, [Theta] -> Y, [Phi] -> Z};
coords = MetricProperty[spacetime, "Coordinates"] /. coordRule; If[coords =!= {T, X, Y, Z}, - Throw["Error, only metrics in Cartesian coordinates are supported"]; + Throw["Error, only metrics in Cartesian or spherical polar coordinates are supported"]; ]; spatialCoords = coords[[2;;]];
@@ -456,7 +457,8 @@ g_{ab} = StringForm[doctext] ]
-spacetimes = {"GaugeWave", "KerrSchild", "Minkowski", "ShiftedGaugeWave", "Vaidya", "ModifiedSchwarzschildBL"}; +(* spacetimes = {"GaugeWave", "KerrSchild", "Minkowski", "ShiftedGaugeWave", "Vaidya", "ModifiedSchwarzschildBL"}; *) +spacetimes = {"Schwarzschild"}; thornNameRules = {"Vaidya" -> "Vaidya2"};
thorns = spacetimes /. thornNameRules;
users@lists.einsteintoolkit.org