Gyoto
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Gyoto::Worldline::IntegState::Generic Class Referenceabstract

Current state of a geodesic integration. More...

#include <GyotoWorldline.h>

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

Public Types

typedef Gyoto::SmartPointer< Gyoto::SmartPointeeSubcontractor_t(Gyoto::FactoryMessenger *, std::vector< std::string > const &)
 A subcontractor builds an object upon order from the Factory. More...
 

Public Member Functions

 Generic (Worldline *parent)
 Normal constructor. More...
 
virtual ~Generic ()
 Virtual destructor.
 
virtual Genericclone (Worldline *newparent) const =0
 Deep copy. More...
 
virtual void init (Worldline *line, const state_t &coord, const double delta)
 
virtual void init (Worldline *line, const double *coord, const double delta)=delete
 Obsolete, update your code.
 
virtual void init ()
 Cache whatever needs to be cached. More...
 
virtual void checkNorm (double coord[8])
 Check norm. More...
 
virtual std::string kind ()=0
 Return the integrator kind.
 
void integ31 (bool integ)
 Defines the kind of geodesic equation to integrate (3+1, 4D)
 
bool integ31 () const
 
virtual int nextStep (state_t &coord, double &tau, double h1max=GYOTO_DEFAULT_DELTA_MAX)=0
 Make one step. More...
 
virtual int nextStep (double *coord, double h1max=GYOTO_DEFAULT_DELTA_MAX)=delete
 Obsolete, update your code.
 
virtual void doStep (state_t const &coordin, double step, state_t &coordout)=0
 Make one step of exactly this size. More...
 
virtual void doStep (double const coordin[8], double step, double coordout[8])=delete
 Obsolete, update your code.
 
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...
 
bool integ_31_
 Whether to integrate the 3+1 equation of geodesics instead of the 4D one.
 
double delta_
 Integration step (current in case of adaptive_).
 
bool adaptive_
 Whether to use an adaptive step.
 
bool parallel_transport_
 Whether to parallel-transport base vectors.
 
double norm_
 Current norm of the 4-velocity.
 
double normref_
 
Gyoto::SmartPointer< Gyoto::Metric::Genericgg_
 The Metric in this end of the Universe. More...
 

Friends

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

Detailed Description

Current state of a geodesic integration.

Member Typedef Documentation

◆ Subcontractor_t

typedef Gyoto::SmartPointer<Gyoto::SmartPointee> Gyoto::SmartPointee::Subcontractor_t(Gyoto::FactoryMessenger *, std::vector< std::string > const &)
inherited

A subcontractor builds an object upon order from the Factory.

Various classes need to provide a subcontractor to be able to instantiate 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

◆ Generic()

Gyoto::Worldline::IntegState::Generic::Generic ( Worldline parent)

Normal constructor.

Sets line_

Member Function Documentation

◆ checkNorm()

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

Check norm.

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

◆ clone()

virtual Generic* Gyoto::Worldline::IntegState::Generic::clone ( Worldline newparent) const
pure virtual

Deep copy.

Derived classes must implement it

Implemented in Gyoto::Worldline::IntegState::Boost, and Gyoto::Worldline::IntegState::Legacy.

◆ doStep()

virtual void Gyoto::Worldline::IntegState::Generic::doStep ( state_t const &  coordin,
double  step,
state_t &  coordout 
)
pure 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;

Implemented in Gyoto::Worldline::IntegState::Boost, and Gyoto::Worldline::IntegState::Legacy.

◆ init() [1/2]

virtual void Gyoto::Worldline::IntegState::Generic::init ( Worldline line,
const state_t &  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 in Gyoto::Worldline::IntegState::Boost, and Gyoto::Worldline::IntegState::Legacy.

◆ init() [2/2]

virtual void Gyoto::Worldline::IntegState::Generic::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 in Gyoto::Worldline::IntegState::Boost.

◆ nextStep()

virtual int Gyoto::Worldline::IntegState::Generic::nextStep ( state_t &  coord,
double &  tau,
double  h1max = GYOTO_DEFAULT_DELTA_MAX 
)
pure virtual

Make one step.

Parameters
[out]coordNext position-velocity;
[out]tauNext proper time or affine parameter
[in]h1maxmaximum step in case of adaptive integration

Implemented in Gyoto::Worldline::IntegState::Boost, and Gyoto::Worldline::IntegState::Legacy.

Member Data Documentation

◆ gg_

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

The Metric in this end of the Universe.

Taken from Worldline::line_, never updated.

◆ line_

Worldline* Gyoto::Worldline::IntegState::Generic::line_
protected

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_
protected

Initial norm of the 4-velocity.


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