GyotoKerrBL.h
Go to the documentation of this file.
/*
Copyright 2011, 2018 Frederic Vincent, Thibaut Paumard
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoKerrBL_H_
#define __GyotoKerrBL_H_
namespace Gyoto {
namespace Metric { class KerrBL; }
}
#include <GyotoMetric.h>
#include <GyotoWorldline.h>
#ifdef GYOTO_USE_XERCES
#include <GyotoRegister.h>
#endif
#define GYOTO_KERRBL_DEFAULT_DIFFTOL 1e-2
class Gyoto::Metric::KerrBL : public Metric::Generic {
friend class Gyoto::SmartPointer<Gyoto::Metric::KerrBL>;
// Data :
// -----
protected:
double spin_ ;
double a2_ ;
double a3_ ;
double a4_ ;
double difftol_;
double rsink_;
double drhor_;
bool generic_integrator_;
// Constructors - Destructor
// -------------------------
public:
GYOTO_OBJECT;
KerrBL();
virtual KerrBL * clone () const ;
// Accessors
// ---------
public:
void spin(const double spin);
double spin() const ;
double difftol() const;
void difftol(double t);
void horizonSecurity(double drhor);
double horizonSecurity() const;
void genericIntegrator(bool);
bool genericIntegrator() const ;
virtual double getRms() const;
virtual double getRmb() const;
virtual double getSpecificAngularMomentum(double rr) const;
virtual double getPotential(double const pos[4], double l_cst) const;
void gmunu(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const ;
double gmunu(double const x[4], int mu, int nu) const ;
void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const ;
double gmunu_up(double const x[4], int mu, int nu) const ;
using Generic::christoffel;
int christoffel(double dst[4][4][4], const double pos[4]) const ;
double ScalarProd(const double pos[4],
const double u1[4], const double u2[4]) const ;
void nullifyCoord(double coord[8], double & tdot2) const;
void nullifyCoord(double coord[8]) const;
// friend std::ostream& operator<<(std::ostream& , const KerrBL& ) ;
// std::ostream& print(std::ostream&) const ;
virtual void circularVelocity(double const pos[4], double vel [4],
double dir=1.) const ;
virtual void zamoVelocity(double const pos[4], double vel[4]) const ;
public:
virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ;
void MakeMomentum(const double coordin[8], const double cst[5], double coordout[8]) const;
protected:
// outside the API
/* RK4 : y=[r,theta,phi,t,pr,ptheta],
cst=[a,E,L,Q,1/Q],dy/dtau=F(y,cst), h=proper time step.
For KerrBL geodesic computation.
*/
int myrk4(Worldline * line, Gyoto::state_t const &coordin, double h, Gyoto::state_t &res) const; //external-use RK4
public:
int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;
int myrk4_adaptive(Gyoto::Worldline* line, Gyoto::state_t const &coor, double lastnorm, double normref, Gyoto::state_t &coor1, double h0, double& h1, double h1max=GYOTO_DEFAULT_DELTA_MAX) const;
private:
int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const;
void Normalize4v(double coord[8], const double part_mass) const;
public:
using Metric::Generic::diff;
private:
virtual int diff(const double y[8], const double cst[5],
double res[8]) const ;
virtual int diff31(state_t const &x, state_t &dxdt, double mass) const ;
virtual void computeNBeta(const double coord[4],double &NN,double beta[3]) const;//Compute lapse and shift at coord
virtual void computeCst(const double coord[8], double cst[5]) const;
public:
void setParticleProperties(Worldline* line, const double* coord) const;
virtual int isStopCondition(double const coord[8]) const;
virtual void observerTetrad(double const pos[4], double fourvel[4],
double screen1[4], double screen2[4],
double screen3[4]) const ;
};
#endif
GyotoMetric.h
Base class for metric description.
GYOTO_OBJECT
#define GYOTO_OBJECT
Declare class::properties and class::getProperties().
Definition GyotoObject.h:84
GyotoRegister.h
Gyoto registers.
GyotoWorldline.h
Timelike or null geodesics.
Gyoto::Metric::Generic
Base class for metrics.
Definition GyotoMetric.h:162
Gyoto::Metric::Generic::christoffel
virtual double christoffel(const double coord[4], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
Gyoto::Metric::Generic::diff
virtual int diff(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst).
Gyoto::Metric::KerrBL
Metric around a Kerr black-hole in Boyer-Lindquist coordinates.
Definition GyotoKerrBL.h:48
Gyoto::Metric::KerrBL::christoffel
int christoffel(double dst[4][4][4], const double pos[4]) const
Chistoffel symbol.
Gyoto::Metric::KerrBL::getSpecificAngularMomentum
virtual double getSpecificAngularMomentum(double rr) const
Gyoto::Metric::KerrBL::myrk4_adaptive
int myrk4_adaptive(Gyoto::Worldline *line, Gyoto::state_t const &coor, double lastnorm, double normref, Gyoto::state_t &coor1, double h0, double &h1, double h1max=GYOTO_DEFAULT_DELTA_MAX) const
Internal-use adaptive RK4 proxy.
Gyoto::Metric::KerrBL::gmunu_up
void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const
gμ,ν
Gyoto::Metric::KerrBL::getRms
virtual double getRms() const
Gyoto::Metric::KerrBL::MakeCoord
virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const
Inverse function of MakeMomentumAndCst.
Gyoto::Metric::KerrBL::nullifyCoord
void nullifyCoord(double coord[8], double &tdot2) const
Set tdot (coord[4]) such that coord is light-like and return other possible tdot.
Gyoto::Metric::KerrBL::Normalize4v
void Normalize4v(double coord[8], const double part_mass) const
Normalize 4-velocity.
Gyoto::Metric::KerrBL::getRmb
virtual double getRmb() const
Gyoto::Metric::KerrBL::drhor_
double drhor_
horizon security
Definition GyotoKerrBL.h:66
Gyoto::Metric::KerrBL::a4_
double a4_
a2_*a2_
Definition GyotoKerrBL.h:57
Gyoto::Metric::KerrBL::diff31
virtual int diff31(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst) for 3+1 case.
Gyoto::Metric::KerrBL::KerrBL
KerrBL()
Default constructor.
Gyoto::Metric::KerrBL::getPotential
virtual double getPotential(double const pos[4], double l_cst) const
Gyoto::Metric::KerrBL::circularVelocity
virtual void circularVelocity(double const pos[4], double vel[4], double dir=1.) const
Yield circular velocity at a given position.
Gyoto::Metric::KerrBL::ScalarProd
double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const
Scalar product.
Gyoto::Metric::KerrBL::isStopCondition
virtual int isStopCondition(double const coord[8]) const
Check whether integration should stop.
Gyoto::Metric::KerrBL::gmunu
void gmunu(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const
Metric coefficients.
Gyoto::Metric::KerrBL::a2_
double a2_
spin_*spin_
Definition GyotoKerrBL.h:55
Gyoto::Metric::KerrBL::spin_
double spin_
Angular momentum parameter.
Definition GyotoKerrBL.h:54
Gyoto::Metric::KerrBL::difftol
double difftol() const
Get difftol_.
Gyoto::Metric::KerrBL::zamoVelocity
virtual void zamoVelocity(double const pos[4], double vel[4]) const
Yield ZAMO velocity at a given position.
Gyoto::Metric::KerrBL::diff
virtual int diff(const double y[8], const double cst[5], double res[8]) const
Used in RK4 proxies.
Gyoto::Metric::KerrBL::clone
virtual KerrBL * clone() const
Virtual copy constructor.
Gyoto::Metric::KerrBL::rsink_
double rsink_
numerical horizon
Definition GyotoKerrBL.h:65
Gyoto::Metric::KerrBL::computeNBeta
virtual void computeNBeta(const double coord[4], double &NN, double beta[3]) const
Gyoto::Metric::KerrBL::myrk4
int myrk4(Worldline *line, Gyoto::state_t const &coordin, double h, Gyoto::state_t &res) const
RK4 integrator.
Gyoto::Metric::KerrBL::observerTetrad
virtual void observerTetrad(double const pos[4], double fourvel[4], double screen1[4], double screen2[4], double screen3[4]) const
Computes the orthonormal local tetrad of the observer.
Gyoto::Metric::KerrBL::CheckCons
int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const
Ensure conservation of the constants of motion.
Gyoto::Metric::KerrBL::spin
void spin(const double spin)
Set spin.
Gyoto::Metric::KerrBL::computeCst
virtual void computeCst(const double coord[8], double cst[5]) const
Gyoto::Metric::KerrBL::generic_integrator_
bool generic_integrator_
which integrator to use
Definition GyotoKerrBL.h:67
Gyoto::Metric::KerrBL::MakeMomentum
void MakeMomentum(const double coordin[8], const double cst[5], double coordout[8]) const
Transforms from Boyer-Lindquist coordinates [t,r,th,phi,tdot,rdot,thdot,phidot] to [t,...
Gyoto::Metric::KerrBL::difftol_
double difftol_
Numerical tuning parameter.
Definition GyotoKerrBL.h:64
Gyoto::Metric::KerrBL::a3_
double a3_
a2_*spin_
Definition GyotoKerrBL.h:56
Gyoto::SmartPointer
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Gyoto::Metric
Access to metrics.
Definition GyotoAstrobj.h:47
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44