Gyoto
GyotoKerrBL.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011 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 
49  friend class Gyoto::SmartPointer<Gyoto::Metric::KerrBL>;
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:
72  KerrBL();
73  virtual KerrBL * clone () const ;
74 
75  // Accessors
76  // ---------
77  public:
78  void spin(const double spin);
79  double spin() const ;
80 
81  double difftol() const;
82  void difftol(double t);
83 
84  void horizonSecurity(double drhor);
85  double horizonSecurity() const;
86  void genericIntegrator(bool);
87  bool genericIntegrator() const ;
88 
89  double getRms() const;
90 
91  double getRmb() const;
92 
93  void gmunu(double g[4][4], const double * pos) const ;
94  double gmunu(const double * const x, int mu, int nu) const ;
95 
99  void gmunu_up(double gup[4][4], const double * pos) const ;
100  double gmunu_up(const double * const x, int mu, int nu) const ;
101 
102  using Generic::christoffel;
103  int christoffel(double dst[4][4][4], const double * pos) const ;
104 
105  double ScalarProd(const double pos[4],
106  const double u1[4], const double u2[4]) const ;
107 
108  void nullifyCoord(double coord[8], double & tdot2) const;
109  void nullifyCoord(double coord[8]) const;
110 
111  // friend std::ostream& operator<<(std::ostream& , const KerrBL& ) ;
112  // std::ostream& print(std::ostream&) const ;
113  virtual void circularVelocity(double const pos[4], double vel [4],
114  double dir=1.) const ;
115 
116  public:
117  virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const ;
119 
121  void MakeMomentum(const double coordin[8], const double cst[5], double coordout[8]) const;
123 
124  virtual void setParameter(std::string, std::string, std::string);
125 #ifdef GYOTO_USE_XERCES
126  virtual void fillElement(FactoryMessenger *fmp);
127 #endif
128 
129  protected:
130 
131  // outside the API
132  /* RK4 : y=[r,theta,phi,t,pr,ptheta],
133  cst=[a,E,L,Q,1/Q],dy/dtau=F(y,cst), h=proper time step.
134  For KerrBL geodesic computation.
135  */
136  int myrk4(Worldline * line, const double coordin[8], double h, double res[8]) const; //external-use RK4
137 
138  private:
139  int myrk4(const double coor[8], const double cst[5], double h, double res[8]) const;
140  int myrk4_adaptive(Gyoto::Worldline* line, const double coor[8], double lastnorm, double normref, double coor1[8], double h0, double& h1, double h1max) const;
141 
146  int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const;
147 
153  void Normalize4v(double coord[8], const double part_mass) const;
154 
157  using Metric::Generic::diff;
161  virtual int diff(const double y[8], const double cst[5],
162  double res[8]) const ;
165  virtual void computeCst(const double coord[8], double cst[5]) const;
166  public:
167  void setParticleProperties(Worldline* line, const double* coord) const;
168  virtual int isStopCondition(double const * const coord) const;
169 
170 };
171 
172 #endif
173 
bool generic_integrator_
which integrator to use
Definition: GyotoKerrBL.h:67
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
void gmunu(double g[4][4], const double *pos) const
Metric coefficients.
void nullifyCoord(double coord[8], double &tdot2) const
Set tdot (coord[4]) such that coord is light-like and return other possible tdot. ...
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 int isStopCondition(double const *const coord) const
Check whether integration should stop.
double getRmb() const
Returns prograde marginally bound orbit.
Base class for metrics.
Definition: GyotoMetric.h:147
double spin_
Angular momentum parameter.
Definition: GyotoKerrBL.h:54
double a2_
spin_*spin_
Definition: GyotoKerrBL.h:55
double difftol_
Numerical tuning parameter.
Definition: GyotoKerrBL.h:64
virtual void fillElement(FactoryMessenger *fmp)
called from Factory
virtual double christoffel(const double coord[8], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
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.
virtual void setParameter(std::string, std::string, std::string)
Set parameter by name.
double difftol() const
Get difftol_.
void setParticleProperties(Worldline *line, const double *coord) const
Set Metric-specific constants of motion. Used e.g. in KerrBL.
int myrk4_adaptive(Gyoto::Worldline *line, const double coor[8], double lastnorm, double normref, double coor1[8], double h0, double &h1, double h1max) const
Internal-use adaptive RK4 proxy.
double rsink_
numerical horizon
Definition: GyotoKerrBL.h:65
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:42
int myrk4(Worldline *line, const double coordin[8], double h, double res[8]) const
RK4 integrator.
virtual void circularVelocity(double const pos[4], double vel[4], double dir=1.) const
Yield circular velocity at a given position.
virtual int diff(const double y[8], const double cst[5], double res[8]) const
Used in RK4 proxies.
virtual void MakeCoord(const double coordin[8], const double cst[5], double coordout[8]) const
Inverse function of MakeMomentumAndCst.
double getRms() const
Returns prograde marginally stable orbit.
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...
int CheckCons(const double coor_init[8], const double cst[5], double coor_fin[8]) const
Ensure conservation of the constants of motion.
virtual void computeCst(const double coord[8], double cst[5]) const
virtual KerrBL * clone() const
Virtual copy constructor.
double ScalarProd(const double pos[4], const double u1[4], const double u2[4]) const
Scalar product.
void gmunu_up(double gup[4][4], const double *pos) const
gμ,ν
void Normalize4v(double coord[8], const double part_mass) const
Normalize 4-velocity.
double spin() const
Returns spin.
virtual int diff(const double y[8], double res[8]) const
F function such as dy/dtau=F(y,cst)