Skip to content

Commit

Permalink
Merge pull request sxs-collaboration#5688 from nikwit/KS-christoffel
Browse files Browse the repository at this point in the history
Add spacetime Christoffel symbols to Kerr-Schild spacetime
  • Loading branch information
knelli2 authored Jan 4, 2024
2 parents 44798f9 + b3621ed commit 10c0957
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#include "DataStructures/Tensor/EagerMath/Trace.hpp"
#include "Options/ParseError.hpp"
#include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp"
#include "PointwiseFunctions/GeneralRelativity/DerivativesOfSpacetimeMetric.hpp"
#include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp"
#include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp"
#include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
#include "Utilities/ConstantExpressions.hpp"
#include "Utilities/ContainerHelpers.hpp"
Expand Down Expand Up @@ -756,6 +758,41 @@ KerrSchild::IntermediateVars<DataType, Frame>::get_var(
spatial_christoffel_second_kind, inverse_spatial_metric);
}

template <typename DataType, typename Frame>
tnsr::Abb<DataType, 3, Frame>
KerrSchild::IntermediateVars<DataType, Frame>::get_var(
const IntermediateComputer<DataType, Frame>& computer,
gr::Tags::SpacetimeChristoffelSecondKind<DataType, 3, Frame> /*meta*/) {
const auto& lapse = get_var(computer, gr::Tags::Lapse<DataType>{});
const auto& shift = get_var(computer, gr::Tags::Shift<DataType, 3, Frame>{});
const auto& spatial_metric =
get_var(computer, gr::Tags::SpatialMetric<DataType, 3, Frame>{});
const auto& inverse_spatial_metric =
get_var(computer, gr::Tags::InverseSpatialMetric<DataType, 3, Frame>{});
const auto& dt_lapse =
get_var(computer, ::Tags::dt<gr::Tags::Lapse<DataType>>{});
const auto& di_lapse = get_var(
computer,
::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<3>, Frame>{});
const auto& dt_shift =
get_var(computer, ::Tags::dt<gr::Tags::Shift<DataType, 3, Frame>>{});
const auto& di_shift =
get_var(computer, ::Tags::deriv<gr::Tags::Shift<DataType, 3, Frame>,
tmpl::size_t<3>, Frame>{});
const auto& dt_spatial_metric = get_var(
computer, ::Tags::dt<gr::Tags::SpatialMetric<DataType, 3, Frame>>{});
const auto& di_spatial_metric = get_var(
computer, ::Tags::deriv<gr::Tags::SpatialMetric<DataType, 3, Frame>,
tmpl::size_t<3>, Frame>{});
const auto inverse_spacetime_metric =
gr::inverse_spacetime_metric(lapse, shift, inverse_spatial_metric);
const auto d_spacetime_metric = gr::derivatives_of_spacetime_metric(
lapse, dt_lapse, di_lapse, shift, dt_shift, di_shift, spatial_metric,
dt_spatial_metric, di_spatial_metric);
return gr::christoffel_second_kind(d_spacetime_metric,
inverse_spacetime_metric);
}

#define DTYPE(data) BOOST_PP_TUPLE_ELEM(0, data)
#define FRAME(data) BOOST_PP_TUPLE_ELEM(1, data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class KerrSchild : public AnalyticSolution<3_st>,
gr::Tags::TraceExtrinsicCurvature<DataType>,
gr::Tags::SpatialChristoffelFirstKind<DataType, 3, Frame>,
gr::Tags::SpatialChristoffelSecondKind<DataType, 3, Frame>,
gr::Tags::TraceSpatialChristoffelSecondKind<DataType, 3, Frame>>>;
gr::Tags::TraceSpatialChristoffelSecondKind<DataType, 3, Frame>,
gr::Tags::SpacetimeChristoffelSecondKind<DataType, 3, Frame>>>;

KerrSchild() = default;
KerrSchild(const KerrSchild& /*rhs*/) = default;
Expand Down Expand Up @@ -552,6 +553,9 @@ class KerrSchild : public AnalyticSolution<3_st>,
const IntermediateComputer<DataType, Frame>& computer,
gr::Tags::TraceSpatialChristoffelSecondKind<DataType, 3,
Frame> /*meta*/);
tnsr::Abb<DataType, 3, Frame> get_var(
const IntermediateComputer<DataType, Frame>& computer,
gr::Tags::SpacetimeChristoffelSecondKind<DataType, 3, Frame> /*meta*/);

private:
// Here null_vector_0 is simply -1, but if you have a boosted solution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void derivatives_of_spacetime_metric(
} // namespace gr

GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3), (double, DataVector),
(Frame::Grid, Frame::Inertial))
(Frame::Grid, Frame::Distorted, Frame::Inertial))

#undef DIM
#undef DTYPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void inverse_spacetime_metric(
inverse_spatial_metric);

GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3), (double, DataVector),
(Frame::Grid, Frame::Inertial))
(Frame::Grid, Frame::Distorted, Frame::Inertial))

#undef DIM
#undef DTYPE
Expand Down

0 comments on commit 10c0957

Please sign in to comment.