A base class for all stopping conditions. More...
#include <StoppingCondition.h>
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... | |
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.
|
inline |
Create a generic stopping condition.
Definition at line 65 of file StoppingCondition.h.
|
pure virtual |
Overwrite with something returning a description of what the stopping condition is monitoring.
Implemented in Evolve::LagForcingFrequencyBreakCondition, Evolve::CombinedStoppingCondition, Evolve::SynchronizedCondition, Evolve::BreakLockCondition, Star::WindSaturationCondition, Evolve::SecondaryDeathCondition, and Evolve::RotFastCondition.
|
inlinevirtual |
The expected sign of the derivative at the next zero-crossing.
Zero if unknown.
index | Which sub-condition. |
Reimplemented in Evolve::LagForcingFrequencyBreakCondition, Evolve::CombinedStoppingCondition, and Evolve::BreakLockCondition.
Definition at line 127 of file StoppingCondition.h.
|
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.
|
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.
evol_mode | The 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. |
orbit | The variables which are currently being evolved. The content depends on the evol_mode argument. |
derivatives | The rate of change of the entries in orbit per the relevant system of differential equations. |
stop_deriv | On 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.
|
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.).
deriv_sign | The sign of the first derivative when the condition was reached. |
index | The 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.
|
pure virtual |
What event is the index-th stopping sub-condition associated with.
Implemented in Evolve::ExternalStoppingCondition, Evolve::NoStopCondition, Evolve::LagForcingFrequencyBreakCondition, Evolve::CombinedStoppingCondition, Evolve::SynchronizedCondition, Evolve::BreakLockCondition, Star::WindSaturationCondition, and Evolve::SecondaryDeathCondition.
|
private |
The sign of the first derivative at the next zero-crossing of this condition.
Definition at line 62 of file StoppingCondition.h.