GyotoWorldline.h
Go to the documentation of this file.
/*
Copyright 2011-2018 Frederic Vincent, Thibaut Paumard
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoWorldline_H_
#define __GyotoWorldline_H_
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <GyotoDefs.h>
#ifdef GYOTO_HAVE_BOOST_INTEGRATORS
# include <functional>
# include <array>
# include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
#endif
namespace Gyoto {
class Worldline;
class FactoryMessenger;
}
#include <GyotoSmartPointer.h>
#include <GyotoMetric.h>
#include <GyotoScreen.h>
#include <GyotoHooks.h>
#define GYOTO_WORLDLINE_PROPERTIES(c) \
Gyoto::Property("Gyoto::Worldline", "Time-like or null geodesic."), \
GYOTO_PROPERTY_BOOL(c, Integ31, Integ4D, _integ31, \
"Whether to integrate the 3+1 or 4D equation of geodesics.") \
GYOTO_PROPERTY_BOOL(c, HighOrderImages, PrimaryOnly, _secondary, \
"Whether to stop Photon integration at 180° deflection.") \
GYOTO_PROPERTY_BOOL(c, ParallelTransport, NoParallelTransport, _parallelTransport, \
"Whether to perform parallel transport of a local triad (used for polarization).") \
GYOTO_PROPERTY_DOUBLE(c, MaxCrossEqplane, _maxCrossEqplane, \
"Maximum number of crossings of the equatorial plane allowed for this worldline") \
GYOTO_PROPERTY_DOUBLE(c, RelTol, _relTol, \
"Relative tolerance for the adaptive step integrators.") \
GYOTO_PROPERTY_DOUBLE(c, AbsTol, _absTol, \
"Absolute tolerance for the adaptive step integrators.") \
GYOTO_PROPERTY_DOUBLE(c, DeltaMaxOverR, _deltaMaxOverR, \
"Maximum value of step/distance from center of mass.") \
GYOTO_PROPERTY_DOUBLE(c, DeltaMax, _deltaMax, "Maximum step (geometrical units).") \
GYOTO_PROPERTY_DOUBLE(c, DeltaMin, _deltaMin, "Minimum step (geometrical units).") \
GYOTO_PROPERTY_STRING(c, Integrator, _integrator, \
"Name of integrator (\"runge_kutta_fehlberg78\").") \
GYOTO_PROPERTY_SIZE_T(c, MaxIter, _maxiter, \
"Maximum number of integration steps.") \
GYOTO_PROPERTY_BOOL(c, Adaptive, NonAdaptive, _adaptive, \
"Whether to use an adaptive step.") \
GYOTO_PROPERTY_DOUBLE_UNIT(c, MinimumTime, _tMin, \
"Do not integrate earlier than this date (geometrical_time).") \
GYOTO_PROPERTY_DOUBLE_UNIT(c, Delta, _delta, \
"Initial integration step (geometrical units).") \
GYOTO_PROPERTY_VECTOR_DOUBLE(c, InitCoord, _initCoord, \
"Initial 8-coordinate.") \
GYOTO_PROPERTY_METRIC(c, Metric, _metric, \
"The geometry of space-time at this end of the Universe.")
#define GYOTO_WORLDLINE_ACCESSORS(c) \
void c::_integ31(bool s) {integ31(s);} \
bool c::_integ31() const {return integ31();} \
void c::_secondary(bool s) {secondary(s);} \
bool c::_secondary() const {return secondary();} \
void c::_parallelTransport(bool s) {parallelTransport(s);} \
bool c::_parallelTransport() const {return parallelTransport();} \
void c::_adaptive(bool s) {adaptive(s);} \
bool c::_adaptive() const {return adaptive();} \
void c::_maxCrossEqplane(double max){maxCrossEqplane(max);} \
double c::_maxCrossEqplane()const{return maxCrossEqplane();} \
void c::_relTol(double f){relTol(f);} \
double c::_relTol()const{return relTol();} \
void c::_absTol(double f){absTol(f);} \
double c::_absTol()const{return absTol();} \
void c::_deltaMin(double f){deltaMin(f);} \
double c::_deltaMin()const{return deltaMin();} \
void c::_deltaMax(double f){deltaMax(f);} \
double c::_deltaMax()const{return deltaMax();} \
void c::_deltaMaxOverR(double f){deltaMaxOverR(f);} \
double c::_deltaMaxOverR()const{return deltaMaxOverR();} \
void c::_delta(double f){delta(f);} \
double c::_delta()const{return delta();} \
void c::_delta(double f, std::string const &u){delta(f, u);} \
double c::_delta(std::string const &u)const{return delta(u);} \
void c::_tMin(double f){tMin(f);} \
double c::_tMin()const{return tMin();} \
void c::_tMin(double f, std::string const &u){tMin(f, u);} \
double c::_tMin(std::string const &u)const{return tMin(u);} \
void c::_maxiter(size_t f){maxiter(f);} \
size_t c::_maxiter()const{return maxiter();} \
void c::_integrator(std::string const &f){integrator(f);} \
std::string c::_integrator() const {return integrator();} \
std::vector<double> c::_initCoord()const{return initCoord();} \
void c::_initCoord(std::vector<double> const &f){initCoord(f);} \
void c::_metric(SmartPointer<Metric::Generic>f){metric(f);} \
SmartPointer<Metric::Generic> c::_metric() const{return metric();}
#define GYOTO_WORLDLINE_PROPERTY_END(c, a) \
GYOTO_WORLDLINE_PROPERTIES(c) \
GYOTO_PROPERTY_END(c, a) \
GYOTO_WORLDLINE_ACCESSORS(c)
#define GYOTO_WORLDLINE \
void _delta(const double delta); \
void _delta(double, const std::string &unit); \
double _delta() const ; \
double _delta(const std::string &unit) const ; \
void _tMin(const double tmin); \
void _tMin(double, const std::string &unit); \
double _tMin() const ; \
double _tMin(const std::string &unit) const ; \
void _adaptive (bool mode) ; \
bool _adaptive () const ; \
void _secondary (bool sec) ; \
bool _secondary () const ; \
void _integ31 (bool sec) ; \
bool _integ31 () const ; \
void _parallelTransport (bool sec) ; \
bool _parallelTransport () const ; \
void _maxiter (size_t miter) ; \
size_t _maxiter () const ; \
void _integrator(std::string const & type); \
std::string _integrator() const ; \
double _deltaMin() const; \
void _deltaMin(double h1); \
void _absTol(double); \
double _absTol()const; \
void _maxCrossEqplane(double); \
double _maxCrossEqplane()const; \
void _relTol(double); \
double _relTol()const; \
void _deltaMax(double h1); \
double _deltaMax()const; \
double _deltaMaxOverR() const; \
void _deltaMaxOverR(double t); \
std::vector<double> _initCoord()const; \
void _initCoord(std::vector<double> const&f); \
void _metric(SmartPointer<Metric::Generic>); \
SmartPointer<Metric::Generic> _metric() const;
class Gyoto::Worldline
: protected Gyoto::Hook::Listener
{
// Data :
// -----
public:
int stopcond;
protected:
SmartPointer<Gyoto::Metric::Generic> metric_ ;
double* tau_;
double* x0_;
double* x1_;
double* x2_;
double* x3_;
double* x0dot_;
double* x1dot_;
double* x2dot_;
double* x3dot_;
double* ep0_;
double* ep1_;
double* ep2_;
double* ep3_;
double* et0_;
double* et1_;
double* et2_;
double* et3_;
size_t x_size_;
size_t imin_;
size_t i0_;
size_t imax_;
bool adaptive_;
bool secondary_;
bool parallel_transport_;
double delta_;
double tmin_;
double * cst_;
size_t cst_n_;
int wait_pos_;
double * init_vel_;
size_t maxiter_ ;
double delta_min_;
double delta_max_;
double delta_max_over_r_;
double abstol_;
double reltol_;
double maxCrossEqplane_;
// Constructors - Destructor
// -------------------------
public:
Worldline() ;
Worldline(const Worldline& ) ;
Worldline(Worldline* orig, size_t i0, int dir, double step_max) ;
virtual ~Worldline() ;
size_t getImin() const;
size_t getImax() const;
size_t getI0() const;
virtual double getMass() const = 0;
void metric(SmartPointer<Metric::Generic>);
SmartPointer<Metric::Generic> metric() const;
void initCoord(std::vector<double> const&);
std::vector<double> initCoord() const;
virtual void setInitCoord(const double coord[8], int dir,
double const Ephi[4],
double const Etheta[4]);
virtual void setInitCoord(const double coord[8], int dir = 0);
virtual void setInitCoord(double const pos[4], double const vel[3], int dir=0);
virtual void setPosition(double const pos[4]);
virtual void setVelocity(double const vel[3]);
void reset() ;
void reInit() ;
virtual std::string className() const ;
virtual std::string className_l() const ;
void integrator(std::string const & type);
std::string integrator() const ;
void integ31(bool integ);
bool integ31() const ;
double deltaMin() const;
void deltaMin(double h1);
double deltaMax() const;
void absTol(double);
double absTol()const;
void relTol(double);
double relTol()const;
void maxCrossEqplane(double);
double maxCrossEqplane()const;
virtual double deltaMax(double const pos[8], double delta_max_external) const;
void deltaMax(double h1);
double deltaMaxOverR() const;
void deltaMaxOverR(double t);
// Memory management
// -----------------
protected:
virtual void xAllocate();
virtual void xAllocate(size_t size);
virtual size_t xExpand(int dir);
virtual void xExpand(double * &x, int dir);
virtual void eAllocate ();
virtual void eDeallocate ();
virtual void eExpand(int dir);
// Mutators / assignment
// ---------------------
public:
void delta(const double delta);
void delta(double, const std::string &unit);
double delta() const ;
double delta(const std::string &unit) const ;
double tMin() const ;
double tMin(const std::string &unit) const ;
void tMin(double tlim);
void tMin(double, const std::string &unit);
void adaptive (bool mode) ;
bool adaptive () const ;
void secondary (bool sec) ;
bool secondary () const ;
void parallelTransport (bool pt) ;
bool parallelTransport () const ;
void maxiter (size_t miter) ;
size_t maxiter () const ;
double const * getCst() const ;
void setCst(double const * cst, size_t const ncsts) ;
void constantsOfMotion(std::vector<double> const cstv) ;
std::vector<double> constantsOfMotion() const ;
void setInitialCondition(SmartPointer<Metric::Generic> gg,
const double coord[8],
const int dir,
double const Ephi[4], double const Etheta[4]) ;
void setInitialCondition(SmartPointer<Metric::Generic> gg,
const double coord[8],
const int dir) ;
void getInitialCoord(std::vector<double> &dest) const;
void getCoord(size_t index, Gyoto::state_t &dest) const;
void getCoord(size_t index, Gyoto::state_t &dest) ;
void getCoord(double date, Gyoto::state_t &dest, bool proper=false);
void getCartesianPos(size_t index, double dest[4]) const;
virtual void xStore(size_t ind, state_t const &coord, double tau) ;
virtual void xStore(size_t ind, state_t const &coord) =delete;
virtual void xStore(size_t ind, double const coord[8]) = delete;
virtual void xFill(double tlim, bool proper=false) ;
// Accessors
// ---------
public:
size_t get_nelements() const;
void get_t(double *dest) const;
void get_tau(double *dest) const;
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) ;
void get_xyz(double* x, double *y, double *z) const;
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) ;
void getCoord(double *x0, double *x1, double *x2, double *x3) const ;
void checkPhiTheta(double coord[8]) const;
void getSkyPos(SmartPointer<Screen> screen, double *dalpha, double *ddellta, double *dD) const;
void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const ;
void get_prime(double *x1prime, double *x2prime, double *x3prime) const ;
// Outputs
// -------
public:
//virtual void sauve(FILE *) const ; ///< Save in a file
void save_txyz(char * fichierxyz) const ;
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);
protected:
virtual void tell(Gyoto::Hook::Teller*);
class IntegState {
public:
class Generic;
class Legacy;
#ifdef GYOTO_HAVE_BOOST_INTEGRATORS
class Boost;
#endif
};
SmartPointer<Worldline::IntegState::Generic> state_;
};
#ifndef GYOTO_SWIGIMPORTED
class Gyoto::Worldline::IntegState::Generic : public SmartPointee {
friend class Gyoto::SmartPointer<Gyoto::Worldline::IntegState::Generic>;
protected:
Worldline * line_;
// add 31 flag
bool integ_31_;
double delta_;
bool adaptive_;
bool parallel_transport_;
double norm_;
double normref_;
Gyoto::SmartPointer<Gyoto::Metric::Generic> gg_;
public:
Generic(Worldline *parent);
virtual ~Generic();
virtual Generic * clone(Worldline*newparent) const =0 ;
virtual void init(Worldline * line, const state_t &coord, const double delta);
virtual void init(Worldline * line, const double *coord, const double delta) = delete;
virtual void init();
virtual void checkNorm(double coord[8]);
virtual std::string kind()=0;
void integ31(bool integ);
bool integ31() const ;
virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0;
virtual int nextStep(double *coord, double h1max=GYOTO_DEFAULT_DELTA_MAX) = delete;
virtual void doStep(state_t const &coordin,
double step,
state_t &coordout)=0;
virtual void doStep(double const coordin[8],
double step,
double coordout[8]) = delete;
};
class Gyoto::Worldline::IntegState::Legacy : public Generic {
friend class Gyoto::SmartPointer<Gyoto::Worldline::IntegState::Legacy>;
private:
state_t coord_;
public:
Legacy(Worldline *parent);
Legacy * clone(Worldline*newparent) const ;
using Generic::init;
void init(Worldline * line, const state_t &coord, const double delta);
virtual std::string kind();
virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
virtual void doStep(state_t const &coordin,
double step,
state_t &coordout);
virtual ~Legacy();
};
#ifdef GYOTO_HAVE_BOOST_INTEGRATORS
class Gyoto::Worldline::IntegState::Boost : public Generic {
friend class Gyoto::SmartPointer<Gyoto::Worldline::IntegState::Boost>;
public:
enum Kind {runge_kutta_cash_karp54,
runge_kutta_fehlberg78,
runge_kutta_dopri5,
runge_kutta_cash_karp54_classic };
private:
Kind kind_;
typedef std::function<boost::numeric::odeint::controlled_step_result
(state_t&, double&, double&)> try_step_t;
typedef std::function<void(state_t&, double)> do_step_t;
typedef std::function<void(const state_t &/*x*/,
state_t & /*dxdt*/,
const double /* t*/ )> system_t;
try_step_t try_step_;
do_step_t do_step_;
public:
Boost(Worldline* parent, std::string type);
Boost(Worldline* parent, Kind type);
Boost * clone(Worldline* newparent) const ;
virtual ~Boost();
virtual void init();
virtual void init(Worldline * line, const state_t &coord, const double delta);
virtual int nextStep(state_t &coord, double &tau, double h1max=1e6);
virtual void doStep(state_t const &coordin,
double step,
state_t &coordout);
virtual std::string kind();
};
#endif
#endif
#endif
GyotoDefs.h
Gyoto ubiquitous macros and typedefs.
GyotoHooks.h
Tellers tell Listeners when they mutate.
GyotoMetric.h
Base class for metric description.
GyotoScreen.h
Description of the observer screen.
GyotoSmartPointer.h
Reference-counting pointers.
Gyoto::FactoryMessenger
Factory / SmartPointee::Subcontractor_t interface.
Definition GyotoFactoryMessenger.h:92
Gyoto::Hook::Listener
I might listen to a Teller.
Definition GyotoHooks.h:64
Gyoto::Hook::Teller
Listen to me and I'll warn you when I change.
Definition GyotoHooks.h:82
Gyoto::SmartPointer
Pointers performing reference counting.
Definition GyotoSmartPointer.h:135
Gyoto::Worldline::IntegState::Boost
Boost integrator.
Definition GyotoWorldline.h:1030
Gyoto::Worldline::IntegState::Boost::clone
Boost * clone(Worldline *newparent) const
Deep copy.
Gyoto::Worldline::IntegState::Boost::init
virtual void init(Worldline *line, const state_t &coord, const double delta)
Gyoto::Worldline::IntegState::Boost::Kind
Kind
Enum to represent the integrator flavour.
Definition GyotoWorldline.h:1036
Gyoto::Worldline::IntegState::Boost::Boost
Boost(Worldline *parent, std::string type)
Constructor.
Gyoto::Worldline::IntegState::Boost::nextStep
virtual int nextStep(state_t &coord, double &tau, double h1max=1e6)
Make one step.
Gyoto::Worldline::IntegState::Boost::init
virtual void init()
Cache whatever needs to be cached.
Gyoto::Worldline::IntegState::Boost::Boost
Boost(Worldline *parent, Kind type)
Constructor.
Gyoto::Worldline::IntegState::Boost::do_step_
do_step_t do_step_
Stepper used by the non-adaptive-step integrator.
Definition GyotoWorldline.h:1055
Gyoto::Worldline::IntegState::Boost::kind_
Kind kind_
Integrator flavour.
Definition GyotoWorldline.h:1042
Gyoto::Worldline::IntegState::Boost::doStep
virtual void doStep(state_t const &coordin, double step, state_t &coordout)
Make one step of exactly this size.
Gyoto::Worldline::IntegState::Boost::kind
virtual std::string kind()
Return the integrator kind.
Gyoto::Worldline::IntegState::Boost::try_step_
try_step_t try_step_
Stepper used by the adaptive-step integrator.
Definition GyotoWorldline.h:1052
Gyoto::Worldline::IntegState::Generic
Current state of a geodesic integration.
Definition GyotoWorldline.h:870
Gyoto::Worldline::IntegState::Generic::integ_31_
bool integ_31_
Whether to integrate the 3+1 equation of geodesics instead of the 4D one.
Definition GyotoWorldline.h:881
Gyoto::Worldline::IntegState::Generic::adaptive_
bool adaptive_
Whether to use an adaptive step.
Definition GyotoWorldline.h:883
Gyoto::Worldline::IntegState::Generic::delta_
double delta_
Integration step (current in case of adaptive_).
Definition GyotoWorldline.h:882
Gyoto::Worldline::IntegState::Generic::line_
Worldline * line_
Worldline that we are integrating.
Definition GyotoWorldline.h:879
Gyoto::Worldline::IntegState::Generic::gg_
Gyoto::SmartPointer< Gyoto::Metric::Generic > gg_
The Metric in this end of the Universe.
Definition GyotoWorldline.h:891
Gyoto::Worldline::IntegState::Generic::nextStep
virtual int nextStep(state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0
Make one step.
Gyoto::Worldline::IntegState::Generic::checkNorm
virtual void checkNorm(double coord[8])
Check norm.
Gyoto::Worldline::IntegState::Generic::normref_
double normref_
Definition GyotoWorldline.h:886
Gyoto::Worldline::IntegState::Generic::kind
virtual std::string kind()=0
Return the integrator kind.
Gyoto::Worldline::IntegState::Generic::integ31
void integ31(bool integ)
Defines the kind of geodesic equation to integrate (3+1, 4D).
Gyoto::Worldline::IntegState::Generic::doStep
virtual void doStep(state_t const &coordin, double step, state_t &coordout)=0
Make one step of exactly this size.
Gyoto::Worldline::IntegState::Generic::parallel_transport_
bool parallel_transport_
Whether to parallel-transport base vectors.
Definition GyotoWorldline.h:884
Gyoto::Worldline::IntegState::Generic::init
virtual void init(Worldline *line, const state_t &coord, const double delta)
Gyoto::Worldline::IntegState::Generic::Generic
Generic(Worldline *parent)
Normal constructor.
Gyoto::Worldline::IntegState::Generic::clone
virtual Generic * clone(Worldline *newparent) const =0
Deep copy.
Gyoto::Worldline::IntegState::Generic::norm_
double norm_
Current norm of the 4-velocity.
Definition GyotoWorldline.h:885
Gyoto::Worldline::IntegState::Legacy
Obsolete: Home-brewed integrator.
Definition GyotoWorldline.h:995
Gyoto::Worldline::IntegState::Legacy::doStep
virtual void doStep(state_t const &coordin, double step, state_t &coordout)
Make one step of exactly this size.
Gyoto::Worldline::IntegState::Legacy::nextStep
virtual int nextStep(state_t &coord, double &tau, double h1max=1e6)
Make one step.
Gyoto::Worldline::IntegState::Legacy::clone
Legacy * clone(Worldline *newparent) const
Deep copy.
Gyoto::Worldline::IntegState::Legacy::coord_
state_t coord_
Previously determined coordinate.
Definition GyotoWorldline.h:999
Gyoto::Worldline::IntegState::Legacy::init
void init(Worldline *line, const state_t &coord, const double delta)
Gyoto::Worldline::IntegState::Legacy::kind
virtual std::string kind()
Return the integrator kind.
Gyoto::Worldline::IntegState::Legacy::Legacy
Legacy(Worldline *parent)
Constructor.
Gyoto::Worldline::IntegState
Definition GyotoWorldline.h:849
Gyoto::Worldline
Timelike or null geodesics.
Definition GyotoWorldline.h:240
Gyoto::Worldline::et1_
double * et1_
Coordinate of Second base vector to parallel transport.
Definition GyotoWorldline.h:263
Gyoto::Worldline::integ31
void integ31(bool integ)
Set the integrator kind to 3+1 or 4D.
Gyoto::Worldline::~Worldline
virtual ~Worldline()
Destructor.
Gyoto::Worldline::x1_
double * x1_
r or x
Definition GyotoWorldline.h:251
Gyoto::Worldline::x1dot_
double * x1dot_
rdot or xdot
Definition GyotoWorldline.h:255
Gyoto::Worldline::x0dot_
double * x0dot_
tdot or Tdot
Definition GyotoWorldline.h:254
Gyoto::Worldline::getCoord
void getCoord(size_t index, Gyoto::state_t &dest)
Get coordinates+base vectors corresponding to index.
Gyoto::Worldline::reltol_
double reltol_
Absolute tolerance of the integrator.
Definition GyotoWorldline.h:359
Gyoto::Worldline::relTol
double relTol() const
Get reltol_.
Gyoto::Worldline::getI0
size_t getI0() const
Get i0_.
Gyoto::Worldline::eAllocate
virtual void eAllocate()
Allocate ep0_ ... et3_.
Gyoto::Worldline::adaptive
bool adaptive() const
Get adaptive_.
Gyoto::Worldline::className_l
virtual std::string className_l() const
"worldline"
Gyoto::Worldline::x3dot_
double * x3dot_
φdot or zdot
Definition GyotoWorldline.h:257
Gyoto::Worldline::setPosition
virtual void setPosition(double const pos[4])
Set initial 4-position.
Gyoto::Worldline::getCoord
void getCoord(double *x0, double *x1, double *x2, double *x3) const
Get all computed positions.
Gyoto::Worldline::xStore
virtual void xStore(size_t ind, state_t const &coord)=delete
Obsolete, update your code.
Gyoto::Worldline::delta
void delta(const double delta)
Expand memory slots for polarization vectors.
Gyoto::Worldline::delta
double delta(const std::string &unit) const
Get delta_ in specified units.
Gyoto::Worldline::getImax
size_t getImax() const
Get imax_.
Gyoto::Worldline::stopcond
int stopcond
Whether and why integration is finished.
Definition GyotoWorldline.h:245
Gyoto::Worldline::Worldline
Worldline(Worldline *orig, size_t i0, int dir, double step_max)
Refine constructor.
Gyoto::Worldline::maxCrossEqplane
double maxCrossEqplane() const
Get maxCrossEqplane_.
Gyoto::Worldline::eExpand
virtual void eExpand(int dir)
Gyoto::Worldline::Worldline
Worldline(const Worldline &)
Copy constructor.
Gyoto::Worldline::maxCrossEqplane
void maxCrossEqplane(double)
Set maxCrosEqplane_.
Gyoto::Worldline::et0_
double * et0_
Coordinate of first base vector to parallel transport.
Definition GyotoWorldline.h:262
Gyoto::Worldline::relTol
void relTol(double)
Set reltol_.
Gyoto::Worldline::tmin_
double tmin_
Time limit for the integration (geometrical units).
Definition GyotoWorldline.h:304
Gyoto::Worldline::state_
SmartPointer< Worldline::IntegState::Generic > state_
An object to hold the integration state.
Definition GyotoWorldline.h:862
Gyoto::Worldline::parallelTransport
void parallelTransport(bool pt)
Set parallel_transport_.
Gyoto::Worldline::setCst
void setCst(double const *cst, size_t const ncsts)
Set Metric-specific constants of motion.
Gyoto::Worldline::metric
SmartPointer< Metric::Generic > metric() const
Get metric.
Gyoto::Worldline::xAllocate
virtual void xAllocate()
Allocate x0, x1 etc. with default size.
Gyoto::Worldline::className
virtual std::string className() const
"Worldline"
Gyoto::Worldline::tMin
double tMin() const
Get tmin_.
Gyoto::Worldline::deltaMaxOverR
void deltaMaxOverR(double t)
Set delta_max_over_r_.
Gyoto::Worldline::getCartesian
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.
Gyoto::Worldline::integrator
void integrator(std::string const &type)
Set the integrator.
Gyoto::Worldline::ep1_
double * ep1_
Coordinate of first base vector to parallel transport.
Definition GyotoWorldline.h:259
Gyoto::Worldline::metric_
SmartPointer< Gyoto::Metric::Generic > metric_
The Gyoto::Metric in this part of the universe.
Definition GyotoWorldline.h:248
Gyoto::Worldline::secondary
void secondary(bool sec)
Set secondary_.
Gyoto::Worldline::maxiter
size_t maxiter() const
Get maxiter_.
Gyoto::Worldline::constantsOfMotion
void constantsOfMotion(std::vector< double > const cstv)
Set Metric-specific constants of motion.
Gyoto::Worldline::maxiter_
size_t maxiter_
Maximum number of iterations when integrating.
Definition GyotoWorldline.h:310
Gyoto::Worldline::getCoord
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.
Gyoto::Worldline::deltaMin
double deltaMin() const
Get delta_min_.
Gyoto::Worldline::xStore
virtual void xStore(size_t ind, double const coord[8])=delete
Obsolete, update your code.
Gyoto::Worldline::et2_
double * et2_
Coordinate of Second base vector to parallel transport.
Definition GyotoWorldline.h:264
Gyoto::Worldline::reInit
void reInit()
Reset and recompute particle properties.
Gyoto::Worldline::get_xyz
void get_xyz(double *x, double *y, double *z) const
Get 3-position in cartesian coordinates for computed dates.
Gyoto::Worldline::getMass
virtual double getMass() const =0
Get mass of particule.
Gyoto::Worldline::absTol
void absTol(double)
Set abstol_.
Gyoto::Worldline::x2_
double * x2_
θ or y
Definition GyotoWorldline.h:252
Gyoto::Worldline::integ31
bool integ31() const
Get the kind of geodesic equation integrated by state_.
Gyoto::Worldline::setInitCoord
virtual void setInitCoord(double const pos[4], double const vel[3], int dir=0)
Set initial coordinate.
Gyoto::Worldline::get_nelements
size_t get_nelements() const
Get number of computed dates.
Gyoto::Worldline::integrator
std::string integrator() const
Describe the integrator used by state_.
Gyoto::Worldline::getCartesianPos
void getCartesianPos(size_t index, double dest[4]) const
Get Cartesian expression of 4-position at index.
Gyoto::Worldline::adaptive
void adaptive(bool mode)
Set adaptive_.
Gyoto::Worldline::getCoord
void getCoord(double date, Gyoto::state_t &dest, bool proper=false)
Get coordinates+base vectors corresponding to date dest[0].
Gyoto::Worldline::tell
virtual void tell(Gyoto::Hook::Teller *)
This is how a Teller tells.
Gyoto::Worldline::i0_
size_t i0_
Index of initial condition in array.
Definition GyotoWorldline.h:268
Gyoto::Worldline::absTol
double absTol() const
Get abstol_.
Gyoto::Worldline::cst_n_
size_t cst_n_
Number of constants of motion.
Definition GyotoWorldline.h:307
Gyoto::Worldline::maxiter
void maxiter(size_t miter)
Set maxiter_.
Gyoto::Worldline::parallel_transport_
bool parallel_transport_
Whether to parallel transport a local triad.
Definition GyotoWorldline.h:285
Gyoto::Worldline::adaptive_
bool adaptive_
Whether integration should use adaptive delta.
Definition GyotoWorldline.h:270
Gyoto::Worldline::getCst
double const * getCst() const
Returns the worldline's cst of motion (if any).
Gyoto::Worldline::setInitCoord
virtual void setInitCoord(const double coord[8], int dir=0)
Set Initial coordinate.
Gyoto::Worldline::save_txyz
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.
Gyoto::Worldline::reset
void reset()
Forget integration, keeping initial contition.
Gyoto::Worldline::get_t
void get_t(double *dest) const
Get computed dates.
Gyoto::Worldline::delta_min_
double delta_min_
Minimum integration step for the adaptive integrator.
Definition GyotoWorldline.h:319
Gyoto::Worldline::secondary
bool secondary() const
Get secondary_.
Gyoto::Worldline::x3_
double * x3_
φ or z
Definition GyotoWorldline.h:253
Gyoto::Worldline::deltaMax
virtual double deltaMax(double const pos[8], double delta_max_external) const
Gyoto::Worldline::cst_
double * cst_
Worldline's csts of motion (if any).
Definition GyotoWorldline.h:306
Gyoto::Worldline::getCoord
void getCoord(size_t index, Gyoto::state_t &dest) const
Get coordinates+base vectors corresponding to index.
Gyoto::Worldline::delta
void delta(double, const std::string &unit)
Set delta_ in specified units.
Gyoto::Worldline::checkPhiTheta
void checkPhiTheta(double coord[8]) const
Bring θ in [0,Π] and φ in [0,2Π].
Gyoto::Worldline::deltaMax
double deltaMax() const
Get delta_max_.
Gyoto::Worldline::init_vel_
double * init_vel_
Hack in setParameters().
Definition GyotoWorldline.h:309
Gyoto::Worldline::xFill
virtual void xFill(double tlim, bool proper=false)
Fill x0, x1... by integrating the Worldline from previously set inittial condition to time tlim.
Gyoto::Worldline::metric
void metric(SmartPointer< Metric::Generic >)
Set metric Smartpointer.
Gyoto::Worldline::imax_
size_t imax_
Maximum index for which x0_, x1_... have been computed.
Definition GyotoWorldline.h:269
Gyoto::Worldline::get_dot
void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const
Get computed 4-velocities.
Gyoto::Worldline::imin_
size_t imin_
Minimum index for which x0_, x1_... have been computed.
Definition GyotoWorldline.h:267
Gyoto::Worldline::tMin
void tMin(double, const std::string &unit)
Set tmin_ in specified unit.
Gyoto::Worldline::tMin
void tMin(double tlim)
Set tmin_.
Gyoto::Worldline::getInitialCoord
void getInitialCoord(std::vector< double > &dest) const
Get initial coordinates + base vectors.
Gyoto::Worldline::xExpand
virtual size_t xExpand(int dir)
Expand x0, x1 etc... to hold more elements.
Gyoto::Worldline::x0_
double * x0_
t or T
Definition GyotoWorldline.h:250
Gyoto::Worldline::getImin
size_t getImin() const
Get imin_.
Gyoto::Worldline::xAllocate
virtual void xAllocate(size_t size)
Allocate x0, x1 etc. with a specified size.
Gyoto::Worldline::getSkyPos
void getSkyPos(SmartPointer< Screen > screen, double *dalpha, double *ddellta, double *dD) const
Get computed positions in sky coordinates.
Gyoto::Worldline::setInitCoord
virtual void setInitCoord(const double coord[8], int dir, double const Ephi[4], double const Etheta[4])
Set Initial coordinate.
Gyoto::Worldline::xExpand
virtual void xExpand(double *&x, int dir)
Expand one array to hold more elements.
Gyoto::Worldline::tMin
double tMin(const std::string &unit) const
Get tmin_ in specified unit.
Gyoto::Worldline::deltaMin
void deltaMin(double h1)
Set delta_min_.
Gyoto::Worldline::abstol_
double abstol_
Absolute tolerance of the integrator.
Definition GyotoWorldline.h:350
Gyoto::Worldline::delta_max_over_r_
double delta_max_over_r_
Numerical tuning parameter.
Definition GyotoWorldline.h:341
Gyoto::Worldline::eDeallocate
virtual void eDeallocate()
Deallocate ep0_ ... et3_.
Gyoto::Worldline::Worldline
Worldline()
Default constructor.
Gyoto::Worldline::wait_pos_
int wait_pos_
Hack in setParameters().
Definition GyotoWorldline.h:308
Gyoto::Worldline::deltaMax
void deltaMax(double h1)
Gyoto::Worldline::delta_max_
double delta_max_
Maximum integration step for the adaptive integrator.
Definition GyotoWorldline.h:328
Gyoto::Worldline::maxCrossEqplane_
double maxCrossEqplane_
Maximum number of crossings of equatorial plane.
Definition GyotoWorldline.h:367
Gyoto::Worldline::tau_
double * tau_
proper time or affine parameter
Definition GyotoWorldline.h:249
Gyoto::Worldline::ep2_
double * ep2_
Coordinate of first base vector to parallel transport.
Definition GyotoWorldline.h:260
Gyoto::Worldline::setInitialCondition
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.
Gyoto::Worldline::x_size_
size_t x_size_
Coordinate of Second base vector to parallel transport.
Definition GyotoWorldline.h:266
Gyoto::Worldline::deltaMaxOverR
double deltaMaxOverR() const
Get delta_max_over_r_.
Gyoto::Worldline::secondary_
bool secondary_
Experimental: choose 0 to compute only primary image.
Definition GyotoWorldline.h:277
Gyoto::Worldline::get_prime
void get_prime(double *x1prime, double *x2prime, double *x3prime) const
Get computed 3-velocities.
Gyoto::Worldline::setInitialCondition
void setInitialCondition(SmartPointer< Metric::Generic > gg, const double coord[8], const int dir)
Set or re-set the initial condition prior to integration.
Gyoto::Worldline::get_tau
void get_tau(double *dest) const
Get computed proper times or values of the affine parameter.
Gyoto::Worldline::save_txyz
void save_txyz(char *fichierxyz) const
Save in a file.
Gyoto::Worldline::ep3_
double * ep3_
Coordinate of first base vector to parallel transport.
Definition GyotoWorldline.h:261
Gyoto::Worldline::parallelTransport
bool parallelTransport() const
Get parallel_transport_.
Gyoto::Worldline::delta_
double delta_
Initial integrating step.
Definition GyotoWorldline.h:292
Gyoto::Worldline::setVelocity
virtual void setVelocity(double const vel[3])
Set initial 3-velocity.
Gyoto::Worldline::et3_
double * et3_
Coordinate of Second base vector to parallel transport.
Definition GyotoWorldline.h:265
Gyoto::Worldline::x2dot_
double * x2dot_
θdot or ydot
Definition GyotoWorldline.h:256
Gyoto::Worldline::constantsOfMotion
std::vector< double > constantsOfMotion() const
Return a copy of the Metric-specific constants of motion.
Gyoto::Worldline::xStore
virtual void xStore(size_t ind, state_t const &coord, double tau)
Store coord at index ind.
Gyoto::Worldline::delta
double delta() const
Get delta_.
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44