Gyoto
GyotoKerrKS.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 __GyotoKerrKS_H_
27 #define __GyotoKerrKS_H_
28 
29 namespace Gyoto {
30  namespace Metric { class KerrKS; }
31 }
32 
33 #include <GyotoMetric.h>
34 #include <GyotoWorldline.h>
35 #ifdef GYOTO_USE_XERCES
36 #include <GyotoRegister.h>
37 #endif
38 
44  friend class Gyoto::SmartPointer<Gyoto::Metric::KerrKS>;
45 
46  // Data :
47  // -----
48 
49  protected:
50  double spin_ ;
51 
52 
53  // Constructors - Destructor
54  // -------------------------
55  public:
56  KerrKS();
57  KerrKS(double spin, double mass) ;
58 
59  // Default is fine
60  // KerrKS(const KerrKS& ) ;
61  virtual KerrKS* clone () const;
62 
63  virtual ~KerrKS() ;
64 
65 
66  // Mutators / assignment
67  // ---------------------
68  public:
69  // default operator= is fine
70  void setSpin(const double spin);
71 
72  // Accessors
73  // ---------
74  public:
75  double getSpin() const ;
76 
77  double gmunu(const double * x,
78  int alpha, int beta) const ;
79 
80 
81  /*
82  it's necessary to define christoffel even if it's not used. KerrKS derives from Metric where christoffel is virtual pure. If the function is not defined in KerrKS, it's considered virtual pure here too. Then KerrKS is considered an abstract class, and it's forbidden to declare any object of type KerrKS....
83  See Delannoy C++ p.317-318
84  NB : and it's not necessary to declare "virtual" a function in a derived class if it has been declared "virtual" in the basis class.
85  */
86  double christoffel(const double[8],
87  const int, const int, const int) const;
88 
89 
90  void nullifyCoord(double coord[8], double &tdot2) const;
91  void nullifyCoord(double coord[8]) const;
92  virtual void circularVelocity(double const pos[4], double vel [4],
93  double dir=1.) const ;
94 
95  virtual void setParameter(std::string, std::string, std::string);
96 #ifdef GYOTO_USE_XERCES
97  virtual void fillElement(FactoryMessenger *fmp);
98 #endif
99 
100  public:
101 
102  void MakeCst(const double* coord, double* cst) const;
104  protected:
105 
113  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
114 
122  int myrk4(const double * coord, const double* cst , double h, double* res) const;
123 
129  int myrk4_adaptive(Gyoto::Worldline* line, const double * coord, double lastnorm, double normref, double* coord1, double h0, double& h1) const;
130 
133  int diff(const double* coord, const double* cst, double* res) const;
134  int diff(const double y[8], double res[8]) const ;
135  virtual int isStopCondition(double const * const coord) const;
136  void setParticleProperties(Worldline* line, const double* coord) const;
137 
138 };
139 
140 #endif