Gyoto
GyotoKerrBL.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011, 2018 Frederic Vincent, Thibaut Paumard
9 
10  This file is part of Gyoto.
11 
12  Gyoto is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  Gyoto is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #ifndef __GyotoKerrBL_H_
27 #define __GyotoKerrBL_H_
28 
29 namespace Gyoto {
30  namespace Metric { class KerrBL; }
31 }
32 
33 #include <GyotoMetric.h>
34 #include <GyotoWorldline.h>
35 
36 #ifdef GYOTO_USE_XERCES
37 #include <GyotoRegister.h>
38 #endif
39 
40 
42 #define GYOTO_KERRBL_DEFAULT_DIFFTOL 1e-2
43 
50 
51  // Data :
52  // -----
53  protected:
54  double spin_ ;
55  double a2_ ;
56  double a3_ ;
57  double a4_ ;
58 
60 
64  double difftol_;
65  double rsink_;
66  double drhor_;
68 
69  // Constructors - Destructor
70  // -------------------------
71  public:
73  KerrBL();
74  virtual KerrBL * clone () const ;
75 
76  // Accessors
77  // ---------
78  public:
79  void spin(const double spin);
80  double spin() const ;
81 
82  double difftol() const;
83  void difftol(double t);
84 
85  void horizonSecurity(double drhor);
86  double horizonSecurity() const;
87  void genericIntegrator(bool);
88  bool genericIntegrator() const ;
89 
90  virtual double getRms() const;
91 
92  virtual double getRmb() const;
93 
94  virtual double getSpecificAngularMomentum(double rr) const;
95 
96  virtual double getPotential(double const pos[4], double l_cst) const;
97 
98  void gmunu(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const ;
99  double gmunu(double const x[4], int mu, int nu) const ;
100 
104  void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const ;
105  double gmunu_up(double const x[4], int mu, int nu) const ;
106 
107  using Generic::christoffel;
108  int christoffel(double dst[4][4][4], const double pos[4]) const ;
109 
110  double ScalarProd(const double pos[4],
111  const double u1[4], const double u2[4]) const ;
112 
113  void nullifyCoord(double coord[8], double & tdot2) const;
114  void nullifyCoord(double coord[8]) const;
115 
116  // friend std::ostream& operator<<(std::ostream& , const KerrBL& ) ;
117  // std::ostream& print(std::ostream&) const ;
118  virtual void circularVelocity(double const pos[4], double vel [4],
119  double dir=1.) const ;
120 
121  virtual void zamoVelocity(double const pos[4], double vel[4]) const ;
122 
123  public:
124  virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ;
126 
128  void MakeMomentum(const double coordin[8], const double cst[5], double coordout[8]) const;
130 
131  protected:
132 
133  // outside the API
134  /* RK4 : y=[r,theta,phi,t,pr,ptheta],
135  cst=[a,E,L,Q,1/Q],dy/dtau=F(y,cst), h=proper time step.
136  For KerrBL geodesic computation.
137  */
138  int myrk4(Worldline * line, Gyoto::state_t const &coordin, double h, Gyoto::state_t &res) const; //external-use RK4
139 
140  public:
141  int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;
142  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;
143 
148  private:
149  int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const;
150 
156  void Normalize4v(double coord[8], const double part_mass) const;
157 
158  public:
161  using Metric::Generic::diff;
162  private:
166  virtual int diff(const double y[8], const double cst[5],
167  double res[8]) const ;
168  virtual int diff31(state_t const &x, state_t &dxdt, double mass) const ;
172  virtual void computeNBeta(const double coord[4],double &NN,double beta[3]) const;//Compute lapse and shift at coord
175  virtual void computeCst(const double coord[8], double cst[5]) const;
176  public:
177  void setParticleProperties(Worldline* line, const double* coord) const;
178  virtual int isStopCondition(double const * const coord) const;
179 
180  virtual void observerTetrad(double const pos[4], double fourvel[4],
181  double screen1[4], double screen2[4],
182  double screen3[4]) const ;
183 
184 };
185 
186 #endif
187 
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.
bool generic_integrator_
which integrator to use
Definition: GyotoKerrBL.h:67
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
virtual double getRms() const
virtual double getSpecificAngularMomentum(double rr) const
Gyoto registers.
double drhor_
horizon security
Definition: GyotoKerrBL.h:66
Metric around a Kerr black-hole in Boyer-Lindquist coordinates.
Definition: GyotoKerrBL.h:48
virtual double getPotential(double const pos[4], double l_cst) const
virtual int diff(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst)
Base class for metrics.
Definition: GyotoMetric.h:158
int myrk4(Worldline *line, Gyoto::state_t const &coordin, double h, Gyoto::state_t &res) const
RK4 integrator.
virtual void computeCst(const double coord[8], double cst[5]) const
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.
double spin() const
Returns spin.
virtual void computeNBeta(const double coord[4], double &NN, double beta[3]) const
double spin_
Angular momentum parameter.
Definition: GyotoKerrBL.h:54
double a2_
spin_*spin_
Definition: GyotoKerrBL.h:55
virtual double getRmb() const
virtual int diff(const double y[8], const double cst[5], double res[8]) const
Used in RK4 proxies.
double difftol_
Numerical tuning parameter.
Definition: GyotoKerrBL.h:64
virtual double christoffel(const double coord[4], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
virtual void circularVelocity(double const pos[4], double vel [4], double dir=1.) const
Yield circular velocity at a given position.
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...
double a3_
a2_*spin_
Definition: GyotoKerrBL.h:56
Timelike or null geodesics.
double a4_
a2_*a2_
Definition: GyotoKerrBL.h:57
Base class for metric description.
void nullifyCoord(double coord[8], double &tdot2) const
Set tdot (coord[4]) such that coord is light-like and return other possible tdot. ...
double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const
Scalar product.
double rsink_
numerical horizon
Definition: GyotoKerrBL.h:65
int christoffel(double dst[4][4][4], const double pos[4]) const
Chistoffel symbol.
int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const
Ensure conservation of the constants of motion.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
void Normalize4v(double coord[8], const double part_mass) const
Normalize 4-velocity.
virtual void zamoVelocity(double const pos[4], double vel[4]) const
Yield ZAMO velocity at a given position.
Pointers performing reference counting.
Definition: GyotoProperty.h:45
double difftol() const
Get difftol_.
void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const
gμ,ν
virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const
Inverse function of MakeMomentumAndCst.
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.
virtual KerrBL * clone() const
Virtual copy constructor.