Gyoto
GyotoKerrKS.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011, 2014 Frederic Vincent, Thibaut Paumard
10 
11  This file is part of Gyoto.
12 
13  Gyoto is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  Gyoto is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 #ifndef __GyotoKerrKS_H_
28 #define __GyotoKerrKS_H_
29 
30 namespace Gyoto {
31  namespace Metric { class KerrKS; }
32 }
33 
34 #include <GyotoMetric.h>
35 #include <GyotoWorldline.h>
36 #ifdef GYOTO_USE_XERCES
37 #include <GyotoRegister.h>
38 #endif
39 
40 // This Metric is work in progress
41 #include <GyotoWIP.h>
42 
56 : public Metric::Generic,
57  public WIP
58 {
59  friend class Gyoto::SmartPointer<Gyoto::Metric::KerrKS>;
60 
61  // Data :
62  // -----
63 
64  protected:
65  double spin_ ;
66  double a2_;
67  double rsink_;
68  double drhor_;
70 
71  // Constructors - Destructor
72  // -------------------------
73  public:
74  KerrKS();
75  virtual KerrKS* clone () const;
76 
77  // Mutators / assignment
78  // ---------------------
79  public:
80  // default operator= is fine
81  void spin(const double spin);
82 
83  // Accessors
84  // ---------
85  public:
86  double spin() const ;
87  void horizonSecurity(double drhor);
88  double horizonSecurity() const;
89  void genericIntegrator(bool);
90  bool genericIntegrator() const ;
91 
92  double gmunu(const double * x,
93  int alpha, int beta) const ;
94 
95  void gmunu(double g[4][4], const double * pos) const;
96 
100  void gmunu_up(double gup[4][4], const double * pos) const;
101 
107  void jacobian(double dst[4][4][4], const double * x) const ;
108 
109  using Generic::christoffel;
110  int christoffel(double dst[4][4][4], const double * x) const ;
111  int christoffel(double dst[4][4][4], const double * pos, double gup[4][4], double jac[4][4][4]) const ;
112 
113  void nullifyCoord(double coord[8], double &tdot2) const;
114  void nullifyCoord(double coord[8]) const;
115  virtual void circularVelocity(double const pos[4], double vel [4],
116  double dir=1.) const ;
117 
118  virtual void setParameter(std::string, std::string, std::string);
119 #ifdef GYOTO_USE_XERCES
120  virtual void fillElement(FactoryMessenger *fmp);
121 #endif
122 
123  public:
124 
125  void MakeCst(const double* coord, double* cst) const;
127  protected:
128 
136  int myrk4(Worldline * line, const double coord[8], double h, double res[8]) const;//NB non adaptive integration doesn't work for KS ; this function is not implemented
137 
145  int myrk4(const double * coord, const double* cst , double h, double* res) const;
146 
152  int myrk4_adaptive(Gyoto::Worldline* line, const double * coord, double lastnorm, double normref, double* coord1, double h0, double& h1, double h1max) const;
153 
156  using Generic::diff;
157  int diff(const double* coord, const double* cst, double* res) const;
158  virtual int isStopCondition(double const * const coord) const;
159  void setParticleProperties(Worldline* line, const double* coord) const;
160 
161 };
162 
163 #endif
bool generic_integrator_
which integrator to use
Definition: GyotoKerrKS.h:69
double rsink_
numerical horizon
Definition: GyotoKerrKS.h:67
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:51
Base class for work in progress.
Definition: GyotoWIP.h:46
Gyoto registers.
Metric around a Kerr black-hole in Kerr-Schild coordinates Warning: this metric is seldom used and ma...
Definition: GyotoKerrKS.h:55
void gmunu_up(double gup[4][4], const double *pos) const
The inverse matrix of gmunu.
Base class for metrics.
Definition: GyotoMetric.h:147
int myrk4(Worldline *line, const double coord[8], double h, double res[8]) const
RK4 integrator.
void setParticleProperties(Worldline *line, const double *coord) const
Set Metric-specific constants of motion. Used e.g. in KerrBL.
void jacobian(double dst[4][4][4], const double *x) const
The derivatives of gmunu.
virtual int isStopCondition(double const *const coord) const
Check whether integration should stop.
Work in progress class.
double drhor_
horizon security
Definition: GyotoKerrKS.h:68
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 spin_
Angular momentum parameter.
Definition: GyotoKerrKS.h:65
double gmunu(const double *x, int alpha, int beta) const
Metric coefficients.
Timelike or null geodesics.
Base class for metric description.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:42
int myrk4_adaptive(Gyoto::Worldline *line, const double *coord, double lastnorm, double normref, double *coord1, double h0, double &h1, double h1max) const
?
double spin() const
Returns spin.
virtual void setParameter(std::string, std::string, std::string)
Set parameter by name.
void MakeCst(const double *coord, double *cst) const
In Kerr-Schild coordinates [T,x,y,z,Tdot,xdot,ydot,zdot], computes the four constants of the movement...
virtual KerrKS * clone() const
Copy constructor.
virtual void circularVelocity(double const pos[4], double vel[4], double dir=1.) const
Yield circular velocity at a given position.
double a2_
spin_*spin_
Definition: GyotoKerrKS.h:66
virtual int diff(const double y[8], double res[8]) const
F function such as dy/dtau=F(y,cst)
void nullifyCoord(double coord[8], double &tdot2) const
Set tdot (coord[4]) such that coord is light-like and return other possible tdot. ...