Gyoto
Public Types | Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Gyoto::Worldline::IntegState::Boost Class Reference

Boost integrator. More...

#include <GyotoWorldline.h>

Inheritance diagram for Gyoto::Worldline::IntegState::Boost:
Gyoto::Worldline::IntegState::Generic Gyoto::SmartPointee

Public Types

enum  Kind { runge_kutta_cash_karp54, runge_kutta_fehlberg78, runge_kutta_dopri5, runge_kutta_cash_karp54_classic }
 Enum to represent the integrator flavour.
 
typedef Gyoto::SmartPointer< Gyoto::SmartPointeeSubcontractor_t(Gyoto::FactoryMessenger *)
 A subcontractor builds an object upon order from the Factory. More...
 

Public Member Functions

 Boost (Worldline *parent, std::string type)
 Constructor. More...
 
 Boost (Worldline *parent, Kind type)
 Constructor. More...
 
Boostclone (Worldline *newparent) const
 Deep copy. More...
 
virtual void init ()
 Cache whatever needs to be cached. More...
 
virtual void init (Worldline *line, const double *coord, const double delta)
 
virtual int nextStep (double *coord, double h1max=1e6)
 Make one step. More...
 
virtual void doStep (double const coordin[8], double step, double coordout[8])
 Make one step of exactly this size. More...
 
virtual std::string kind ()
 Return the integrator kind.
 
virtual void checkNorm (double coord[8])
 Check norm. More...
 
void incRefCount ()
 Increment the reference counter. Warning: Don't mess with the counter.
 
int decRefCount ()
 Decrement the reference counter and return current value. Warning: Don't mess with the counter.
 
int getRefCount ()
 Get the current number of references.
 

Protected Attributes

Worldlineline_
 Worldline that we are integrating. More...
 
double delta_
 Integration step (current in case of adaptive_).
 
bool adaptive_
 Whether to use an adaptive step.
 
double norm_
 Current norm of the 4-velocity.
 
double normref_
 
Gyoto::SmartPointer< Gyoto::Metric::Genericgg_
 The Metric in this end of the Universe. More...
 

Private Attributes

Kind kind_
 Integrator flavour.
 
std::function< boost::numeric::odeint::controlled_step_result(std::array< double, 8 > &, double &, double &)> try_step_
 Stepper used by the adaptive-step integrator.
 
std::function< void(std::array< double, 8 > &, double)> do_step_
 Stepper used by the non-adaptive-step integrator.
 

Friends

class Gyoto::SmartPointer< Gyoto::Worldline::IntegState::Boost >
 

Detailed Description

Boost integrator.

This Worldline::IntegState::Generic implementation provides several integrators from the boost::numeric::odeint library. To select it, pass one of "runge_kutta_cash_karp54", "runge_kutta_fehlberg78", "runge_kutta_dopri5", or "runge_kutta_cash_karp54_classic" to Worldline::integrator(std::string type).

Member Typedef Documentation

§ Subcontractor_t

typedef Gyoto::SmartPointer<Gyoto::SmartPointee> Gyoto::SmartPointee::Subcontractor_t(Gyoto::FactoryMessenger *)
inherited

A subcontractor builds an object upon order from the Factory.

Various classes need to provide a subcontractor to be able to instanciate themselves upon order from the Factory. A subcontractor is a function (often a static member function) which accepts a pointer to a FactoryMessenger as unique parameter, communicates with the Factory using this messenger to read an XML description of the object to build, and returns this objet. SmartPointee::Subcontractor_t* is just generic enough a typedef to cast to and from other subcontractor types: Astrobj::Subcontractor_t, Metric::Subcontractor_t, Spectrum::Subcontractor_t. A subcontractor needs to be registered using the relevant Register() function: Astrobj::Register(), Metric::Register(), Spectrum::Register().

Constructor & Destructor Documentation

§ Boost() [1/2]

Gyoto::Worldline::IntegState::Boost::Boost ( Worldline parent,
std::string  type 
)

Constructor.

Since this IntegState::Generic implementation can actually be used to implement several distinct integrators, it is necessary to specify which one is meant.

§ Boost() [2/2]

Gyoto::Worldline::IntegState::Boost::Boost ( Worldline parent,
Kind  type 
)

Constructor.

Since this IntegState::Generic implementation can actually be used to implement several distinct integrators, it is necessary to specify which one is meant.

Member Function Documentation

§ checkNorm()

virtual void Gyoto::Worldline::IntegState::Generic::checkNorm ( double  coord[8])
virtualinherited

Check norm.

Issue a warning using GYOTO_SEVERE if norm is drifting. nextStep() implementations should call it.

§ clone()

Boost* Gyoto::Worldline::IntegState::Boost::clone ( Worldline newparent) const
virtual

Deep copy.

Derived classes must implement it

Implements Gyoto::Worldline::IntegState::Generic.

§ doStep()

virtual void Gyoto::Worldline::IntegState::Boost::doStep ( double const  coordin[8],
double  step,
double  coordout[8] 
)
virtual

Make one step of exactly this size.

doStep() is meant to refine a computation made using nextStep(). In particular, there is no checking for norm conservation.

Parameters
[in]coordincurrent position-velocity;
[in]stepexact step to use.
[out]coordoutnext position-velocity;

Implements Gyoto::Worldline::IntegState::Generic.

§ init() [1/2]

virtual void Gyoto::Worldline::IntegState::Boost::init ( )
virtual

Cache whatever needs to be cached.

This is called by all the methods in Worldline each time an member that could be cached in Worldline::state_ changes. Therefore, user code should normally not have to call it.

Reimplemented from Gyoto::Worldline::IntegState::Generic.

§ init() [2/2]

virtual void Gyoto::Worldline::IntegState::Boost::init ( Worldline line,
const double *  coord,
const double  delta 
)
virtual
Parameters
lineThe Worldline that we are integrating. Sets: Worldline::line_, Worldline::gg_, Worldline::adaptive_.
coordInitial coordinate.
deltaIntegration step. Sign determines direction.

Reimplemented from Gyoto::Worldline::IntegState::Generic.

§ nextStep()

virtual int Gyoto::Worldline::IntegState::Boost::nextStep ( double *  coord,
double  h1max = 1e6 
)
virtual

Make one step.

Parameters
[out]coordNext position-velocity;
[in]h1maxmaximum step in case of adaptive integration

Implements Gyoto::Worldline::IntegState::Generic.

Member Data Documentation

§ gg_

Gyoto::SmartPointer<Gyoto::Metric::Generic> Gyoto::Worldline::IntegState::Generic::gg_
protectedinherited

The Metric in this end of the Universe.

Taken from Worldline::line_, never updated.

§ line_

Worldline* Gyoto::Worldline::IntegState::Generic::line_
protectedinherited

Worldline that we are integrating.

Beware this is not a SmartPointer. Make sure line_ still exists when calling nestStep().

§ normref_

double Gyoto::Worldline::IntegState::Generic::normref_
protectedinherited

Initial norm of the 4-velocity.


The documentation for this class was generated from the following file: