Skip to content

Commit

Permalink
Add dimensionless spin vector to horizon observation
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed May 29, 2024
1 parent 2c32ceb commit 3ccc9a1
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 12 deletions.
17 changes: 9 additions & 8 deletions src/ParallelAlgorithms/ApparentHorizonFinder/HorizonAliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,22 @@ using vars_to_interpolate_to_target =
gr::Tags::SpatialRicci<DataVector, Dim, Frame>>;

template <typename Frame>
using tags_for_observing =
tmpl::list<gr::surfaces::Tags::AreaCompute<Frame>,
gr::surfaces::Tags::IrreducibleMassCompute<Frame>,
ylm::Tags::MaxRicciScalarCompute,
ylm::Tags::MinRicciScalarCompute,
gr::surfaces::Tags::ChristodoulouMassCompute<Frame>,
gr::surfaces::Tags::DimensionlessSpinMagnitudeCompute<Frame>>;
using tags_for_observing = tmpl::list<
gr::surfaces::Tags::AreaCompute<Frame>,
gr::surfaces::Tags::IrreducibleMassCompute<Frame>,
ylm::Tags::MaxRicciScalarCompute, ylm::Tags::MinRicciScalarCompute,
gr::surfaces::Tags::ChristodoulouMassCompute<Frame>,
gr::surfaces::Tags::DimensionlessSpinMagnitudeCompute<Frame>,
gr::surfaces::Tags::DimensionlessSpinVectorCompute<Frame, Frame>>;

using surface_tags_for_observing = tmpl::list<ylm::Tags::RicciScalar>;

template <size_t Dim, typename Frame>
using compute_items_on_target = tmpl::append<
tmpl::list<
ylm::Tags::ThetaPhiCompute<Frame>, ylm::Tags::RadiusCompute<Frame>,
ylm::Tags::RhatCompute<Frame>, ylm::Tags::InvJacobianCompute<Frame>,
ylm::Tags::RhatCompute<Frame>, ylm::Tags::CartesianCoordsCompute<Frame>,
ylm::Tags::InvJacobianCompute<Frame>,
ylm::Tags::InvHessianCompute<Frame>, ylm::Tags::JacobianCompute<Frame>,
ylm::Tags::DxRadiusCompute<Frame>, ylm::Tags::D2xRadiusCompute<Frame>,
ylm::Tags::NormalOneFormCompute<Frame>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ void bind_horizon_quantities_impl(py::module& m) {
db::get<gr::surfaces::Tags::ChristodoulouMass>(box);
result["DimensionlessSpinMagnitude"] =
db::get<gr::surfaces::Tags::DimensionlessSpinMagnitude<Frame>>(box);
result["DimensionlessSpinVector"] =
db::get<gr::surfaces::Tags::DimensionlessSpinVector<Frame>>(box);
return result;
},
py::arg("horizon"), py::arg("spatial_metric"),
Expand Down
26 changes: 26 additions & 0 deletions src/PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,5 +509,31 @@ struct DimensionlessSpinMagnitudeCompute : DimensionlessSpinMagnitude<Frame>,
tmpl::list<DimensionfulSpinMagnitude, ChristodoulouMass>;
};

/// The dimensionless spin angular momentum vector
template <typename Frame>
struct DimensionlessSpinVector : db::SimpleTag {
using type = std::array<double, 3>;
};

/// Computes the dimensionless spin angular momentum vector
template <typename MeasurementFrame, typename MetricDataFrame>
struct DimensionlessSpinVectorCompute
: DimensionlessSpinVector<MeasurementFrame>,
db::ComputeTag {
using base = DimensionlessSpinVector<MeasurementFrame>;
using argument_tags =
tmpl::list<DimensionlessSpinMagnitude<MeasurementFrame>,
AreaElement<MetricDataFrame>, ylm::Tags::RicciScalar,
SpinFunction, ylm::Tags::Strahlkorper<MetricDataFrame>,
ylm::Tags::CartesianCoords<MeasurementFrame>>;
using return_type = std::array<double, 3>;
static constexpr auto function = static_cast<void (*)(
const gsl::not_null<std::array<double, 3>*>, double,
const Scalar<DataVector>&, const Scalar<DataVector>&,
const Scalar<DataVector>&, const ylm::Strahlkorper<MetricDataFrame>&,
const tnsr::I<DataVector, 3, MeasurementFrame>&)>(
&gr::surfaces::spin_vector<MetricDataFrame, MeasurementFrame>);
};

} // namespace Tags
} // namespace gr::surfaces
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ struct MaxRicciScalar;
struct MaxRicciScalarCompute;
struct MinRicciScalar;
struct MinRicciScalarCompute;
template <typename Frame>
struct DimensionfulSpinVector;
template <typename Frame>
struct DimensionfulSpinVectorCompute;
} // namespace ylm::Tags

namespace gr::surfaces::Tags {
Expand Down Expand Up @@ -72,4 +68,8 @@ template <typename Frame>
struct DimensionfulSpinVector;
template <typename MeasurementFrame, typename MetricDataFrame>
struct DimensionfulSpinVectorCompute;
template <typename Frame>
struct DimensionlessSpinVector;
template <typename MeasurementFrame, typename MetricDataFrame>
struct DimensionlessSpinVectorCompute;
} // namespace gr::surfaces::Tags
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.GeneralRelativity.Surfaces.Tags",
TestHelpers::db::test_simple_tag<
gr::surfaces::Tags::DimensionfulSpinVector<Frame::Inertial>>(
"DimensionfulSpinVector");
TestHelpers::db::test_simple_tag<
gr::surfaces::Tags::DimensionlessSpinVector<Frame::Inertial>>(
"DimensionlessSpinVector");
TestHelpers::db::test_simple_tag<
gr::surfaces::Tags::DimensionlessSpinMagnitude<Frame::Inertial>>(
"DimensionlessSpinMagnitude");
Expand Down Expand Up @@ -113,6 +116,10 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.GeneralRelativity.Surfaces.Tags",
gr::surfaces::Tags::DimensionfulSpinVectorCompute<Frame::Inertial,
Frame::Inertial>>(
"DimensionfulSpinVector");
TestHelpers::db::test_compute_tag<
gr::surfaces::Tags::DimensionlessSpinVectorCompute<Frame::Inertial,
Frame::Inertial>>(
"DimensionlessSpinVector");
TestHelpers::db::test_compute_tag<
gr::surfaces::Tags::DimensionlessSpinMagnitudeCompute<Frame::Inertial>>(
"DimensionlessSpinMagnitude");
Expand Down

0 comments on commit 3ccc9a1

Please sign in to comment.