Gyoto
GyotoLoreneMetric.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2011 Frederic Vincent
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 __GyotoLoreneMetric_H_
27 #define __GyotoLoreneMetric_H_
28 
29 namespace Gyoto {
30  class LoreneMetric;
31 }
32 
33 #include <GyotoMetric.h>
34 
39 class Gyoto::LoreneMetric : public Metric {
40  friend class Gyoto::SmartPointer<Gyoto::LoreneMetric>;
41 
42  // Data :
43  // -----
44  protected:
45 
46  // Constructors - Destructor
47  // -------------------------
48  public:
49  LoreneMetric();
50 
51  // Default is _not_ fine
52  LoreneMetric(const LoreneMetric& ) ;
53 
54 
55  virtual ~LoreneMetric() ;
56 
57 
58  // Mutators / assignment
59  // ---------------------
60  public:
61 
62  // Accessors
63  // ---------
64  public:
65 
69  virtual double gmunu(const double * const x,
70  const int alpha, const int beta,
71  const int sys) const ;
72 
73 
74  /*
75  it's necessary to define christoffel even if it's not used. LoreneMetric derives from Metric where christoffel is virtual pure. If the function is not defined in LoreneMetric, it's considered virtual pure here too. Then LoreneMetric is considered an abstract class, and it's forbidden to declare any object of type LoreneMetric....
76  See Delannoy C++ p.317-318
77  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.
78  */
79  double christoffel(const double[8],
80  const int, const int, const int,
81  const int) const;
82 
83  virtual double ScalarProd(const double* pos,
84  const double* u1, const double* u2,
85  const int sys) const ;
86 
87  friend std::ostream& operator<<(std::ostream& , const LoreneMetric& ) ;
88  std::ostream& print(std::ostream&) const ;
89 
90  public:
91 
92  protected:
93  /* RK4 : y=[r,theta,phi,t,pr,ptheta], cst=[a,E,L,Q],dy/dtau=F(y,cst), h=proper time step. For Kerr geodesic computation.
94  */
95  int myrk4_BL(const double y[6], const double* cst, double h, double* res) const;
96  int myrk4_BL_adaptive(const double coor[8], const double* cst, const double MassPart, double lastnorm, double normref, int noprogress, double* coor1, double h0, double& h1, int onestep) const;//noprogress is 1 if integration makes no progress
97 
100  int diff_BL(const double* y, const double* cst, double* res) const ;
101 
102 };
103 
104 
105 #endif