Metric
-
template<typename Type>
class Metric The base class of all kinds of metrics.
Subclassed by SBody::Hayward< Type >, SBody::Kerr< Type >, SBody::KerrNewman< Type >, SBody::KerrTaubNUT< Type >, SBody::Newton< Type >, SBody::ReissnerNordstrom< Type >, SBody::Schwarzschild< Type >
Public Functions
-
virtual std::string Name() const = 0
Return the name of the metric.
- Returns:
name of the metric.
-
virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) = 0
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
template<typename VecExp1, typename VecExp2>
inline Type DotProduct(const boost::numeric::ublas::bounded_vector<Type, 8> &position, const VecExp1 &x, const VecExp2 &y, bool include_time) Dot product of vector
x
andy
atposition
. \(g_{\mu\nu}x^\mu y^\nu\).- Parameters:
position – 4 dimensional vector, position to calcuate the dot product of
x
andy
.x – 4 dimensional vector
y – 4 dimensional vector
include_time – include time related terms if true.
- Returns:
result
-
virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) = 0
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline int LocalInertialFrame(const boost::numeric::ublas::bounded_vector<Type, 8> &position, TimeSystem time, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &coordinate)
Calculate the local inertial frame coordinate of the object at
position
, stored incoordinate
.- Parameters:
position – 8 dimensional vector
time – time systme of the object
coordinate – matrix with size 4×4
- Returns:
status
-
virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) = 0
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) = 0
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) = 0
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) = 0
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) = 0
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) = 0
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type Redshift(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const boost::numeric::ublas::bounded_vector<Type, 8> &photon_position, TimeSystem object_time, TimeSystem photon_time)
Calculate the redshift of the object, \(1+z\).
- Parameters:
y – 8 dimensional vector of the object
photon – photon traced to the object
object_time – time system of the object
photon_time – time system of the photon
- Returns:
result
-
virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) = 0
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) = 0
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) = 0
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
virtual std::string Name() const = 0
Newton & Post-Newtonian
-
template<typename Type>
class Newton : public SBody::Metric<Type> Post-Newtonian.
Subclassed by SBody::PN1< Type >
Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
inline virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
inline virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type Redshift(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const boost::numeric::ublas::bounded_vector<Type, 8> &photon_position, TimeSystem object_time, TimeSystem photon_time) override
Calculate the redshift of the object, \(1+z\).
- Parameters:
y – 8 dimensional vector of the object
photon – photon traced to the object
object_time – time system of the object
photon_time – time system of the photon
- Returns:
result
-
inline virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
-
template<typename Type>
class PN1 : public SBody::Newton<Type> Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
Schwarzschild
Reissner-Nördstrom
-
template<typename Type>
class ReissnerNordstrom : public SBody::Metric<Type> Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
inline virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
inline virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
Kerr
-
template<typename Type>
class Kerr : public SBody::Metric<Type> Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
inline virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
inline virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
Kerr-Newman
-
template<typename Type>
class KerrNewman : public SBody::Metric<Type> Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
inline virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
inline virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
Kerr-Taub-NUT
-
template<typename Type>
class KerrTaubNUT : public SBody::Metric<Type> Public Functions
-
inline virtual std::string Name() const override
Return the name of the metric.
- Returns:
name of the metric.
-
inline virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
inline virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
inline virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
inline virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
inline virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
inline virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
inline virtual std::string Name() const override
Hayward
-
template<typename Type>
class Hayward : public SBody::Metric<Type> Public Functions
-
virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override
Calculate the metric tensor at
position
, stored inmetric
.- Parameters:
position – 4 dimensional vector
metric – matrix with size 4×4
- Returns:
status
-
virtual Type DistanceSquare(const boost::numeric::ublas::bounded_vector<Type, 8> &x, const boost::numeric::ublas::bounded_vector<Type, 8> &y, bool include_time) override
Calculate the square of the distance between
x
andy
atx
. \(g_{\mu\nu}(x^\mu-y^\mu)(x^\nu-y^\nu)\).- Parameters:
x – 8 dimensional vector
y – 8 dimensional vector
- Returns:
result
-
virtual int LagrangianToHamiltonian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Lagrangian to Hamiltonian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int HamiltonianToLagrangian(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Convert the coordinate system from Hamiltonian to Lagrangian.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int FastTrace(const Type r_observer, const Type theta_observer, const Type sin_theta_observer, const Type cos_theta_observer, const Type r_object, const Type theta_object, const Type phi_object, Type &alpha, Type &beta, boost::numeric::ublas::bounded_vector<Type, 8> &photon, Type &photon_time) override
Trace the photon from the observer to the target, using elliptic integrals.
- Parameters:
r_observer – radius of the observer, \(r_\text{obs}\).
theta_observer – theta of the observer, \(\theta_\text{obs}\).
sin_theta_observer – std::sin(theta_observer), \(\std::sin\theta_\text{obs}\).
cos_theta_observer – std::cos(theta_observer), \(\std::cos\theta_\text{obs}\).
r_object – radius of the target, \(r_\text{tar}\).
theta_object – theta of the target, \(\theta_\text{tar}\).
phi_object – phi of the target, \(\phi_\text{tar}\).
alpha – x position of the target in the observer’s view.
beta – y position of the target in the observer’s view.
photon – 8 dimensional vector, position and the velocity of the photon traced to the target.
photon_time – look back time of the photon.
- Returns:
status
-
virtual Type Energy(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the energy of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
virtual Type AngularMomentum(const boost::numeric::ublas::bounded_vector<Type, 8> &y, TimeSystem time, DynamicalSystem dynamics) override
Calculate the angular momentum of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
virtual Type CarterConstant(const boost::numeric::ublas::bounded_vector<Type, 8> &y, const Type mu2, TimeSystem time, DynamicalSystem dynamics) override
Calculate the Carter constant of the object.
- Parameters:
y – 8 dimensional vector
time – time system of the object
dynamics – dynamical system of the object
- Returns:
result
-
virtual int NormalizeTimelikeGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y) override
Normalize the timelike geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual int NormalizeNullGeodesic(boost::numeric::ublas::bounded_vector<Type, 8> &y, Type frequency = 1.) override
Normalize the null geodesic.
- Parameters:
y – 8 dimensional vector
- Returns:
status
-
virtual std::function<void(const boost::numeric::ublas::bounded_vector<Type, 8>&, boost::numeric::ublas::bounded_vector<Type, 8>&, const Type)> GetIntegrationSystem(TimeSystem time, DynamicalSystem dynamics, MotionMode motion = GEODESIC) override
Get the integration system to calculate the motion of the object.
- Parameters:
time – time system of the object
dynamics – dynamical system of the object
motion – motion mode of the object
- Returns:
integrator system
-
virtual int MetricTensor(const boost::numeric::ublas::bounded_vector<Type, 8> &position, boost::numeric::ublas::bounded_matrix<Type, 4, 4> &metric) override