1#ifndef APPARENT_HORIZON_FINDER_SPACETIMES_H_
2#define APPARENT_HORIZON_FINDER_SPACETIMES_H_
38 template <
class T>
using FieldMatrix = std::array<std::array<T, 3>, 3>;
45 return std::sqrt(X[0] * X[0] + X[1] * X[1] + X[2] * X[2]);
51 for (
int i = 0; i < 3; ++i) {
52 for (
int j = 0; j < 3; ++j) {
53 result[i][j] = (i == j) ? T(1.0) : T(0.0);
75 for (
int i = 0; i < 3; ++i) {
104 const T H = T(
M) / r;
107 for (
int i = 0; i < 3; ++i) {
108 for (
int j = 0; j < 3; ++j) {
109 result[i][j] += T(2.0) * H * l[i] * l[j];
117 const T H = T(
M) / r;
119 T>{T(2.0) * H * X[0] / r, T(2.0) * H * X[1] / r, T(2.0) * H * X[2] / r};
124 return T(1.0) / std::sqrt(T(1.0) + T(2.0) * H);
142 const T rho2 = X[0] * X[0] + X[1] * X[1] + X[2] * X[2];
143 const T a2 = T(
a) * T(
a);
146 * ((rho2 - a2) + std::sqrt((rho2 - a2) * (rho2 - a2) + T(4.0) * a2 * X[2] * X[2]));
147 return std::sqrt(r2);
153 const T a2 = T(
a) * T(
a);
154 H = T(
M) * r * r * r / (r * r * r * r + a2 * X[2] * X[2]);
156 (r * X[0] + T(
a) * X[1]) / (r * r + a2),
157 (r * X[1] - T(
a) * X[0]) / (r * r + a2),
166 for (
int i = 0; i < 3; ++i) {
167 for (
int j = 0; j < 3; ++j) {
168 result[i][j] += T(2.0) * H * l[i] * l[j];
179 T>{T(2.0) * H * l[0], T(2.0) * H * l[1], T(2.0) * H * l[2]};
186 return T(1.0) / std::sqrt(T(1.0) + T(2.0) * H);
202 std::vector<std::pair<double, FieldVector<double>>>
punctures;
207 const double m = puncture.first;
210 delta{
X[0] - T(p[0]),
X[1] - T(p[1]),
X[2] - T(p[2])};
219 for (
int i = 0; i < 3; ++i) {
235 total += puncture.first;
244 throw std::logic_error(
245 "BrillLindquist::M is only defined for a single-puncture slice"
258 for (
int i = 0; i < 3; ++i) {
259 sum[i] += puncture.first * puncture.second[i];
263 for (
int i = 0; i < 3; ++i) {
271 std::vector<FieldVector<double>> positions;
274 positions.push_back(puncture.second);
293 double separation = 2.0,
297 half[
static_cast<int>(axis)] = 0.5 * separation;
311 double separation = 1.5,
314 const double circumradius = separation / std::sqrt(3.0);
316 const double degToRad = std::numbers::pi / 180.0;
317 const double angles[3] = {
337 std::vector<std::pair<double, FieldVector<double>>>
punctures;
338 for (
double angle : angles) {
340 p[a0] = circumradius * std::cos(angle);
341 p[a1] = circumradius * std::sin(angle);
358 template <
class Spacetime>
360 const Spacetime& spacetime,
T radius(const FieldVector< T > &X)
Euclidean radius |X| = sqrt(sum_i X_i^2); valid for real or complex T.
FieldMatrix< T > identity()
3x3 identity in the scalar type T.
InterpolatedGeometryData MetricData(const Spacetime &spacetime, const Vector3 &X)
Geometry derived from an analytic spacetime at the Cartesian point X, packed into the same Interpolat...
std::array< double, 3 > Vector3
std::array< std::array< T, 3 >, 3 > FieldMatrix
std::array< T, 3 > FieldVector
Analytic spacetimes and the geometry they induce.
Brill-Lindquist multi-puncture initial data (time symmetric, K_ij = 0).
FieldVector< T > beta(const FieldVector< T > &) const
double M() const
Bare mass of the sole puncture; defined only for single-puncture slices.
static BrillLindquist single(double m=1.0, FieldVector< double > center={0.0, 0.0, 0.0})
One puncture of mass m at center (equals Schwarzschild isotropic).
std::vector< FieldVector< double > > puncturePositions() const
Puncture positions, in construction order.
static BrillLindquist triangle(double m=1.0, double separation=1.5, Plane plane=Plane::XY)
Three equal punctures of mass m on an equilateral triangle of side length separation,...
T alpha(const FieldVector< T > &) const
static BrillLindquist binary(double m=1.0, double separation=2.0, Axis axis=Axis::Z)
Two equal punctures of mass m at +/- separation/2 along axis.
double horizonRadius() const
FieldMatrix< T > gamma(const FieldVector< T > &X) const
T psi(const FieldVector< T > &X) const
std::vector< std::pair< double, FieldVector< double > > > punctures
double admMass() const
Exact ADM mass sum_n m_n.
double horizonArea() const
FieldVector< double > centroid() const
Mass-weighted centroid of the punctures (natural common-horizon centre).
Physical and geometrical quantities shared by shell and surface samples.
Kerr in Kerr-Schild Cartesian coordinates, spin a along z.
double horizonRadius() const
FieldMatrix< T > gamma(const FieldVector< T > &X) const
T ksRadius(const FieldVector< T > &X) const
T alpha(const FieldVector< T > &X) const
void HandL(const FieldVector< T > &X, T &H, FieldVector< T > &l) const
FieldVector< T > beta(const FieldVector< T > &X) const
double horizonArea() const
Schwarzschild in isotropic coordinates (time symmetric, K_ij = 0).
T alpha(const FieldVector< T > &) const
T psi(const FieldVector< T > &X) const
double horizonRadius() const
FieldVector< T > beta(const FieldVector< T > &) const
FieldMatrix< T > gamma(const FieldVector< T > &X) const
double horizonArea() const
Schwarzschild in Kerr-Schild coordinates (K_ij != 0, horizon at r = 2M).
T alpha(const FieldVector< T > &X) const
double horizonRadius() const
double horizonArea() const
FieldVector< T > beta(const FieldVector< T > &X) const
FieldMatrix< T > gamma(const FieldVector< T > &X) const