Gyoto
GyotoWorldline.h
Go to the documentation of this file.
1 
6 /*
7  Copyright 2011-2018 Frederic Vincent, Thibaut Paumard
8 
9  This file is part of Gyoto.
10 
11  Gyoto is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  Gyoto is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
25 #ifndef __GyotoWorldline_H_
26 #define __GyotoWorldline_H_
27 
28 #include <iostream>
29 #include <fstream>
30 #include <string>
31 #include <vector>
32 
33 #include <GyotoDefs.h>
34 
35 #ifdef GYOTO_HAVE_BOOST_INTEGRATORS
36 # include <functional>
37 # include <array>
38 # include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
39 #endif
40 
41 namespace Gyoto {
42  class Worldline;
43  class FactoryMessenger;
44 }
45 
46 #include <GyotoSmartPointer.h>
47 #include <GyotoMetric.h>
48 #include <GyotoScreen.h>
49 #include <GyotoHooks.h>
50 
52 
58 #define GYOTO_WORLDLINE_PROPERTIES(c) \
59  Gyoto::Property("Gyoto::Worldline", "Time-like or null geodesic."), \
60  GYOTO_PROPERTY_BOOL(c, Integ31, Integ4D, _integ31, \
61  "Whether to integrate the 3+1 or 4D equation of geodesics.") \
62  GYOTO_PROPERTY_BOOL(c, HighOrderImages, PrimaryOnly, _secondary, \
63  "Whether to stop Photon integration at 180° deflection.") \
64  GYOTO_PROPERTY_BOOL(c, ParallelTransport, NoParallelTransport, _parallelTransport, \
65  "Whether to perform parallel transport of a local triad (used for polarization).") \
66  GYOTO_PROPERTY_DOUBLE(c, MaxCrossEqplane, _maxCrossEqplane, \
67  "Maximum number of crossings of the equatorial plane allowed for this worldline") \
68  GYOTO_PROPERTY_DOUBLE(c, RelTol, _relTol, \
69  "Relative tolerance for the adaptive step integrators.") \
70  GYOTO_PROPERTY_DOUBLE(c, AbsTol, _absTol, \
71  "Absolute tolerance for the adaptive step integrators.") \
72  GYOTO_PROPERTY_DOUBLE(c, DeltaMaxOverR, _deltaMaxOverR, \
73  "Maximum value of step/distance from center of mass.") \
74  GYOTO_PROPERTY_DOUBLE(c, DeltaMax, _deltaMax, "Maximum step (geometrical units).") \
75  GYOTO_PROPERTY_DOUBLE(c, DeltaMin, _deltaMin, "Minimum step (geometrical units).") \
76  GYOTO_PROPERTY_STRING(c, Integrator, _integrator, \
77  "Name of integrator (\"runge_kutta_fehlberg78\").") \
78  GYOTO_PROPERTY_SIZE_T(c, MaxIter, _maxiter, \
79  "Maximum number of integration steps.") \
80  GYOTO_PROPERTY_BOOL(c, Adaptive, NonAdaptive, _adaptive, \
81  "Whether to use an adaptive step.") \
82  GYOTO_PROPERTY_DOUBLE_UNIT(c, MinimumTime, _tMin, \
83  "Do not integrate earlier than this date (geometrical_time).") \
84  GYOTO_PROPERTY_DOUBLE_UNIT(c, Delta, _delta, \
85  "Initial integration step (geometrical units).") \
86  GYOTO_PROPERTY_VECTOR_DOUBLE(c, InitCoord, _initCoord, \
87  "Initial 8-coordinate.") \
88  GYOTO_PROPERTY_METRIC(c, Metric, _metric, \
89  "The geometry of space-time at this end of the Universe.")
90 
92 
106 #define GYOTO_WORLDLINE_ACCESSORS(c) \
107  void c::_integ31(bool s) {integ31(s);} \
108  bool c::_integ31() const {return integ31();} \
109  void c::_secondary(bool s) {secondary(s);} \
110  bool c::_secondary() const {return secondary();} \
111  void c::_parallelTransport(bool s) {parallelTransport(s);} \
112  bool c::_parallelTransport() const {return parallelTransport();} \
113  void c::_adaptive(bool s) {adaptive(s);} \
114  bool c::_adaptive() const {return adaptive();} \
115  void c::_maxCrossEqplane(double max){maxCrossEqplane(max);} \
116  double c::_maxCrossEqplane()const{return maxCrossEqplane();} \
117  void c::_relTol(double f){relTol(f);} \
118  double c::_relTol()const{return relTol();} \
119  void c::_absTol(double f){absTol(f);} \
120  double c::_absTol()const{return absTol();} \
121  void c::_deltaMin(double f){deltaMin(f);} \
122  double c::_deltaMin()const{return deltaMin();} \
123  void c::_deltaMax(double f){deltaMax(f);} \
124  double c::_deltaMax()const{return deltaMax();} \
125  void c::_deltaMaxOverR(double f){deltaMaxOverR(f);} \
126  double c::_deltaMaxOverR()const{return deltaMaxOverR();} \
127  void c::_delta(double f){delta(f);} \
128  double c::_delta()const{return delta();} \
129  void c::_delta(double f, std::string const &u){delta(f, u);} \
130  double c::_delta(std::string const &u)const{return delta(u);} \
131  void c::_tMin(double f){tMin(f);} \
132  double c::_tMin()const{return tMin();} \
133  void c::_tMin(double f, std::string const &u){tMin(f, u);} \
134  double c::_tMin(std::string const &u)const{return tMin(u);} \
135  void c::_maxiter(size_t f){maxiter(f);} \
136  size_t c::_maxiter()const{return maxiter();} \
137  void c::_integrator(std::string const &f){integrator(f);} \
138  std::string c::_integrator() const {return integrator();} \
139  std::vector<double> c::_initCoord()const{return initCoord();} \
140  void c::_initCoord(std::vector<double> const &f){initCoord(f);} \
141  void c::_metric(SmartPointer<Metric::Generic>f){metric(f);} \
142  SmartPointer<Metric::Generic> c::_metric() const{return metric();}
143 
145 
151 #define GYOTO_WORLDLINE_PROPERTY_END(c, a) \
152  GYOTO_WORLDLINE_PROPERTIES(c) \
153  GYOTO_PROPERTY_END(c, a) \
154  GYOTO_WORLDLINE_ACCESSORS(c)
155 
157 
164 #define GYOTO_WORLDLINE \
165  void _delta(const double delta); \
166  void _delta(double, const std::string &unit); \
167  double _delta() const ; \
168  double _delta(const std::string &unit) const ; \
169  void _tMin(const double tmin); \
170  void _tMin(double, const std::string &unit); \
171  double _tMin() const ; \
172  double _tMin(const std::string &unit) const ; \
173  void _adaptive (bool mode) ; \
174  bool _adaptive () const ; \
175  void _secondary (bool sec) ; \
176  bool _secondary () const ; \
177  void _integ31 (bool sec) ; \
178  bool _integ31 () const ; \
179  void _parallelTransport (bool sec) ; \
180  bool _parallelTransport () const ; \
181  void _maxiter (size_t miter) ; \
182  size_t _maxiter () const ; \
183  void _integrator(std::string const & type); \
184  std::string _integrator() const ; \
185  double _deltaMin() const; \
186  void _deltaMin(double h1); \
187  void _absTol(double); \
188  double _absTol()const; \
189  void _maxCrossEqplane(double); \
190  double _maxCrossEqplane()const; \
191  void _relTol(double); \
192  double _relTol()const; \
193  void _deltaMax(double h1); \
194  double _deltaMax()const; \
195  double _deltaMaxOverR() const; \
196  void _deltaMaxOverR(double t); \
197  std::vector<double> _initCoord()const; \
198  void _initCoord(std::vector<double> const&f); \
199  void _metric(SmartPointer<Metric::Generic>); \
200  SmartPointer<Metric::Generic> _metric() const;
201 
239 : protected Gyoto::Hook::Listener
240 {
241 
242  // Data :
243  // -----
244  public:
245  int stopcond;
246 
247  protected:
249  double* tau_;
250  double* x0_;
251  double* x1_;
252  double* x2_;
253  double* x3_;
254  double* x0dot_;
255  double* x1dot_;
256  double* x2dot_;
257  double* x3dot_;
258  double* ep0_;
259  double* ep1_;
260  double* ep2_;
261  double* ep3_;
262  double* et0_;
263  double* et1_;
264  double* et2_;
265  double* et3_;
266  size_t x_size_;
267  size_t imin_;
268  size_t i0_;
269  size_t imax_;
270  bool adaptive_;
271 
278 
286 
292  double delta_;
293 
294 
304  double tmin_;
305 
306  double * cst_;
307  size_t cst_n_;
308  int wait_pos_;
309  double * init_vel_;
310  size_t maxiter_ ;
311 
319  double delta_min_;
320 
328  double delta_max_;
329 
342 
350  double abstol_;
351 
359  double reltol_;
360 
368 
369  // Constructors - Destructor
370  // -------------------------
371  public:
372  Worldline() ;
373 
374  Worldline(const Worldline& ) ;
375 
377 
390  Worldline(Worldline* orig, size_t i0, int dir, double step_max) ;
391 
392  virtual ~Worldline() ;
393 
394  size_t getImin() const;
395  size_t getImax() const;
396  size_t getI0() const;
397 
398  virtual double getMass() const = 0;
401 
402  void initCoord(std::vector<double> const&);
403  std::vector<double> initCoord() const;
404 
427  virtual void setInitCoord(const double coord[8], int dir,
428  double const Ephi[4],
429  double const Etheta[4]);
430 
431 
450  virtual void setInitCoord(const double coord[8], int dir = 0);
451 
459  virtual void setInitCoord(double const pos[4], double const vel[3], int dir=0);
460 
461  virtual void setPosition(double const pos[4]);
462  virtual void setVelocity(double const vel[3]);
463 
464  void reset() ;
465  void reInit() ;
466 
467  virtual std::string className() const ;
468  virtual std::string className_l() const ;
469 
480  void integrator(std::string const & type);
481 
485  std::string integrator() const ;
486 
493  void integ31(bool integ);
494 
498  bool integ31() const ;
499 
503  double deltaMin() const;
504 
508  void deltaMin(double h1);
509 
513  double deltaMax() const;
514 
515 
516  void absTol(double);
517  double absTol()const;
518  void relTol(double);
519  double relTol()const;
520 
521  void maxCrossEqplane(double);
522  double maxCrossEqplane()const;
523 
534  virtual double deltaMax(double const pos[8], double delta_max_external) const;
535 
539  void deltaMax(double h1);
540 
541  double deltaMaxOverR() const;
542  void deltaMaxOverR(double t);
543 
544  // Memory management
545  // -----------------
546  protected:
550  virtual void xAllocate();
551 
555  virtual void xAllocate(size_t size);
556 
568  virtual size_t xExpand(int dir);
569 
577  virtual void xExpand(double * &x, int dir);
578 
582  virtual void eAllocate ();
583 
587  virtual void eDeallocate ();
588 
592  virtual void eExpand(int dir);
593 
594  // Mutators / assignment
595  // ---------------------
596  public:
598  void delta(const double delta);
599  void delta(double, const std::string &unit);
600  double delta() const ;
601  double delta(const std::string &unit) const ;
602  double tMin() const ;
603  double tMin(const std::string &unit) const ;
604  void tMin(double tlim);
605  void tMin(double, const std::string &unit);
606  void adaptive (bool mode) ;
607  bool adaptive () const ;
608  void secondary (bool sec) ;
609  bool secondary () const ;
610  void parallelTransport (bool pt) ;
611  bool parallelTransport () const ;
612  void maxiter (size_t miter) ;
613  size_t maxiter () const ;
614 
624  double const * getCst() const ;
625 
627 
635  void setCst(double const * cst, size_t const ncsts) ;
636 
638 
644  void constantsOfMotion(std::vector<double> const cstv) ;
645 
647 
652  std::vector<double> constantsOfMotion() const ;
653 
655 
667  const double coord[8],
668  const int dir,
669  double const Ephi[4], double const Etheta[4]) ;
670 
672 
680  const double coord[8],
681  const int dir) ;
682 
688  void getInitialCoord(std::vector<double> &dest) const;
689 
695  void getCoord(size_t index, Gyoto::state_t &dest) const;
696 
701  void getCoord(size_t index, Gyoto::state_t &dest) ;
702 
708  void getCoord(double date, Gyoto::state_t &dest, bool proper=false);
709 
710  void getCartesianPos(size_t index, double dest[4]) const;
711 
712 
713  virtual void xStore(size_t ind, state_t const &coord, double tau) ;
714  virtual void xStore(size_t ind, state_t const &coord) =delete;
715  virtual void xStore(size_t ind, double const coord[8]) = delete;
716  virtual void xFill(double tlim, bool proper=false) ;
717 
718 
719 
720  // Accessors
721  // ---------
722  public:
726  size_t get_nelements() const;
727 
731  void get_t(double *dest) const;
732 
736  void get_tau(double *dest) const;
737 
739 
755  void getCartesian(double const * const dates, size_t const n_dates,
756  double * const x, double * const y,
757  double * const z, double * const xprime=NULL,
758  double * const yprime=NULL, double * const zprime=NULL) ;
759 
763  void get_xyz(double* x, double *y, double *z) const;
764 
796  void getCoord(double const * const dates, size_t const n_dates,
797  double * const x1dest,
798  double * const x2dest, double * const x3dest,
799  double * const x0dot=NULL, double * const x1dot=NULL,
800  double * const x2dot=NULL, double * const x3dot=NULL,
801  double * ep0=NULL, double * ep1=NULL, double * ep2=NULL, double * ep3=NULL,
802  double * et0=NULL, double * et1=NULL, double * et2=NULL, double * et3=NULL,
803  double * otime=NULL, bool proper=false) ;
804 
811  void getCoord(double *x0, double *x1, double *x2, double *x3) const ;
812 
821  void checkPhiTheta(double coord[8]) const;
822 
826  void getSkyPos(SmartPointer<Screen> screen, double *dalpha, double *ddellta, double *dD) const;
827 
831  void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const ;
832 
836  void get_prime(double *x1prime, double *x2prime, double *x3prime) const ;
837 
838  // Outputs
839  // -------
840  public:
841  //virtual void sauve(FILE *) const ; ///< Save in a file
842  void save_txyz(char * fichierxyz) const ;
843  void save_txyz(char* const filename, double const t1, double const mass_sun,
844  double const distance_kpc, std::string const unit, SmartPointer<Screen> sc = NULL);
845 
846  protected:
847  virtual void tell(Gyoto::Hook::Teller*);
848 
849  class IntegState {
850  public:
851  class Generic;
852  class Legacy;
853 #ifdef GYOTO_HAVE_BOOST_INTEGRATORS
854  class Boost;
855 #endif
856  };
857 
858 
863 };
864 
865 #ifndef GYOTO_SWIGIMPORTED
866 
872 
873  protected:
875 
880  // add 31 flag
881  bool integ_31_;
882  double delta_;
883  bool adaptive_;
885  double norm_;
886  double normref_;
887 
891  Gyoto::SmartPointer<Gyoto::Metric::Generic> gg_;
892 
893  public:
899  Generic(Worldline *parent);
900 
904  virtual ~Generic();
905 
911  virtual Generic * clone(Worldline*newparent) const =0 ;
912 
919  virtual void init(Worldline * line, const state_t &coord, const double delta);
921  virtual void init(Worldline * line, const double *coord, const double delta) = delete;
922 
931  virtual void init();
932 
939  virtual void checkNorm(double coord[8]);
940 
944  virtual std::string kind()=0;
945 
949  void integ31(bool integ);
950  bool integ31() const ;
951 
953 
958  virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0;
960  virtual int nextStep(double *coord, double h1max=GYOTO_DEFAULT_DELTA_MAX) = delete;
961 
963 
972  virtual void doStep(state_t const &coordin,
973  double step,
974  state_t &coordout)=0;
976  virtual void doStep(double const coordin[8],
977  double step,
978  double coordout[8]) = delete;
979 
980 };
981 
997 
998  private:
999  state_t coord_;
1000 
1001  public:
1003 
1004  Legacy(Worldline *parent);
1005  Legacy * clone(Worldline*newparent) const ;
1006  using Generic::init;
1007  void init(Worldline * line, const state_t &coord, const double delta);
1008  virtual std::string kind();
1009 
1010  virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
1011 
1012  virtual void doStep(state_t const &coordin,
1013  double step,
1014  state_t &coordout);
1015 
1016  virtual ~Legacy();
1017 };
1018 
1019 #ifdef GYOTO_HAVE_BOOST_INTEGRATORS
1020 
1032  public:
1036  enum Kind {runge_kutta_cash_karp54,
1037  runge_kutta_fehlberg78,
1038  runge_kutta_dopri5,
1039  runge_kutta_cash_karp54_classic };
1040  private:
1043 
1044  typedef std::function<boost::numeric::odeint::controlled_step_result
1045  (state_t&, double&, double&)> try_step_t;
1046  typedef std::function<void(state_t&, double)> do_step_t;
1047  typedef std::function<void(const state_t &/*x*/,
1048  state_t & /*dxdt*/,
1049  const double /* t*/ )> system_t;
1050 
1052  try_step_t try_step_;
1053 
1055  do_step_t do_step_;
1056 
1057  public:
1059 
1064  Boost(Worldline* parent, std::string type);
1065 
1067 
1072  Boost(Worldline* parent, Kind type);
1073  Boost * clone(Worldline* newparent) const ;
1074  virtual ~Boost();
1075  virtual void init();
1076  virtual void init(Worldline * line, const state_t &coord, const double delta);
1077  virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
1078  virtual void doStep(state_t const &coordin,
1079  double step,
1080  state_t &coordout);
1081  virtual std::string kind();
1082 
1083 };
1084 #endif
1085 #endif
1086 #endif
double delta_max_over_r_
Numerical tuning parameter.
Definition: GyotoWorldline.h:341
double maxCrossEqplane() const
Get maxCrossEqplane_.
double * init_vel_
Hack in setParameters()
Definition: GyotoWorldline.h:309
void getSkyPos(SmartPointer< Screen > screen, double *dalpha, double *ddellta, double *dD) const
Get computed positions in sky coordinates.
size_t get_nelements() const
Get number of computed dates.
void reset()
Forget integration, keeping initial contition.
void integ31(bool integ)
Defines the kind of geodesic equation to integrate (3+1, 4D)
virtual void setPosition(double const pos[4])
Set initial 4-position.
double deltaMax() const
Get delta_max_.
double maxCrossEqplane_
Maximum number of crossings of equatorial plane.
Definition: GyotoWorldline.h:367
Timelike or null geodesics.
Definition: GyotoWorldline.h:238
SmartPointer< Gyoto::Metric::Generic > metric_
The Gyoto::Metric in this part of the universe.
Definition: GyotoWorldline.h:248
double delta_
Initial integrating step.
Definition: GyotoWorldline.h:292
void get_tau(double *dest) const
Get computed proper times or values of the affine parameter.
virtual void xFill(double tlim, bool proper=false)
Fill x0, x1... by integrating the Worldline from previously set inittial condition to time tlim...
void save_txyz(char *fichierxyz) const
Save in a file.
Tellers tell Listeners when they mutate.
virtual void xStore(size_t ind, state_t const &coord, double tau)
Store coord at index ind.
bool parallel_transport_
Whether to parallel-transport base vectors.
Definition: GyotoWorldline.h:884
Reference-counting pointers.
virtual std::string className_l() const
"worldline"
Boost integrator.
Definition: GyotoWorldline.h:1030
do_step_t do_step_
Stepper used by the non-adaptive-step integrator.
Definition: GyotoWorldline.h:1055
void setInitialCondition(SmartPointer< Metric::Generic > gg, const double coord[8], const int dir, double const Ephi[4], double const Etheta[4])
Set or re-set the initial condition prior to integration.
void reInit()
Reset and recompute particle properties.
double tmin_
Time limit for the integration (geometrical units)
Definition: GyotoWorldline.h:304
Kind
Enum to represent the integrator flavour.
Definition: GyotoWorldline.h:1036
double delta_min_
Minimum integration step for the adaptive integrator.
Definition: GyotoWorldline.h:319
double * tau_
proper time or affine parameter
Definition: GyotoWorldline.h:249
size_t getImax() const
Get imax_.
virtual void eExpand(int dir)
virtual void checkNorm(double coord[8])
Check norm.
double * cst_
Worldline&#39;s csts of motion (if any)
Definition: GyotoWorldline.h:306
double * et1_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:263
double relTol() const
Get reltol_.
double delta() const
Get delta_.
void getInitialCoord(std::vector< double > &dest) const
Get initial coordinates + base vectors.
void getCartesian(double const *const dates, size_t const n_dates, double *const x, double *const y, double *const z, double *const xprime=NULL, double *const yprime=NULL, double *const zprime=NULL)
Get the 6 Cartesian coordinates for specific dates.
virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0
Make one step.
bool adaptive_
Whether to use an adaptive step.
Definition: GyotoWorldline.h:883
virtual void tell(Gyoto::Hook::Teller *)
This is how a Teller tells.
bool secondary() const
Get secondary_.
Gyoto::SmartPointer< Gyoto::Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoWorldline.h:891
double * et2_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:264
void get_xyz(double *x, double *y, double *z) const
Get 3-position in cartesian coordinates for computed dates.
size_t i0_
Index of initial condition in array.
Definition: GyotoWorldline.h:268
void getCartesianPos(size_t index, double dest[4]) const
Get Cartesian expression of 4-position at index.
Obsolete: Home-brewed integrator.
Definition: GyotoWorldline.h:995
double tMin() const
Get tmin_.
double const * getCst() const
Returns the worldline&#39;s cst of motion (if any)
Gyoto ubiquitous macros and typedefs.
Base class for metric description.
SmartPointer< Worldline::IntegState::Generic > state_
An object to hold the integration state.
Definition: GyotoWorldline.h:862
size_t x_size_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:266
double * x0_
t or T
Definition: GyotoWorldline.h:250
bool adaptive_
Whether integration should use adaptive delta.
Definition: GyotoWorldline.h:270
bool integ31() const
Get the kind of geodesic equation integrated by state_.
double * ep3_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:261
size_t getImin() const
Get imin_.
size_t maxiter() const
Get maxiter_.
double * x2_
θ or y
Definition: GyotoWorldline.h:252
double * x3dot_
φdot or zdot
Definition: GyotoWorldline.h:257
double * x0dot_
tdot or Tdot
Definition: GyotoWorldline.h:254
bool parallel_transport_
Whether to parallel transport a local triad.
Definition: GyotoWorldline.h:285
Definition: GyotoWorldline.h:849
double norm_
Current norm of the 4-velocity.
Definition: GyotoWorldline.h:885
double reltol_
Absolute tolerance of the integrator.
Definition: GyotoWorldline.h:359
double normref_
Definition: GyotoWorldline.h:886
double deltaMaxOverR() const
Get delta_max_over_r_.
double * et3_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:265
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
virtual double getMass() const =0
Get mass of particule.
virtual Generic * clone(Worldline *newparent) const =0
Deep copy.
virtual void init()
Cache whatever needs to be cached.
virtual void doStep(state_t const &coordin, double step, state_t &coordout)=0
Make one step of exactly this size.
virtual void eAllocate()
Allocate ep0_ ... et3_.
void get_t(double *dest) const
Get computed dates.
double * ep1_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:259
bool adaptive() const
Get adaptive_.
void checkPhiTheta(double coord[8]) const
Bring θ in [0,Π] and φ in [0,2Π].
double deltaMin() const
Get delta_min_.
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:80
bool secondary_
Experimental: choose 0 to compute only primary image.
Definition: GyotoWorldline.h:277
try_step_t try_step_
Stepper used by the adaptive-step integrator.
Definition: GyotoWorldline.h:1052
I might listen to a Teller.
Definition: GyotoHooks.h:64
void get_prime(double *x1prime, double *x2prime, double *x3prime) const
Get computed 3-velocities.
bool parallelTransport() const
Get parallel_transport_.
std::vector< double > constantsOfMotion() const
Return a copy of the Metric-specific constants of motion.
virtual std::string kind()=0
Return the integrator kind.
bool integ_31_
Whether to integrate the 3+1 equation of geodesics instead of the 4D one.
Definition: GyotoWorldline.h:881
virtual ~Worldline()
Destructor.
double delta_
Integration step (current in case of adaptive_).
Definition: GyotoWorldline.h:882
double * x3_
φ or z
Definition: GyotoWorldline.h:253
void getCoord(size_t index, Gyoto::state_t &dest) const
Get coordinates+base vectors corresponding to index.
double * ep2_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:260
virtual std::string className() const
"Worldline"
size_t cst_n_
Number of constants of motion.
Definition: GyotoWorldline.h:307
size_t imin_
Minimum index for which x0_, x1_... have been computed.
Definition: GyotoWorldline.h:267
double * x1dot_
rdot or xdot
Definition: GyotoWorldline.h:255
double abstol_
Absolute tolerance of the integrator.
Definition: GyotoWorldline.h:350
size_t getI0() const
Get i0_.
virtual size_t xExpand(int dir)
Expand x0, x1 etc... to hold more elements.
Current state of a geodesic integration.
Definition: GyotoWorldline.h:870
virtual void setVelocity(double const vel[3])
Set initial 3-velocity.
Kind kind_
Integrator flavour.
Definition: GyotoWorldline.h:1042
Description of the observer screen.
virtual void setInitCoord(const double coord[8], int dir, double const Ephi[4], double const Etheta[4])
Set Initial coordinate.
SmartPointer< Metric::Generic > metric() const
Get metric.
virtual void eDeallocate()
Deallocate ep0_ ... et3_.
Worldline * line_
Worldline that we are integrating.
Definition: GyotoWorldline.h:879
double delta_max_
Maximum integration step for the adaptive integrator.
Definition: GyotoWorldline.h:328
double * et0_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:262
int wait_pos_
Hack in setParameters()
Definition: GyotoWorldline.h:308
std::string integrator() const
Describe the integrator used by state_.
virtual void xAllocate()
Allocate x0, x1 etc. with default size.
double * x2dot_
θdot or ydot
Definition: GyotoWorldline.h:256
Listen to me and I&#39;ll warn you when I change.
Definition: GyotoHooks.h:82
void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const
Get computed 4-velocities.
double * x1_
r or x
Definition: GyotoWorldline.h:251
int stopcond
Whether and why integration is finished.
Definition: GyotoWorldline.h:245
void setCst(double const *cst, size_t const ncsts)
Set Metric-specific constants of motion.
size_t maxiter_
Maximum number of iterations when integrating.
Definition: GyotoWorldline.h:310
Worldline()
Default constructor.
double absTol() const
Get abstol_.
size_t imax_
Maximum index for which x0_, x1_... have been computed.
Definition: GyotoWorldline.h:269