Magi Integrator

template<unsigned int order, UpdateType step>
class QDynamics::Magi : public QDynamics::Integrator

Subclassed by QDynamics::Symi< order, step >

Public Functions

inline Magi(double T, double deltaT, int resolution)

Constructor, as per Integrator::Integrator(double,double). All arguments except resolution are used to build the parent class.

Parameters
  • T – The total duration of the integration

  • deltaT – the width of timesteps used

  • resolution – The number of points to used whenever a numerical integral is required.

inline Magi(double T, double deltaT, int resolution, int skipper)

Constructor, as per Integrator::Integrator(double,double,int)

Parameters
  • T – The total duration of the integration

  • deltaT – the width of timesteps used

  • resolution – The number of points to used whenever a numerical integral is required.

  • skipper – The number of epochs which pass in between updates to the progess Integrator::Buffer

Protected Functions

inline virtual void UpdatePosition(double t)

An override of the generic Integrator::UpdatePosition(). Depending on the value of Magi::StepMode, calls an appropriate function. The intent is that as Magi::StepMode is a template value, logic of which function is called is determined at compile time, without additional overhead.

Parameters

t – The current time, used by Integrator::GradU()

inline void Brute_Update(double t)

The function called by UpdatePosition() if StepMode == Brute. See QDynamics::UpdateType for more information.

Parameters

t – The current time

inline void Euler_Update(double t)

The function called by UpdatePosition() if StepMode == Euler. See QDynamics::UpdateType for more information.

Parameters

t – The current time

inline void Leapfrog_Update(double t)

The function called by UpdatePosition() if StepMode == Leapfrog. See QDynamics::UpdateType for more information.

Parameters

t – The current time

inline virtual Quaternion Magnus(double duration)

Generates an estimate of the Magnus series for torque-free drift over the provided duration, given the current value of the angular momentum, Integrator::L. The duration of this compuation is determined by Magi::Order (which determines how many terms are included) and by Magi::Resolution (which determines the accuracy with which each term is computed).

Parameters

duration – The length of the torque-free drift to be computed

Protected Attributes

const unsigned int Order = order

The first template argument passed to a Magi object. Determines the order of the computation in the Magnus() calculation.

const UpdateType StepMode = step

The second template argument passed to a Magi object. Determines the update formula used.

const int Resolution

As per the assignation in Magi(), this is the number of points to used whenever a numerical integral is required.

Private Functions

inline virtual void MakeName()

Generates a print-and-filename-friendly name depending on the properties of the integrator.