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
41namespace 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, HighOrderImages, PrimaryOnly, _secondary, \
61 "Whether to stop Photon integration at 180° deflection.") \
62 GYOTO_PROPERTY_BOOL(c, ParallelTransport, NoParallelTransport, _parallelTransport, \
63 "Whether to perform parallel transport of a local triad (used for polarization).") \
64 GYOTO_PROPERTY_DOUBLE(c, RelTol, _relTol, \
65 "Relative tolerance for the adaptive step integrators.") \
66 GYOTO_PROPERTY_DOUBLE(c, AbsTol, _absTol, \
67 "Absolute tolerance for the adaptive step integrators.") \
68 GYOTO_PROPERTY_DOUBLE(c, DeltaMaxOverR, _deltaMaxOverR, \
69 "Maximum value of step/distance from center of mass.") \
70 GYOTO_PROPERTY_DOUBLE(c, DeltaMax, _deltaMax, "Maximum step (geometrical units).") \
71 GYOTO_PROPERTY_DOUBLE(c, DeltaMin, _deltaMin, "Minimum step (geometrical units).") \
72 GYOTO_PROPERTY_STRING(c, Integrator, _integrator, \
73 "Name of integrator (\"runge_kutta_fehlberg78\").") \
74 GYOTO_PROPERTY_SIZE_T(c, MaxIter, _maxiter, \
75 "Maximum number of integration steps.") \
76 GYOTO_PROPERTY_BOOL(c, Adaptive, NonAdaptive, _adaptive, \
77 "Whether to use an adaptive step.") \
78 GYOTO_PROPERTY_DOUBLE_UNIT(c, MinimumTime, _tMin, \
79 "Do not integrate earlier than this date (geometrical_time).") \
80 GYOTO_PROPERTY_DOUBLE_UNIT(c, Delta, _delta, \
81 "Initial integration step (geometrical units).") \
82 GYOTO_PROPERTY_VECTOR_DOUBLE(c, InitCoord, _initCoord, \
83 "Initial 8-coordinate.") \
84 GYOTO_PROPERTY_METRIC(c, Metric, _metric, \
85 "The geometry of space-time at this end of the Universe.")
86
88
102#define GYOTO_WORLDLINE_ACCESSORS(c) \
103 void c::_secondary(bool s) {secondary(s);} \
104 bool c::_secondary() const {return secondary();} \
105 void c::_parallelTransport(bool s) {parallelTransport(s);} \
106 bool c::_parallelTransport() const {return parallelTransport();} \
107 void c::_adaptive(bool s) {adaptive(s);} \
108 bool c::_adaptive() const {return adaptive();} \
109 void c::_relTol(double f){relTol(f);} \
110 double c::_relTol()const{return relTol();} \
111 void c::_absTol(double f){absTol(f);} \
112 double c::_absTol()const{return absTol();} \
113 void c::_deltaMin(double f){deltaMin(f);} \
114 double c::_deltaMin()const{return deltaMin();} \
115 void c::_deltaMax(double f){deltaMax(f);} \
116 double c::_deltaMax()const{return deltaMax();} \
117 void c::_deltaMaxOverR(double f){deltaMaxOverR(f);} \
118 double c::_deltaMaxOverR()const{return deltaMaxOverR();} \
119 void c::_delta(double f){delta(f);} \
120 double c::_delta()const{return delta();} \
121 void c::_delta(double f, std::string const &u){delta(f, u);} \
122 double c::_delta(std::string const &u)const{return delta(u);} \
123 void c::_tMin(double f){tMin(f);} \
124 double c::_tMin()const{return tMin();} \
125 void c::_tMin(double f, std::string const &u){tMin(f, u);} \
126 double c::_tMin(std::string const &u)const{return tMin(u);} \
127 void c::_maxiter(size_t f){maxiter(f);} \
128 size_t c::_maxiter()const{return maxiter();} \
129 void c::_integrator(std::string const &f){integrator(f);} \
130 std::string c::_integrator() const {return integrator();} \
131 std::vector<double> c::_initCoord()const{return initCoord();} \
132 void c::_initCoord(std::vector<double> const &f){initCoord(f);} \
133 void c::_metric(SmartPointer<Metric::Generic>f){metric(f);} \
134 SmartPointer<Metric::Generic> c::_metric() const{return metric();}
135
137
143#define GYOTO_WORLDLINE_PROPERTY_END(c, a) \
144 GYOTO_WORLDLINE_PROPERTIES(c) \
145 GYOTO_PROPERTY_END(c, a) \
146 GYOTO_WORLDLINE_ACCESSORS(c)
147
149
156#define GYOTO_WORLDLINE \
157 void _delta(const double delta); \
158 void _delta(double, const std::string &unit); \
159 double _delta() const ; \
160 double _delta(const std::string &unit) const ; \
161 void _tMin(const double tmin); \
162 void _tMin(double, const std::string &unit); \
163 double _tMin() const ; \
164 double _tMin(const std::string &unit) const ; \
165 void _adaptive (bool mode) ; \
166 bool _adaptive () const ; \
167 void _secondary (bool sec) ; \
168 bool _secondary () const ; \
169 void _parallelTransport (bool sec) ; \
170 bool _parallelTransport () const ; \
171 void _maxiter (size_t miter) ; \
172 size_t _maxiter () const ; \
173 void _integrator(std::string const & type); \
174 std::string _integrator() const ; \
175 double _deltaMin() const; \
176 void _deltaMin(double h1); \
177 void _absTol(double); \
178 double _absTol()const; \
179 void _relTol(double); \
180 double _relTol()const; \
181 void _deltaMax(double h1); \
182 double _deltaMax()const; \
183 double _deltaMaxOverR() const; \
184 void _deltaMaxOverR(double t); \
185 std::vector<double> _initCoord()const; \
186 void _initCoord(std::vector<double> const&f); \
187 void _metric(SmartPointer<Metric::Generic>); \
188 SmartPointer<Metric::Generic> _metric() const;
189
227: protected Gyoto::Hook::Listener
228{
229
230 // Data :
231 // -----
232 public:
234
235 protected:
237 double* tau_;
238 double* x0_;
239 double* x1_;
240 double* x2_;
241 double* x3_;
242 double* x0dot_;
243 double* x1dot_;
244 double* x2dot_;
245 double* x3dot_;
246 double* ep0_;
247 double* ep1_;
248 double* ep2_;
249 double* ep3_;
250 double* et0_;
251 double* et1_;
252 double* et2_;
253 double* et3_;
254 size_t x_size_;
255 size_t imin_;
256 size_t i0_;
257 size_t imax_;
259
266
274
280 double delta_;
281
282
292 double tmin_;
293
294 double * cst_;
295 size_t cst_n_;
297 double * init_vel_;
298 size_t maxiter_ ;
299
308
317
330
338 double abstol_;
339
347 double reltol_;
348
349 // Constructors - Destructor
350 // -------------------------
351 public:
353
355
357
370 Worldline(Worldline* orig, size_t i0, int dir, double step_max) ;
371
372 virtual ~Worldline() ;
373
374 size_t getImin() const;
375 size_t getImax() const;
376 size_t getI0() const;
377
378 virtual double getMass() const = 0;
381
382 void initCoord(std::vector<double> const&);
383 std::vector<double> initCoord() const;
384
407 virtual void setInitCoord(const double coord[8], int dir,
408 double const Ephi[4],
409 double const Etheta[4]);
410
411
430 virtual void setInitCoord(const double coord[8], int dir = 0);
431
439 virtual void setInitCoord(double const pos[4], double const vel[3], int dir=0);
440
441 virtual void setPosition(double const pos[4]);
442 virtual void setVelocity(double const vel[3]);
443
444 void reset() ;
445 void reInit() ;
446
447 virtual std::string className() const ;
448 virtual std::string className_l() const ;
449
460 void integrator(std::string const & type);
461
465 std::string integrator() const ;
466
470 double deltaMin() const;
471
475 void deltaMin(double h1);
476
480 double deltaMax() const;
481
482
483 void absTol(double);
484 double absTol()const;
485 void relTol(double);
486 double relTol()const;
487
498 virtual double deltaMax(double const pos[8], double delta_max_external) const;
499
503 void deltaMax(double h1);
504
505 double deltaMaxOverR() const;
506 void deltaMaxOverR(double t);
507
508 // Memory management
509 // -----------------
510 protected:
514 virtual void xAllocate();
515
519 virtual void xAllocate(size_t size);
520
532 virtual size_t xExpand(int dir);
533
541 virtual void xExpand(double * &x, int dir);
542
546 virtual void eAllocate ();
547
551 virtual void eDeallocate ();
552
556 virtual void eExpand(int dir);
557
558 // Mutators / assignment
559 // ---------------------
560 public:
562 void delta(const double delta);
563 void delta(double, const std::string &unit);
564 double delta() const ;
565 double delta(const std::string &unit) const ;
566 double tMin() const ;
567 double tMin(const std::string &unit) const ;
568 void tMin(double tlim);
569 void tMin(double, const std::string &unit);
570 void adaptive (bool mode) ;
571 bool adaptive () const ;
572 void secondary (bool sec) ;
573 bool secondary () const ;
574 void parallelTransport (bool pt) ;
575 bool parallelTransport () const ;
576 void maxiter (size_t miter) ;
577 size_t maxiter () const ;
578
583 double const * getCst() const ;
584
586
590 void setCst(double const * cst, size_t const ncsts) ;
591
593
605 const double coord[8],
606 const int dir,
607 double const Ephi[4], double const Etheta[4]) ;
608
610
618 const double coord[8],
619 const int dir) ;
620
626 void getInitialCoord(std::vector<double> &dest) const;
627
633 void getCoord(size_t index, Gyoto::state_t &dest) const;
634
639 void getCoord(size_t index, Gyoto::state_t &dest) ;
640
646 void getCoord(double date, Gyoto::state_t &dest, bool proper=false);
647
648 void getCartesianPos(size_t index, double dest[4]) const;
649
650
651 virtual void xStore(size_t ind, state_t const &coord, double tau) ;
652 virtual void xStore(size_t ind, state_t const &coord) =delete;
653 virtual void xStore(size_t ind, double const coord[8]) = delete;
654 virtual void xFill(double tlim, bool proper=false) ;
655
656
657
658 // Accessors
659 // ---------
660 public:
664 size_t get_nelements() const;
665
669 void get_t(double *dest) const;
670
674 void get_tau(double *dest) const;
675
677
693 void getCartesian(double const * const dates, size_t const n_dates,
694 double * const x, double * const y,
695 double * const z, double * const xprime=NULL,
696 double * const yprime=NULL, double * const zprime=NULL) ;
697
701 void get_xyz(double* x, double *y, double *z) const;
702
734 void getCoord(double const * const dates, size_t const n_dates,
735 double * const x1dest,
736 double * const x2dest, double * const x3dest,
737 double * const x0dot=NULL, double * const x1dot=NULL,
738 double * const x2dot=NULL, double * const x3dot=NULL,
739 double * ep0=NULL, double * ep1=NULL, double * ep2=NULL, double * ep3=NULL,
740 double * et0=NULL, double * et1=NULL, double * et2=NULL, double * et3=NULL,
741 double * otime=NULL, bool proper=false) ;
742
749 void getCoord(double *x0, double *x1, double *x2, double *x3) const ;
750
759 void checkPhiTheta(double coord[8]) const;
760
764 void getSkyPos(SmartPointer<Screen> screen, double *dalpha, double *ddellta, double *dD) const;
765
769 void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const ;
770
774 void get_prime(double *x1prime, double *x2prime, double *x3prime) const ;
775
776 // Outputs
777 // -------
778 public:
779 //virtual void sauve(FILE *) const ; ///< Save in a file
780 void save_txyz(char * fichierxyz) const ;
781 void save_txyz(char* const filename, double const t1, double const mass_sun,
782 double const distance_kpc, std::string const unit, SmartPointer<Screen> sc = NULL);
783
784 protected:
785 virtual void tell(Gyoto::Hook::Teller*);
786
788 public:
789 class Generic;
790 class Legacy;
791#ifdef GYOTO_HAVE_BOOST_INTEGRATORS
792 class Boost;
793#endif
794 };
795
796
801};
802
803#ifndef GYOTO_SWIGIMPORTED
810
811 protected:
813
818 double delta_;
821 double norm_;
822 double normref_;
824
827 Gyoto::SmartPointer<Gyoto::Metric::Generic> gg_;
828
829 public:
835 Generic(Worldline *parent);
836
840 virtual ~Generic();
841
847 virtual Generic * clone(Worldline*newparent) const =0 ;
848
855 virtual void init(Worldline * line, const state_t &coord, const double delta);
857 virtual void init(Worldline * line, const double *coord, const double delta) = delete;
858
867 virtual void init();
868
875 virtual void checkNorm(double coord[8]);
876
880 virtual std::string kind()=0;
881
883
888 virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0;
890 virtual int nextStep(double *coord, double h1max=GYOTO_DEFAULT_DELTA_MAX) = delete;
891
893
902 virtual void doStep(state_t const &coordin,
903 double step,
904 state_t &coordout)=0;
906 virtual void doStep(double const coordin[8],
907 double step,
908 double coordout[8]) = delete;
909
910};
911
927
928 private:
929 state_t coord_;
930
931 public:
933
934 Legacy(Worldline *parent);
935 Legacy * clone(Worldline*newparent) const ;
936 using Generic::init;
937 void init(Worldline * line, const state_t &coord, const double delta);
938 virtual std::string kind();
939
940 virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
941
942 virtual void doStep(state_t const &coordin,
943 double step,
944 state_t &coordout);
945
946 virtual ~Legacy();
947};
948
949#ifdef GYOTO_HAVE_BOOST_INTEGRATORS
960class Gyoto::Worldline::IntegState::Boost : public Generic {
961 friend class Gyoto::SmartPointer<Gyoto::Worldline::IntegState::Boost>;
962 public:
966 enum Kind {runge_kutta_cash_karp54,
967 runge_kutta_fehlberg78,
968 runge_kutta_dopri5,
969 runge_kutta_cash_karp54_classic };
970 private:
972 Kind kind_;
973
974 typedef std::function<boost::numeric::odeint::controlled_step_result
975 (state_t&, double&, double&)> try_step_t;
976 typedef std::function<void(state_t&, double)> do_step_t;
977 typedef std::function<void(const state_t &/*x*/,
978 state_t & /*dxdt*/,
979 const double /* t*/ )> system_t;
980
982 try_step_t try_step_;
983
985 do_step_t do_step_;
986
987 public:
989
994 Boost(Worldline* parent, std::string type);
995
997
1002 Boost(Worldline* parent, Kind type);
1003 Boost * clone(Worldline* newparent) const ;
1004 virtual ~Boost();
1005 virtual void init();
1006 virtual void init(Worldline * line, const state_t &coord, const double delta);
1007 virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
1008 virtual void doStep(state_t const &coordin,
1009 double step,
1010 state_t &coordout);
1011 virtual std::string kind();
1012
1013};
1014#endif
1015#endif
1016#endif
Gyoto ubiquitous macros and typedefs.
Tellers tell Listeners when they mutate.
Base class for metric description.
Description of the observer screen.
Reference-counting pointers.
I might listen to a Teller.
Definition: GyotoHooks.h:64
Listen to me and I'll warn you when I change.
Definition: GyotoHooks.h:82
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:81
Current state of a geodesic integration.
Definition: GyotoWorldline.h:808
bool adaptive_
Whether to use an adaptive step.
Definition: GyotoWorldline.h:819
virtual void init()
Cache whatever needs to be cached.
double delta_
Integration step (current in case of adaptive_).
Definition: GyotoWorldline.h:818
Worldline * line_
Worldline that we are integrating.
Definition: GyotoWorldline.h:817
Gyoto::SmartPointer< Gyoto::Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoWorldline.h:827
virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0
Make one step.
virtual void checkNorm(double coord[8])
Check norm.
double normref_
Definition: GyotoWorldline.h:822
virtual std::string kind()=0
Return the integrator kind.
virtual void doStep(state_t const &coordin, double step, state_t &coordout)=0
Make one step of exactly this size.
bool parallel_transport_
Whether to parallel-transport base vectors.
Definition: GyotoWorldline.h:820
virtual Generic * clone(Worldline *newparent) const =0
Deep copy.
double norm_
Current norm of the 4-velocity.
Definition: GyotoWorldline.h:821
Obsolete: Home-brewed integrator.
Definition: GyotoWorldline.h:925
Definition: GyotoWorldline.h:787
Timelike or null geodesics.
Definition: GyotoWorldline.h:228
double * et1_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:251
virtual ~Worldline()
Destructor.
double * x1_
r or x
Definition: GyotoWorldline.h:239
double * x1dot_
rdot or xdot
Definition: GyotoWorldline.h:243
double * x0dot_
tdot or Tdot
Definition: GyotoWorldline.h:242
void getCoord(size_t index, Gyoto::state_t &dest)
Get coordinates+base vectors corresponding to index.
double reltol_
Absolute tolerance of the integrator.
Definition: GyotoWorldline.h:347
double relTol() const
Get reltol_.
size_t getI0() const
Get i0_.
virtual void eAllocate()
Allocate ep0_ ... et3_.
bool adaptive() const
Get adaptive_.
virtual std::string className_l() const
"worldline"
double * x3dot_
φdot or zdot
Definition: GyotoWorldline.h:245
virtual void setPosition(double const pos[4])
Set initial 4-position.
void getCoord(double *x0, double *x1, double *x2, double *x3) const
Get all computed positions.
virtual void xStore(size_t ind, state_t const &coord)=delete
Obsolete, update your code.
void delta(const double delta)
Expand memory slots for polarization vectors.
double delta(const std::string &unit) const
Get delta_ in specified units.
size_t getImax() const
Get imax_.
int stopcond
Whether and why integration is finished.
Definition: GyotoWorldline.h:233
Worldline(Worldline *orig, size_t i0, int dir, double step_max)
Refine constructor.
virtual void eExpand(int dir)
Worldline(const Worldline &)
Copy constructor.
double * et0_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:250
void relTol(double)
Set reltol_.
double tmin_
Time limit for the integration (geometrical units)
Definition: GyotoWorldline.h:292
SmartPointer< Worldline::IntegState::Generic > state_
An object to hold the integration state.
Definition: GyotoWorldline.h:800
void parallelTransport(bool pt)
Set parallel_transport_.
void setCst(double const *cst, size_t const ncsts)
Set Metric-specific constants of motion.
SmartPointer< Metric::Generic > metric() const
Get metric.
virtual void xAllocate()
Allocate x0, x1 etc. with default size.
virtual std::string className() const
"Worldline"
double tMin() const
Get tmin_.
void deltaMaxOverR(double t)
Set delta_max_over_r_.
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.
void integrator(std::string const &type)
Set the integrator.
double * ep1_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:247
SmartPointer< Gyoto::Metric::Generic > metric_
The Gyoto::Metric in this part of the universe.
Definition: GyotoWorldline.h:236
void secondary(bool sec)
Set secondary_.
size_t maxiter() const
Get maxiter_.
size_t maxiter_
Maximum number of iterations when integrating.
Definition: GyotoWorldline.h:298
void getCoord(double const *const dates, size_t const n_dates, double *const x1dest, double *const x2dest, double *const x3dest, double *const x0dot=NULL, double *const x1dot=NULL, double *const x2dot=NULL, double *const x3dot=NULL, double *ep0=NULL, double *ep1=NULL, double *ep2=NULL, double *ep3=NULL, double *et0=NULL, double *et1=NULL, double *et2=NULL, double *et3=NULL, double *otime=NULL, bool proper=false)
Get 8-coordinates for specific dates.
double deltaMin() const
Get delta_min_.
virtual void xStore(size_t ind, double const coord[8])=delete
Obsolete, update your code.
double * et2_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:252
void reInit()
Reset and recompute particle properties.
void get_xyz(double *x, double *y, double *z) const
Get 3-position in cartesian coordinates for computed dates.
virtual double getMass() const =0
Get mass of particule.
void absTol(double)
Set abstol_.
double * x2_
θ or y
Definition: GyotoWorldline.h:240
virtual void setInitCoord(double const pos[4], double const vel[3], int dir=0)
Set initial coordinate.
size_t get_nelements() const
Get number of computed dates.
std::string integrator() const
Describe the integrator used by state_.
void getCartesianPos(size_t index, double dest[4]) const
Get Cartesian expression of 4-position at index.
void adaptive(bool mode)
Set adaptive_.
void getCoord(double date, Gyoto::state_t &dest, bool proper=false)
Get coordinates+base vectors corresponding to date dest[0].
virtual void tell(Gyoto::Hook::Teller *)
This is how a Teller tells.
size_t i0_
Index of initial condition in array.
Definition: GyotoWorldline.h:256
double absTol() const
Get abstol_.
size_t cst_n_
Number of constants of motion.
Definition: GyotoWorldline.h:295
void maxiter(size_t miter)
Set maxiter_.
bool parallel_transport_
Whether to parallel transport a local triad.
Definition: GyotoWorldline.h:273
bool adaptive_
Whether integration should use adaptive delta.
Definition: GyotoWorldline.h:258
double const * getCst() const
Returns the worldline's cst of motion (if any)
virtual void setInitCoord(const double coord[8], int dir=0)
Set Initial coordinate.
void save_txyz(char *const filename, double const t1, double const mass_sun, double const distance_kpc, std::string const unit, SmartPointer< Screen > sc=NULL)
Save, converted.
void reset()
Forget integration, keeping initial contition.
void get_t(double *dest) const
Get computed dates.
double delta_min_
Minimum integration step for the adaptive integrator.
Definition: GyotoWorldline.h:307
bool secondary() const
Get secondary_.
double * x3_
φ or z
Definition: GyotoWorldline.h:241
virtual double deltaMax(double const pos[8], double delta_max_external) const
double * cst_
Worldline's csts of motion (if any)
Definition: GyotoWorldline.h:294
void getCoord(size_t index, Gyoto::state_t &dest) const
Get coordinates+base vectors corresponding to index.
void delta(double, const std::string &unit)
Set delta_ in specified units.
void checkPhiTheta(double coord[8]) const
Bring θ in [0,Π] and φ in [0,2Π].
double deltaMax() const
Get delta_max_.
double * init_vel_
Hack in setParameters()
Definition: GyotoWorldline.h:297
virtual void xFill(double tlim, bool proper=false)
Fill x0, x1... by integrating the Worldline from previously set inittial condition to time tlim.
void metric(SmartPointer< Metric::Generic >)
Set metric Smartpointer.
size_t imax_
Maximum index for which x0_, x1_... have been computed.
Definition: GyotoWorldline.h:257
void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const
Get computed 4-velocities.
size_t imin_
Minimum index for which x0_, x1_... have been computed.
Definition: GyotoWorldline.h:255
void tMin(double, const std::string &unit)
Set tmin_ in specified unit.
void tMin(double tlim)
Set tmin_.
void getInitialCoord(std::vector< double > &dest) const
Get initial coordinates + base vectors.
virtual size_t xExpand(int dir)
Expand x0, x1 etc... to hold more elements.
double * x0_
t or T
Definition: GyotoWorldline.h:238
size_t getImin() const
Get imin_.
virtual void xAllocate(size_t size)
Allocate x0, x1 etc. with a specified size.
void getSkyPos(SmartPointer< Screen > screen, double *dalpha, double *ddellta, double *dD) const
Get computed positions in sky coordinates.
virtual void setInitCoord(const double coord[8], int dir, double const Ephi[4], double const Etheta[4])
Set Initial coordinate.
virtual void xExpand(double *&x, int dir)
Expand one array to hold more elements.
double tMin(const std::string &unit) const
Get tmin_ in specified unit.
void deltaMin(double h1)
Set delta_min_.
double abstol_
Absolute tolerance of the integrator.
Definition: GyotoWorldline.h:338
double delta_max_over_r_
Numerical tuning parameter.
Definition: GyotoWorldline.h:329
virtual void eDeallocate()
Deallocate ep0_ ... et3_.
Worldline()
Default constructor.
int wait_pos_
Hack in setParameters()
Definition: GyotoWorldline.h:296
void deltaMax(double h1)
double delta_max_
Maximum integration step for the adaptive integrator.
Definition: GyotoWorldline.h:316
double * tau_
proper time or affine parameter
Definition: GyotoWorldline.h:237
double * ep2_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:248
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.
size_t x_size_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:254
double deltaMaxOverR() const
Get delta_max_over_r_.
bool secondary_
Experimental: choose 0 to compute only primary image.
Definition: GyotoWorldline.h:265
void get_prime(double *x1prime, double *x2prime, double *x3prime) const
Get computed 3-velocities.
void setInitialCondition(SmartPointer< Metric::Generic > gg, const double coord[8], const int dir)
Set or re-set the initial condition prior to integration.
void get_tau(double *dest) const
Get computed proper times or values of the affine parameter.
void save_txyz(char *fichierxyz) const
Save in a file.
double * ep3_
Coordinate of first base vector to parallel transport.
Definition: GyotoWorldline.h:249
bool parallelTransport() const
Get parallel_transport_.
double delta_
Initial integrating step.
Definition: GyotoWorldline.h:280
virtual void setVelocity(double const vel[3])
Set initial 3-velocity.
double * et3_
Coordinate of Second base vector to parallel transport.
Definition: GyotoWorldline.h:253
double * x2dot_
θdot or ydot
Definition: GyotoWorldline.h:244
virtual void xStore(size_t ind, state_t const &coord, double tau)
Store coord at index ind.
double delta() const
Get delta_.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43