Gyoto
GyotoNumericalMetricLorene.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2014-2018, 2020 Frederic Vincent, Thibaut Paumard
10  *
11  *
12  */
13 
14 #ifndef __GyotoNumericalMetricLoreneMetric_H_
15 #define __GyotoNumericalMetricLoreneMetric_H_
16 
17 #include <iostream>
18 #include <fstream>
19 
20 namespace Gyoto {
21  namespace Metric { class NumericalMetricLorene; }
22  class FactoryMessenger;
23 }
24 
25 // Forward declarations of Lorene classes
26 namespace Lorene {
27  class Scalar;
28  class Vector;
29  class Sym_tensor;
30  class Valeur;
31 }
32 
33 #include <GyotoMetric.h>
34 #include <GyotoWorldline.h>
35 #include <GyotoSmartPointer.h>
36 
37 #ifdef GYOTO_USE_XERCES
38 #include <GyotoRegister.h>
39 #endif
40 
49 {
51 
52  private:
53  char* filename_;
54  bool mapet_;
55  bool axisymCirc_;
61  double horizon_;
62  double initial_time_;
63  Lorene::Scalar** lapse_tab_;
64  Lorene::Vector** shift_tab_;
65  Lorene::Sym_tensor** gamcov_tab_;
66  Lorene::Sym_tensor** gamcon_tab_;
67  Lorene::Sym_tensor** kij_tab_;
68  double* times_;
69  int nb_times_;
70  Lorene::Valeur** nssurf_tab_;
71  Lorene::Vector** vsurf_tab_;
72  Lorene::Vector** accel_tab_;
73  Lorene::Scalar** lorentz_tab_;
74  Lorene::Valeur** hor_tab_;
75  double risco_;
76  double rico_;
77  double rmb_;
78 
79  void free();
80 
81  public:
85  NumericalMetricLorene(const NumericalMetricLorene&);
86  virtual NumericalMetricLorene* clone() const ;
87  virtual ~NumericalMetricLorene() ;
88 
92  virtual void setMetricSource();
93 
94  void directory(std::string const &dir) ;
95  std::string directory() const ;
96  double initialTime() const ;
97  void initialTime(double t0);
98  double horizon() const ;
99  void horizon(double t0);
100  double rico() const ;
101  void rico(double r0);
102  bool hasSurface() const;
103  void hasSurface(bool s);
104  bool hasAccelerationVector() const;
105  void hasAccelerationVector(bool aa);
106  bool bosonstarcircular() const;
107  void bosonstarcircular(bool);
108  bool specifyMarginalOrbits() const;
109  void specifyMarginalOrbits(bool s);
110  bool mapEt() const;
111  void mapEt(bool s);
112  bool axisymCirc() const;
113  void axisymCirc(bool s);
114 
115  Lorene::Vector** getShift_tab() const;
116  Lorene::Scalar** getLapse_tab() const;
117  Lorene::Sym_tensor** getGamcon_tab() const;
118  Lorene::Sym_tensor** getGamcov_tab() const;
119  double* getTimes() const;
120  int getNbtimes() const;
121  Lorene::Valeur** getNssurf_tab() const;
122  Lorene::Vector** getVsurf_tab() const;
123  Lorene::Vector** getAccel_tab() const;
124  Lorene::Scalar** getLorentz_tab() const;
125  Lorene::Valeur** getHor_tab() const;
126  double getRms() const;
127  double getRmb() const;
128  void setLapse_tab(Lorene::Scalar* lapse, int ii);
129  void setShift_tab(Lorene::Vector* shift, int ii);
130  void setGamcov_tab(Lorene::Sym_tensor* gamcov, int ii);
131  void setGamcon_tab(Lorene::Sym_tensor* gamcon, int ii);
132  void setKij_tab(Lorene::Sym_tensor* kij, int ii);
133  void setTimes(double time,int ii);
134 
135  virtual double getSpecificAngularMomentum(double rr) const;
136  virtual double getPotential(double const pos[4], double l_cst) const;
137 
141  virtual void computeNBeta(const double coord[4],double &NN,double beta[3]) const;//Compute lapse and shift at coord
142 
146  using Generic::gmunu;
147  double gmunu(const double x[4], int mu, int nu) const ;
148 
149  double gmunu(const double x[3], int indice_time, int mu, int nu) const ;
150 
151  virtual void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const ;
152 
153  void gmunu_up(double gup[4][4], const double x[4], int indice_time) const ;
154 
155  void gmunu_di(const double pos[4],
156  double gmunudr[4][4],
157  double gmunudth[4][4]) const ;
158 
159  void gmunu_di(const double pos[4],
160  int indice_time,
161  double gmunudr[4][4],
162  double gmunudth[4][4]) const ;
163 
164  virtual void jacobian(double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const ;
165 
169  double gmunu_up_dr(const double x[4], int mu, int nu) const ;
170 
171  double gmunu_up_dr(const double x[3], int indice_time, int mu, int nu) const ;
172 
173  double christoffel(const double coord[4], const int alpha, const int mu,
174  const int nu) const ;
175  double christoffel(const double coord[4],
176  const int alpha,
177  const int mu, const int nu,
178  const int indice_time) const;
179  virtual int christoffel(double dst[4][4][4],
180  const double coord[4]) const;
181  int christoffel(double dst[4][4][4],
182  const double coord[4],
183  const int indice_time) const;
184 
185 
193  double Interpol3rdOrder(double tt, int indice_time, double values[4]) const;
194 
198  double computeHorizon(const double* pos) const;
199  double computeHorizon(const double* pos, int indice) const;
200 
204  //using Generic::diff;
205  virtual int diff(state_t const &coord, state_t &res, double mass) const;
206  int diff(double tt, const double y[7], double res[7]) const ;
207  virtual int diff(const double y[7], double res[7], int indice_time) const ;
208  virtual int diff31(state_t const &x, state_t &dxdt, double mass) const ;
209 
229  void circularVelocity(double const coor[4], double vel[3],
230  double dir) const ;
231  void circularVelocity(double const coor[4], double vel[3],
232  double dir, int indice_time) const ;
233 
234 };
235 
236 #endif
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
char * filename_
Lorene .d data file(s) path.
Definition: GyotoNumericalMetricLorene.h:53
bool mapet_
Kind of Lorene mapping: &#39;false&#39; for Map_af, &#39;true&#39; for Map_et.
Definition: GyotoNumericalMetricLorene.h:54
virtual void gmunu_up(double ARGOUT_ARRAY2[4][4], const double IN_ARRAY1[4]) const
Metric contravariant coefficients.
Gyoto registers.
int nb_times_
Nb of time slices.
Definition: GyotoNumericalMetricLorene.h:69
double rmb_
Marginally bound orbit coordinate radius.
Definition: GyotoNumericalMetricLorene.h:77
virtual double getPotential(double const pos[4], double l_cst) const
void free()
deallocate memory
Base class for metrics.
Definition: GyotoMetric.h:158
Reference-counting pointers.
#define GYOTO_OBJECT_THREAD_SAFETY
Declare virtual bool isThreadSafe() const.
Definition: GyotoObject.h:99
Lorene::Valeur ** nssurf_tab_
Metric source (e.g. star) surface (if any)
Definition: GyotoNumericalMetricLorene.h:70
double christoffel(const double coord[4], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
Lorene::Scalar ** lorentz_tab_
Lorentz factor at surface (if any)
Definition: GyotoNumericalMetricLorene.h:73
bool bosonstarcircular_
1 to implement the circular velocity of a boson star
Definition: GyotoNumericalMetricLorene.h:56
Lorene::Valeur ** hor_tab_
Apparent horizon (if any)
Definition: GyotoNumericalMetricLorene.h:74
double Interpol3rdOrder(double tt, int indice_time, double values[4]) const
3rd order interpolation routine
Definition: GyotoNumericalMetricLorene.h:26
virtual NumericalMetricLorene * clone() const
Virtual copy constructor.
Lorene::Vector ** vsurf_tab_
4-velocity at surface (if any)
Definition: GyotoNumericalMetricLorene.h:71
virtual double gmunu(double const x[4], int mu, int nu) const
Metric coefficients.
Timelike or null geodesics.
Base class for metric description.
double computeHorizon(const double *pos) const
Computation of horizon value.
int specify_marginalorbits_
1 if marginal orbits are specified in file
Definition: GyotoNumericalMetricLorene.h:60
double risco_
ISCO coordinate radius.
Definition: GyotoNumericalMetricLorene.h:75
virtual int diff31(state_t const &x, state_t &dxdt, double mass) const
F function such as dx/dt=F(x,cst) for 3+1 case.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
double rico_
Innermost circular orbit coordinate radius.
Definition: GyotoNumericalMetricLorene.h:76
virtual int diff(state_t const &coord, state_t &res, double mass) const
bool axisymCirc_
True if sacetime is axisymmetric and circular.
Definition: GyotoNumericalMetricLorene.h:55
Pointers performing reference counting.
Definition: GyotoProperty.h:45
double gmunu_up_dr(const double x[4], int mu, int nu) const
r derivative of contravariant 4-metric
void circularVelocity(double const coor[4], double vel[3], double dir) const
Yield circular velocity at a given position.
virtual double getSpecificAngularMomentum(double rr) const
Lorene::Vector ** accel_tab_
4-acceleration at surface (if any)
Definition: GyotoNumericalMetricLorene.h:72
Definition: GyotoNumericalMetricLorene.h:47
virtual void jacobian(double ARGOUT_ARRAY3[4][4][4], const double IN_ARRAY1[4]) const
Derivatives of the metric covariant coefficients.
int has_acceleration_vector_
Definition: GyotoNumericalMetricLorene.h:58
int has_surface_
1 if the metric source has a surface
Definition: GyotoNumericalMetricLorene.h:57
double initial_time_
Time at which (first) metric is given.
Definition: GyotoNumericalMetricLorene.h:62
virtual void computeNBeta(const double coord[4], double &NN, double beta[3]) const
double * times_
Coordinate times at which metrics are given.
Definition: GyotoNumericalMetricLorene.h:68
double horizon_
Value of horizon (or any innermost limit)
Definition: GyotoNumericalMetricLorene.h:61