Gyoto
GyotoNumericalMetricLorene.h
Go to the documentation of this file.
1
8/*
9 * Copyright (c) 2014-2016, 2018 Frederic Vincent, Thibaut Paumard
10 *
11 *
12 */
13
14#ifndef __GyotoNumericalMetricLoreneMetric_H_
15#define __GyotoNumericalMetricLoreneMetric_H_
16
17#include <iostream>
18#include <fstream>
19
20namespace Gyoto {
21 namespace Metric { class NumericalMetricLorene; }
22 class FactoryMessenger;
23}
24
25// Forward declarations of Lorene classes
26namespace 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_;
60 double horizon_;
61 double r_refine_;
62 double h0_refine_;
63 int refine_;
65 Lorene::Scalar** lapse_tab_;
66 Lorene::Vector** shift_tab_;
67 Lorene::Sym_tensor** gamcov_tab_;
68 Lorene::Sym_tensor** gamcon_tab_;
69 Lorene::Sym_tensor** kij_tab_;
70 double* times_;
72 Lorene::Valeur** nssurf_tab_;
73 Lorene::Vector** vsurf_tab_;
74 Lorene::Vector** accel_tab_;
75 Lorene::Scalar** lorentz_tab_;
76 Lorene::Valeur** hor_tab_;
77 double risco_;
78 double rico_;
79 double rmb_;
80
81 void free();
82
83 public:
87 NumericalMetricLorene(const NumericalMetricLorene&);
88 virtual NumericalMetricLorene* clone() const ;
90
94 virtual void setMetricSource();
95
96 void directory(std::string const &dir) ;
97 std::string directory() const ;
98 double initialTime() const ;
99 void initialTime(double t0);
100 double horizon() const ;
101 void horizon(double t0);
102 double rico() const ;
103 void rico(double r0);
104 bool hasSurface() const;
105 void hasSurface(bool s);
106 bool hasAccelerationVector() const;
107 void hasAccelerationVector(bool aa);
108 bool bosonstarcircular() const;
109 void bosonstarcircular(bool);
110 bool specifyMarginalOrbits() const;
111 void specifyMarginalOrbits(bool s);
112 bool mapEt() const;
113 void mapEt(bool s);
114 std::vector<double> refineIntegStep() const;
115 void refineIntegStep(std::vector<double> const&);
116
117 Lorene::Vector** getShift_tab() const;
118 Lorene::Scalar** getLapse_tab() const;
119 Lorene::Sym_tensor** getGamcon_tab() const;
120 Lorene::Sym_tensor** getGamcov_tab() const;
121 double* getTimes() const;
122 int getNbtimes() const;
123 Lorene::Valeur** getNssurf_tab() const;
124 Lorene::Vector** getVsurf_tab() const;
125 Lorene::Vector** getAccel_tab() const;
126 Lorene::Scalar** getLorentz_tab() const;
127 Lorene::Valeur** getHor_tab() const;
128 double getRms() const;
129 double getRmb() const;
130 void setLapse_tab(Lorene::Scalar* lapse, int ii);
131 void setShift_tab(Lorene::Vector* shift, int ii);
132 void setGamcov_tab(Lorene::Sym_tensor* gamcov, int ii);
133 void setGamcon_tab(Lorene::Sym_tensor* gamcon, int ii);
134 void setKij_tab(Lorene::Sym_tensor* kij, int ii);
135 void setTimes(double time,int ii);
136
137 virtual double getSpecificAngularMomentum(double rr) const;
138 virtual double getPotential(double const pos[4], double l_cst) const;
139
143 virtual int myrk4(double tt, const double coord[7], double h, double res[7]) const;
144 virtual int myrk4(Worldline* line, state_t const &coord,
145 double h, state_t &res) const;
146
150 int myrk4_adaptive(Gyoto::Worldline* line, state_t const &coord, double lastnorm, double normref, state_t &coordnew, double h0, double& h1, double h1max) const;
151
152 int myrk4_adaptive(double tt, const double coor[7], double lastnorm, double normref, double coornew[7], const double cst[2], double& tdot_used, double h0, double& h1, double& hused, double h1max) const;
154
158 void reverseR(double tt, double coord[7]) const;
159
163 void computeNBeta(const double coord[4],double &NN,double beta[3]) const;//Compute lapse and shift at coord
164
168 using Generic::gmunu;
169 double gmunu(const double x[4], int mu, int nu) const ;
170
171 double gmunu(const double x[3], int indice_time, int mu, int nu) const ;
172
176 double gmunu_up_dr(const double x[4], int mu, int nu) const ;
177
178 double gmunu_up_dr(const double x[3], int indice_time, int mu, int nu) const ;
179
180 double christoffel(const double coord[4], const int alpha, const int mu,
181 const int nu) const ;
182 double christoffel(const double coord[4],
183 const int alpha,
184 const int mu, const int nu,
185 const int indice_time) const;
186 virtual int christoffel(double dst[4][4][4],
187 const double coord[4]) const;
188 int christoffel(double dst[4][4][4],
189 const double coord[4],
190 const int indice_time) const;
194 double christoffel3(const double coord[3], const int indice_time,
195 const int ii, const int jj, const int kk) const ;
196
197 void setParticleProperties(Worldline * line, const double coord[8]) const;
198
206 double Interpol3rdOrder(double tt, int indice_time, double values[4]) const;
207
211 double computeHorizon(const double* pos) const;
212 double computeHorizon(const double* pos, int indice) const;
213
217 //using Generic::diff;
218 virtual int diff(state_t const &coord, state_t &res) const;
219 int diff(double tt, const double y[7], double res[7]) const ;
220 virtual int diff(const double y[7], double res[7], int indice_time) const ;
221
241 void circularVelocity(double const coor[4], double vel[3],
242 double dir) const ;
243 void circularVelocity(double const coor[4], double vel[3],
244 double dir, int indice_time) const ;
245
246};
247
248#endif
Base class for metric description.
#define GYOTO_OBJECT_THREAD_SAFETY
Declare virtual bool isThreadSafe() const.
Definition: GyotoObject.h:99
#define GYOTO_OBJECT
Declare class::properties and class::getProperties()
Definition: GyotoObject.h:84
Gyoto registers.
Reference-counting pointers.
Timelike or null geodesics.
Base class for metrics.
Definition: GyotoMetric.h:162
virtual double gmunu(double const x[4], int mu, int nu) const
Metric coefficients.
Definition: GyotoNumericalMetricLorene.h:49
double computeHorizon(const double *pos) const
Computation of horizon value.
double Interpol3rdOrder(double tt, int indice_time, double values[4]) const
3rd order interpolation routine
double risco_
ISCO coordinate radius.
Definition: GyotoNumericalMetricLorene.h:77
double h0_refine_
Imposed integration step for refined integration.
Definition: GyotoNumericalMetricLorene.h:62
int has_surface_
1 if the metric source has a surface
Definition: GyotoNumericalMetricLorene.h:56
bool mapet_
Kind of Lorene mapping: 'false' for Map_af, 'true' for Map_et.
Definition: GyotoNumericalMetricLorene.h:54
void free()
deallocate memory
virtual int myrk4(double tt, const double coord[7], double h, double res[7]) const
double christoffel3(const double coord[3], const int indice_time, const int ii, const int jj, const int kk) const
3-Christoffels
Lorene::Valeur ** hor_tab_
Apparent horizon (if any)
Definition: GyotoNumericalMetricLorene.h:76
Lorene::Vector ** vsurf_tab_
4-velocity at surface (if any)
Definition: GyotoNumericalMetricLorene.h:73
double christoffel(const double coord[4], const int alpha, const int mu, const int nu) const
Chistoffel symbol.
void reverseR(double tt, double coord[7]) const
virtual int diff(state_t const &coord, state_t &res) const
double gmunu_up_dr(const double x[4], int mu, int nu) const
r derivative of contravariant 4-metric
double initial_time_
Time at which (first) metric is given.
Definition: GyotoNumericalMetricLorene.h:64
Lorene::Valeur ** nssurf_tab_
Metric source (e.g. star) surface (if any)
Definition: GyotoNumericalMetricLorene.h:72
void setParticleProperties(Worldline *line, const double coord[8]) const
Set Metric-specific constants of motion. Used e.g. in KerrBL.
char * filename_
Lorene .d data file(s) path.
Definition: GyotoNumericalMetricLorene.h:53
int has_acceleration_vector_
Definition: GyotoNumericalMetricLorene.h:57
double rmb_
Marginally bound orbit coordinate radius.
Definition: GyotoNumericalMetricLorene.h:79
double * times_
Coordinate times at which metrics are given.
Definition: GyotoNumericalMetricLorene.h:70
int nb_times_
Nb of time slices.
Definition: GyotoNumericalMetricLorene.h:71
Lorene::Vector ** accel_tab_
4-acceleration at surface (if any)
Definition: GyotoNumericalMetricLorene.h:74
virtual double getSpecificAngularMomentum(double rr) const
int myrk4_adaptive(Gyoto::Worldline *line, state_t const &coord, double lastnorm, double normref, state_t &coordnew, double h0, double &h1, double h1max) const
double horizon_
Value of horizon (or any innermost limit)
Definition: GyotoNumericalMetricLorene.h:60
int specify_marginalorbits_
1 if marginal orbits are specified in file
Definition: GyotoNumericalMetricLorene.h:59
bool bosonstarcircular_
1 to implement the circular velocity of a boson star
Definition: GyotoNumericalMetricLorene.h:55
double rico_
Innermost circular orbit coordinate radius.
Definition: GyotoNumericalMetricLorene.h:78
double gmunu(const double x[4], int mu, int nu) const
Metric coefficients.
void computeNBeta(const double coord[4], double &NN, double beta[3]) const
double r_refine_
Refine integration below this r.
Definition: GyotoNumericalMetricLorene.h:61
Lorene::Scalar ** lorentz_tab_
Lorentz factor at surface (if any)
Definition: GyotoNumericalMetricLorene.h:75
virtual NumericalMetricLorene * clone() const
Virtual copy constructor.
int refine_
1 if refined integration needed
Definition: GyotoNumericalMetricLorene.h:63
virtual double getPotential(double const pos[4], double l_cst) const
void circularVelocity(double const coor[4], double vel[3], double dir) const
Yield circular velocity at a given position.
Class for 3+1 numerical metrics computed by LORENE. This class can handle (so far) any kind of LORENE...
Pointers performing reference counting.
Definition: GyotoSmartPointer.h:135
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43