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:
75  KerrKS();
76  virtual KerrKS* clone () const;
77 
78  // Mutators / assignment
79  // ---------------------
80  public:
81  // default operator= is fine
82  void spin(const double spin);
83 
84  // Accessors
85  // ---------
86  public:
87  double spin() const ;
88  void horizonSecurity(double drhor);
89  double horizonSecurity() const;
90  void genericIntegrator(bool);
91  bool genericIntegrator() const ;
92 
93  double gmunu(const double * x,
94  int alpha, int beta) const ;
95 
96  void gmunu(double g[4][4], const double * pos) const;
97 
101  void gmunu_up(double gup[4][4], const double * pos) const;
102 
108  void jacobian(double dst[4][4][4], const double * x) const ;
109 
110  using Generic::christoffel;
111  int christoffel(double dst[4][4][4], const double * x) const ;
112  int christoffel(double dst[4][4][4], const double * pos, double gup[4][4], double jac[4][4][4]) const ;
113 
114  void nullifyCoord(double coord[8], double &tdot2) const;
115  void nullifyCoord(double coord[8]) const;
116  virtual void circularVelocity(double const pos[4], double vel [4],
117  double dir=1.) const ;
118 
119  public:
120 
121  void MakeCst(const double* coord, double* cst) const;
123  protected:
124 
132  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
133 
141  int myrk4(const double * coord, const double* cst , double h, double* res) const;
142 
148  int myrk4_adaptive(Gyoto::Worldline* line, const double * coord, double lastnorm, double normref, double* coord1, double h0, double& h1, double h1max) const;
149 
152  using Generic::diff;
153  int diff(const double* coord, const double* cst, double* res) const;
154  virtual int isStopCondition(double const * const coord) const;
155  void setParticleProperties(Worldline* line, const double* coord) const;
156 
157 };
158 
159 #endif
bool generic_integrator_
which integrator to use
Definition: GyotoKerrKS.h:69
double rsink_
numerical horizon
Definition: GyotoKerrKS.h:67
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:83
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:148
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 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:43
Pointers performing reference counting.
Definition: GyotoProperty.h:41
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.
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. ...