25 #ifndef __GyotoWorldline_H_
26 #define __GyotoWorldline_H_
35 class FactoryMessenger;
117 size_t getI0()
const;
119 virtual double getMass()
const = 0;
122 virtual void setInitCoord(
const double coord[8],
int dir = 0);
131 virtual void setInitCoord(
double pos[4],
double vel[3],
int dir=1);
174 void setDelta(
double,
const std::string &unit);
176 double getDelta(
const std::string &unit)
const ;
188 double const *
getCst()
const ;
195 void setCst(
double const * cst,
size_t const ncsts) ;
206 const double coord[8],
210 void getCoord(
size_t index,
double dest[8])
const;
213 void xFill(
double tlim) ;
241 #ifdef GYOTO_USE_XERCES
268 void get_t(
double *dest)
const;
288 void getCartesian(
double const *
const dates,
size_t const n_dates,
289 double *
const x,
double *
const y,
290 double *
const z,
double *
const xprime=NULL,
291 double *
const yprime=NULL,
double *
const zprime=NULL) ;
296 void get_xyz(
double* x,
double *y,
double *z)
const;
317 void getCoord(
double const *
const dates,
size_t const n_dates,
318 double *
const x1dest,
319 double *
const x2dest,
double *
const x3dest,
320 double *
const x0dot=NULL,
double *
const x1dot=NULL,
321 double *
const x2dot=NULL,
double *
const x3dot=NULL) ;
329 void getCoord(
double *x0,
double *x1,
double *x2,
double *x3)
const ;
349 void get_dot(
double *x0dot,
double *x1dot,
double *x2dot,
double *x3dot)
const ;
354 void get_prime(
double *x1prime,
double *x2prime,
double *x3prime)
const ;
360 void save_txyz(
char * fichierxyz)
const ;
361 void save_txyz(
char*
const filename,
double const t1,
double const mass_sun,
414 IntegState(Worldline * line, const double *coord, const double delta);
420 virtual int
nextStep(double *coord);
size_t get_nelements() const
Get number of computed dates.
Worldline * line_
Worldline that we are integrating.
Definition: GyotoWorldline.h:387
double * init_vel_
Hack in setParameters()
Definition: GyotoWorldline.h:86
virtual int nextStep(double *coord)
Make one step.
size_t maxiter() const
Get maxiter_.
void getInitialCoord(double dest[8]) const
Get initial coordinate.
void reset()
Forget integration, keeping initial contition.
double coord_[8]
Previously determined coordinate.
Definition: GyotoWorldline.h:395
void get_dot(double *x0dot, double *x1dot, double *x2dot, double *x3dot) const
Get computed 4-velocities.
Timelike or null geodesics.
Definition: GyotoWorldline.h:60
SmartPointer< Gyoto::Metric::Generic > metric_
The Gyoto::Metric in this part of the universe.
Definition: GyotoWorldline.h:67
double delta_
Initial integrating step ; defaults to 0.01.
Definition: GyotoWorldline.h:81
double const * getCst() const
Returns the worldline's cst of motion (if any)
void setTmin(double tlim)
Set tmin to a given value.
size_t getImin() const
Get index of computed date furthest in the past.
Tellers tell Listeners when they mutate.
Reference-counting pointers.
void get_t(double *dest) const
Get computed dates.
virtual int setParameter(std::string name, std::string content, std::string unit)
Set parameter by name.
double delta_
Integration step (current in case of adaptive).
Definition: GyotoWorldline.h:398
void reInit()
Reset and recompute particle properties.
double tmin_
Minimum time for integration, stop integration if t<tmin ; defaults to -DBL_MAX.
Definition: GyotoWorldline.h:82
bool adaptive_
Whether Worldline::delta_ is adaptive.
Definition: GyotoWorldline.h:404
double normref_
Initial norm of the 4-velocity.
Definition: GyotoWorldline.h:397
double getDelta() const
Get delta.
Factory / SmartPointee::Subcontractor_t interface.
Definition: GyotoFactoryMessenger.h:91
void xFill(double tlim)
Fill x0, x1... by integrating the Worldline from previously set inittial condition to time tlim...
size_t xExpand(int dir)
Expand x0, x1 etc... to hold more elements.
double * cst_
Worldline's csts of motion (if any)
Definition: GyotoWorldline.h:83
friend std::ostream & operator<<(std::ostream &, const Worldline &)
Display.
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 void tell(Gyoto::Hook::Teller *)
This is how a Teller tells.
void getSkyPos(SmartPointer< Screen > screen, double *dalpha, double *ddellta, double *dD) const
Get computed positions in sky coordinates.
void checkPhiTheta(double coord[8]) const
Bring θ in [0,Π] and φ in [0,2Π].
virtual std::string className() const
"Worldline"
size_t i0_
Index of initial condition in array.
Definition: GyotoWorldline.h:78
Gyoto ubiquitous macros and typedefs.
void setInitialCondition(SmartPointer< Metric::Generic > gg, const double coord[8], const int dir)
Set or re-set the initial condition prior to integration.
Base class for metric description.
void save_txyz(char *fichierxyz) const
Save in a file.
size_t x_size_
Size of x0, x1... arrays.
Definition: GyotoWorldline.h:76
double * x0_
t or T
Definition: GyotoWorldline.h:68
bool adaptive_
Whether integration should use adaptive delta.
Definition: GyotoWorldline.h:80
double * x2_
theta or y
Definition: GyotoWorldline.h:70
double * x3dot_
phidot or zdot
Definition: GyotoWorldline.h:75
void setMetric(SmartPointer< Metric::Generic >)
Set metric Smartpointer.
double * x0dot_
tdot or Tdot
Definition: GyotoWorldline.h:72
Current state of a geodesic integration.
Definition: GyotoWorldline.h:378
void setDelta(const double delta)
Set delta.
virtual double getMass() const =0
Get mass of particule.
double getTmin() const
Get tmin value.
size_t getI0() const
Get index of initial condition.
virtual void setParameters(FactoryMessenger *fmp)
Process XML entity Uses wait_pos_ and init_vel_ to make sure setVelocity() is called after setPositio...
Can be pointed to by a SmartPointer.
Definition: GyotoSmartPointer.h:79
I might listen to a Teller.
Definition: GyotoHooks.h:64
SmartPointer< Metric::Generic > getMetric() const
Get metric.
virtual ~Worldline()
Destructor.
double * x3_
phi or z
Definition: GyotoWorldline.h:71
void get_xyz(double *x, double *y, double *z) const
Get 3-position in cartesian coordinates for computed dates.
void get_prime(double *x1prime, double *x2prime, double *x3prime) const
Get computed 3-velocities.
size_t cst_n_
Number of constants of motion.
Definition: GyotoWorldline.h:84
size_t imin_
Minimum index for which x0, x1... have been computed.
Definition: GyotoWorldline.h:77
double * x1dot_
rdot or xdot
Definition: GyotoWorldline.h:73
void getCartesianPos(size_t index, double dest[4]) const
Get Cartesian expression of 4-position at index.
size_t getImax() const
Get index of computed date furthest in the future.
Description of the observer screen.
double norm_
Current norm of the 4-velocity.
Definition: GyotoWorldline.h:396
virtual void setInitCoord(const double coord[8], int dir=0)
Set Initial coordinate.
void operator=(const Worldline &)
Assignment to another Worldline.
Gyoto::SmartPointer< Gyoto::Metric::Generic > gg_
The Metric in this end of the Universe.
Definition: GyotoWorldline.h:393
virtual std::string className_l() const
"worldline"
int wait_pos_
Hack in setParameters()
Definition: GyotoWorldline.h:85
bool adaptive() const
Get adaptive_.
double * x2dot_
thetadot or ydot
Definition: GyotoWorldline.h:74
void getCoord(size_t index, double dest[8]) const
Get coordinates corresponding to index.
Listen to me and I'll warn you when I change.
Definition: GyotoHooks.h:82
virtual void fillElement(FactoryMessenger *fmp) const
XML output.
virtual void setPosition(double pos[4])
Set initial 4-position.
double * x1_
r or x
Definition: GyotoWorldline.h:69
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:87
void xAllocate()
Allocate x0, x1 etc. with default size.
Worldline()
Default constructor.
virtual void setVelocity(double vel[3])
Set initial 3-velocity.
size_t imax_
Maximum index for which x0, x1... have been computed.
Definition: GyotoWorldline.h:79