Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Evolve::StoppingCondition Class Referenceabstract

A base class for all stopping conditions. More...

#include <StoppingCondition.h>

+ Inheritance diagram for Evolve::StoppingCondition:
+ Collaboration diagram for Evolve::StoppingCondition:

Public Member Functions

 StoppingCondition (short expected_crossing_deriv_sign=0)
 Create a generic stopping condition. More...
 
virtual std::valarray< double > operator() (Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const =0
 The values of quantities which should cross zero when the condition(s) is(are) satisfied. More...
 
virtual size_t num_subconditions () const
 The number of subconditions in the current condition. More...
 
virtual StoppingConditionType type (unsigned index=0) const =0
 What event is the index-th stopping sub-condition associated with. More...
 
virtual void reached (short deriv_sign, unsigned index=0)
 Called when a stopping condition has been reached by the evolution. More...
 
virtual short expected_crossing_deriv_sign (unsigned index=0) const
 The expected sign of the derivative at the next zero-crossing. More...
 
virtual std::string describe (int index=-1) const =0
 Overwrite with something returning a description of what the stopping condition is monitoring. More...
 

Private Attributes

short __expected_crossing_deriv_sign
 The sign of the first derivative at the next zero-crossing of this condition. More...
 

Detailed Description

A base class for all stopping conditions.

A more detailed description of the stopping condition mechanism and why it is necessary are given in the Stopping Conditions section.

Definition at line 58 of file StoppingCondition.h.

Constructor & Destructor Documentation

◆ StoppingCondition()

Evolve::StoppingCondition::StoppingCondition ( short  expected_crossing_deriv_sign = 0)
inline

Create a generic stopping condition.

Definition at line 65 of file StoppingCondition.h.

Member Function Documentation

◆ describe()

virtual std::string Evolve::StoppingCondition::describe ( int  index = -1) const
pure virtual

◆ expected_crossing_deriv_sign()

virtual short Evolve::StoppingCondition::expected_crossing_deriv_sign ( unsigned  index = 0) const
inlinevirtual

The expected sign of the derivative at the next zero-crossing.

Zero if unknown.

Parameters
indexWhich sub-condition.

Reimplemented in Evolve::LagForcingFrequencyBreakCondition, Evolve::CombinedStoppingCondition, and Evolve::BreakLockCondition.

Definition at line 127 of file StoppingCondition.h.

◆ num_subconditions()

virtual size_t Evolve::StoppingCondition::num_subconditions ( ) const
inlinevirtual

The number of subconditions in the current condition.

Reimplemented in Evolve::LagForcingFrequencyBreakCondition, Evolve::CombinedStoppingCondition, and Evolve::BreakLockCondition.

Definition at line 95 of file StoppingCondition.h.

◆ operator()()

virtual std::valarray<double> Evolve::StoppingCondition::operator() ( Core::EvolModeType  evol_mode,
const std::valarray< double > &  orbit,
const std::valarray< double > &  derivatives,
std::valarray< double > &  stop_deriv 
) const
pure virtual

The values of quantities which should cross zero when the condition(s) is(are) satisfied.

The input stellar system must already have its age set.

Parameters
evol_modeThe evolution mode for which the orbit and derivatives are given. For some conditions some EvolModeType values will not make sense and will result in an exception.
orbitThe variables which are currently being evolved. The content depends on the evol_mode argument.
derivativesThe rate of change of the entries in orbit per the relevant system of differential equations.
stop_derivOn output contains the rate of change of the stopping sub-conditions if known, or NaN if not.

Implemented in Evolve::NoStopCondition, Evolve::CombinedStoppingCondition, Evolve::LagForcingFrequencyBreakCondition, Evolve::SynchronizedCondition, Evolve::BreakLockCondition, Star::WindSaturationCondition, Evolve::SecondaryDeathCondition, and Evolve::RotFastCondition.

◆ reached()

virtual void Evolve::StoppingCondition::reached ( short  deriv_sign,
unsigned  index = 0 
)
inlinevirtual

Called when a stopping condition has been reached by the evolution.

Should perform any necessary changes to the further evolution (e.g. switch wind saturation state or check if a spin-orbit lock can be held and lock it if so etc.).

Parameters
deriv_signThe sign of the first derivative when the condition was reached.
indexThe sub-condition reached for composite conditions.

Reimplemented in Evolve::NoStopCondition, Evolve::CombinedStoppingCondition, Evolve::LagForcingFrequencyBreakCondition, Evolve::SynchronizedCondition, Evolve::BreakLockCondition, Star::WindSaturationCondition, and Evolve::SecondaryDeathCondition.

Definition at line 106 of file StoppingCondition.h.

◆ type()

virtual StoppingConditionType Evolve::StoppingCondition::type ( unsigned  index = 0) const
pure virtual

Member Data Documentation

◆ __expected_crossing_deriv_sign

short Evolve::StoppingCondition::__expected_crossing_deriv_sign
private

The sign of the first derivative at the next zero-crossing of this condition.

Definition at line 62 of file StoppingCondition.h.


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