-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BoostVelocity option to ShapeMap #6363
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,10 @@ template <typename DataType> | |
Scalar<DataType> kerr_horizon_radius( | ||
const std::array<DataType, 2>& theta_phi, const double mass, | ||
const std::array<double, 3>& dimensionless_spin) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Take the boost velocity as an argument here as well, can't hurt |
||
const std::array<double, 3> boost_velocity = {0.0, 0.0, 0.0}; | ||
return kerr_schild_radius_from_boyer_lindquist( | ||
mass * (1.0 + sqrt(1.0 - square(magnitude(dimensionless_spin)))), | ||
theta_phi, mass, dimensionless_spin); | ||
theta_phi, mass, dimensionless_spin, boost_velocity); | ||
} | ||
|
||
template Scalar<DataVector> kerr_horizon_radius( | ||
|
@@ -34,7 +35,8 @@ template <typename DataType> | |
Scalar<DataType> kerr_schild_radius_from_boyer_lindquist( | ||
const double boyer_lindquist_radius, | ||
const std::array<DataType, 2>& theta_phi, const double mass, | ||
const std::array<double, 3>& dimensionless_spin) { | ||
const std::array<double, 3>& dimensionless_spin, | ||
const std::array<double, 3>& boost_velocity) { | ||
const double spin_magnitude_squared = square(magnitude(dimensionless_spin)); | ||
const double mass_squared = square(mass); | ||
|
||
|
@@ -48,20 +50,37 @@ Scalar<DataType> kerr_schild_radius_from_boyer_lindquist( | |
dimensionless_spin[1] * sin_theta * sin_phi + | ||
dimensionless_spin[2] * cos_theta; | ||
|
||
return Scalar<DataType>{boyer_lindquist_radius * | ||
sqrt(square(boyer_lindquist_radius) + | ||
mass_squared * spin_magnitude_squared) / | ||
sqrt(square(boyer_lindquist_radius) + | ||
mass_squared * square(spin_dot_unit))}; | ||
const double boost_velocity_x = boost_velocity[0]; | ||
const double boost_velocity_y = boost_velocity[1]; | ||
const double boost_velocity_z = boost_velocity[2]; | ||
const double lorentz_factor_squared = | ||
1.0 / (1.0 - (square(boost_velocity_x) + square(boost_velocity_y) + | ||
square(boost_velocity_z))); | ||
|
||
Scalar<DataType> unboosted_kerr_schild_radius = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this up and return it directly if the boost is zero. |
||
Scalar<DataType>{boyer_lindquist_radius * | ||
sqrt(square(boyer_lindquist_radius) + | ||
mass_squared * spin_magnitude_squared) / | ||
sqrt(square(boyer_lindquist_radius) + | ||
mass_squared * square(spin_dot_unit))}; | ||
|
||
return Scalar<DataType>{sqrt(square(get(unboosted_kerr_schild_radius)) + | ||
lorentz_factor_squared * | ||
square(get(unboosted_kerr_schild_radius)) * | ||
square(cos_phi * sin_theta * boost_velocity_x + | ||
sin_phi * sin_theta * boost_velocity_y + | ||
cos_theta * boost_velocity_z))}; | ||
} | ||
|
||
template Scalar<DataVector> kerr_schild_radius_from_boyer_lindquist( | ||
const double boyer_lindquist_radius, | ||
const std::array<DataVector, 2>& theta_phi, const double mass, | ||
const std::array<double, 3>& dimensionless_spin); | ||
const std::array<double, 3>& dimensionless_spin, | ||
const std::array<double, 3>& boost_velocity); | ||
|
||
template Scalar<double> kerr_schild_radius_from_boyer_lindquist( | ||
const double boyer_lindquist_radius, const std::array<double, 2>& theta_phi, | ||
const double mass, const std::array<double, 3>& dimensionless_spin); | ||
const double mass, const std::array<double, 3>& dimensionless_spin, | ||
const std::array<double, 3>& boost_velocity); | ||
|
||
} // namespace gr::Solutions |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,12 +43,25 @@ namespace gr::Solutions { | |
* \f] | ||
* where the angles are encoded in \f$\hat x\f$ and everything else on the | ||
* right-hand side is constant. | ||
* | ||
* The Kerr-Schild radius can be Lorentz boosted in an arbitrary direction | ||
* \f$\vec{\beta}\f$. We apply a Lorentz transformation on the Cartesian | ||
* Kerr-Schild coordinates and find that the boosted Kerr-Schild radius \f$r'\f$ | ||
* as a function of angles satisfies | ||
* \f[ | ||
* r'^2 = r^2 (1 + \gamma^2 \left( \beta_x\cos\phi\sin\theta + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these angles in the boosted or unboosted frame? I think they should be in the boosted frame (see comment in the test below). |
||
* \beta_y\sin\phi\sin\theta + \beta_z\cos\theta \right)^2) | ||
* \f] | ||
* where \f$\gamma = \frac{1}{\sqrt{1 - \beta^2}}\f$ is the Lorentz factor, and | ||
* the components of \f$\vec{\beta}\f$ are given in Cartesian Kerr-Schild | ||
* coordinates. | ||
*/ | ||
template <typename DataType> | ||
Scalar<DataType> kerr_schild_radius_from_boyer_lindquist( | ||
const double boyer_lindquist_radius, | ||
const std::array<DataType, 2>& theta_phi, double mass, | ||
const std::array<double, 3>& dimensionless_spin); | ||
const std::array<double, 3>& dimensionless_spin, | ||
const std::array<double, 3>& boost_velocity); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default this to zero, then you don't have to change some places where you call this function with zero boost. |
||
/*! | ||
* \brief The Kerr-Schild radius corresponding to a Kerr horizon. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
#include "Framework/CheckWithRandomValues.hpp" | ||
#include "Framework/SetupLocalPythonEnvironment.hpp" | ||
#include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrHorizon.hpp" | ||
#include "PointwiseFunctions/SpecialRelativity/LorentzBoostMatrix.hpp" | ||
#include "Utilities/ConstantExpressions.hpp" | ||
|
||
namespace gr::Solutions { | ||
|
@@ -104,9 +105,35 @@ | |
const DataVector phi{M_PI_2 * 0.4, M_PI * 0.55, M_PI_4, M_PI_4 * 1.2, M_PI}; | ||
const std::array<DataVector, 2> theta_phi{ | ||
{std::move(theta), std::move(phi)}}; | ||
CHECK_ITERABLE_APPROX(kerr_schild_radius_from_boyer_lindquist( | ||
r_plus, theta_phi, mass, dimless_spin), | ||
kerr_horizon_radius(theta_phi, mass, dimless_spin)); | ||
const std::array<double, 3> no_boost_velocity = {0.0, 0.0, 0.0}; | ||
CHECK_ITERABLE_APPROX( | ||
kerr_schild_radius_from_boyer_lindquist( | ||
r_plus, theta_phi, mass, dimless_spin, no_boost_velocity), | ||
kerr_horizon_radius(theta_phi, mass, dimless_spin)); | ||
|
||
const Scalar<DataVector> unboosted_radius = | ||
kerr_horizon_radius(theta_phi, mass, dimless_spin); | ||
tnsr::I<DataVector, 3> unboosted_coords = {}; | ||
get<0>(unboosted_coords) = get(unboosted_radius) * cos(phi) * sin(theta); | ||
Check failure on line 117 in tests/Unit/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Test_KerrHorizon.cpp GitHub Actions / Clang-tidy (Release)
|
||
get<1>(unboosted_coords) = get(unboosted_radius) * sin(phi) * sin(theta); | ||
get<2>(unboosted_coords) = get(unboosted_radius) * cos(theta); | ||
const std::array<double, 3> boost_velocity = {0.1, -0.05, 0.07}; | ||
tnsr::I<DataVector, 3> boosted_coords = | ||
make_with_value<tnsr::I<DataVector, 3>>( | ||
get<0>(unboosted_coords), | ||
std::numeric_limits<double>::signaling_NaN()); | ||
sr::lorentz_boost(make_not_null(&boosted_coords), unboosted_coords, 0.0, | ||
boost_velocity); | ||
Scalar<DataVector> boosted_radius = Scalar<DataVector>{ | ||
Check failure on line 127 in tests/Unit/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Test_KerrHorizon.cpp GitHub Actions / Clang-tidy (Release)
|
||
sqrt(square(get<0>(boosted_coords)) + square(get<1>(boosted_coords)) + | ||
square(get<2>(boosted_coords)))}; | ||
Comment on lines
+127
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// Test for boosted Kerr horizon. | ||
// Boosted horizon should be equivalent to applying Lorentz transformation | ||
// on unboosted coordinates. | ||
CHECK_ITERABLE_APPROX( | ||
kerr_schild_radius_from_boyer_lindquist(r_plus, theta_phi, mass, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I have to think about this more, but I am confused about angles. The angles passed in here should be in the boosted frame I think. So these should be the angles you get when you transform the boosted Cartesian coords to polar coords. |
||
dimless_spin, boost_velocity), | ||
boosted_radius); | ||
} | ||
} | ||
} // namespace gr::Solutions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix sentence