Gyoto
GyotoRotStar3_1.h
Go to the documentation of this file.
1 
8 /*
9  Copyright 2011 Frederic Vincent
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 
28 #ifndef __GyotoRotStar3_1_H_
29 #define __GyotoRotStar3_1_H_
30 
31 #include <iostream>
32 #include <fstream>
33 
34 class Star_rot;
35 
36 namespace Gyoto {
37  namespace Metric { class RotStar3_1; }
38 }
39 
40 #include <GyotoMetric.h>
41 #include <GyotoWorldline.h>
42 #include <GyotoSmartPointer.h>
43 
44 #ifdef GYOTO_USE_XERCES
45 #include <GyotoRegister.h>
46 #endif
47 
53  friend class Gyoto::SmartPointer<Gyoto::Metric::RotStar3_1>;
54 
55  private:
56  char* filename_;
57  Star_rot * star_;
58  int integ_kind_;//1 if RotStar3_1::myrk4, 0 if Metric::myrk4
59 
60  public:
61 
62  RotStar3_1(const char * lorene_res, const int integ_kind);
63  virtual ~RotStar3_1() ;
64  virtual RotStar3_1* clone() const ;
66 
67  char const * const getFileName() const;
68 
69  int getIntegKind() const ;
70 
71  using Metric::Generic::myrk4;
72  int myrk4(const double coord[6], double h, double res[6]) const;
73 
74  //NB: there is no myrk4(const double coord[8], double h, double res[8]), which makes no pb because this same function is defined in class Metric where it is virtual but not pure. This myrk4(const double coord[6], double h, double res[6]) is a purely internal function, only called by RotStar3_1::myrk4_adaptive(const double coor[6],...)
75 
76  int myrk4_adaptive(Gyoto::Worldline* line, const double coord[8], double lastnorm, double normref, double coordnew[8], double h0, double& h1) const;
77 
78  int myrk4_adaptive(const double coor[6], double lastnorm, double normref, double coornew[6], double cst[2], double& tdot_used, double h0, double& h1, double& hused) const;
81  int diff(const double coord[8], double res[8]) const ;
82  int diff(const double y[6], double res[6], int) const ;
83  // NB: last int is just to distinguish with the other diff ; it doesn't seem to be possible to redefine diff with [8]->[6]
84 
85  void Normalize4v(const double coordin[8], double coordout[8], const double cst[2], double& tdot_used) const;
86 
87  double gmunu(const double * x, int mu, int nu) const ;
88 
89  double christoffel(const double coord[8], const int alpha, const int mu,
90  const int nu) const ;
91 
92  double ScalarProd(const double pos[4],
93  const double u1[4], const double u2[4]) const ;
94 
95 #ifdef GYOTO_USE_XERCES
96  virtual void fillElement(FactoryMessenger *fmp);
98  static void Init();
99 #endif
100 
101 };
102 
103 #endif