Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
Evolve::CombinedStoppingCondition Class Reference

A class combining the the outputs of multiple stopping conditions. More...

#include <CombinedStoppingCondition.h>

+ Inheritance diagram for Evolve::CombinedStoppingCondition:
+ Collaboration diagram for Evolve::CombinedStoppingCondition:

Public Member Functions

 CombinedStoppingCondition ()
 Create an empty stopping condition (identical to NoStopCondition). More...
 
CombinedStoppingConditionoperator|= (CombinedStoppingCondition &rhs)
 Adds the conditions in RHS to the conditions of *this. More...
 
CombinedStoppingConditionoperator|= (StoppingCondition *rhs)
 Adds RHS to the conditions of *this. More...
 
std::valarray< double > operator() (Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const
 Returns the values of all stopping sub_conditions, not necessarily in the order added. More...
 
void no_delete_subcond ()
 Disables the destruction of the subconditions when *this is destroyed. More...
 
virtual size_t num_subconditions () const
 The number of subconditions in the current condition. More...
 
StoppingConditionType type (unsigned index=0) const
 What event is the index-th stopping sub-condition associated with. More...
 
virtual void reached (short deriv_sign, unsigned index=0)
 See StoppingCondition::reached(). More...
 
short expected_crossing_deriv_sign (unsigned index=0) const
 See StoppingCondition::expected_crossing_deriv_sign(). More...
 
virtual std::string describe (int index) const
 See StoppingCondition::describe(). More...
 
 ~CombinedStoppingCondition ()
 Deletes all subconditions, unless no_delete_subcond has been previously called. More...
 
- Public Member Functions inherited from Evolve::StoppingCondition
 StoppingCondition (short expected_crossing_deriv_sign=0)
 Create a generic stopping condition. More...
 

Private Member Functions

void update_meta_information (const StoppingCondition *rhs)
 
void add_subcondition_values (const StoppingCondition *cond, Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, size_t &first_index, std::valarray< double > &values, std::valarray< double > &derivs) const
 Adds the values of the given sub-condition to the given array. More...
 
std::vector< StoppingCondition * >::const_iterator find_condition (unsigned &index) const
 Finds the condition corresponding to the given index and modifies the index to be the index within the given condition. More...
 
std::vector< StoppingCondition * >::iterator find_condition (unsigned &index)
 Finds the condition corresponding to the given index and modifies the index to be the index within the given condition. More...
 

Private Attributes

std::vector< StoppingCondition * > __sub_conditions
 The conditions that are combined. More...
 
unsigned __num_subconditions
 The number of subconditinos included, allowing for subconditions with multiple entries. More...
 
bool __delete_subcond
 Whether to delete the sub-conditions then *this is destroyed. More...
 
std::vector< StoppingConditionType__types
 The types of the subconditinos, including subconditions of subconditions. More...
 

Detailed Description

A class combining the the outputs of multiple stopping conditions.

Definition at line 21 of file CombinedStoppingCondition.h.

Constructor & Destructor Documentation

◆ CombinedStoppingCondition()

Evolve::CombinedStoppingCondition::CombinedStoppingCondition ( )
inline

Create an empty stopping condition (identical to NoStopCondition).

Definition at line 78 of file CombinedStoppingCondition.h.

◆ ~CombinedStoppingCondition()

Evolve::CombinedStoppingCondition::~CombinedStoppingCondition ( )

Deletes all subconditions, unless no_delete_subcond has been previously called.

Definition at line 142 of file CombinedStoppingCondition.cpp.

Member Function Documentation

◆ add_subcondition_values()

void Evolve::CombinedStoppingCondition::add_subcondition_values ( const StoppingCondition cond,
Core::EvolModeType  evol_mode,
const std::valarray< double > &  orbit,
const std::valarray< double > &  derivatives,
size_t &  first_index,
std::valarray< double > &  values,
std::valarray< double > &  derivs 
) const
private

Adds the values of the given sub-condition to the given array.

Parameters
condThe stopping condition to process.
evol_modeSee operator()
orbitSee operator()
derivativesSee operator()
first_indexThe index in the values and derivs arrays where to start inserting. On output it is updated to the position immediately after the last insert.
valuesAn array to overwrite with the sub-condition values.
derivsAn array to overwrite with the sub-condition derivatives.

Definition at line 17 of file CombinedStoppingCondition.cpp.

◆ describe()

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

◆ expected_crossing_deriv_sign()

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

◆ find_condition() [1/2]

std::vector< StoppingCondition * >::const_iterator Evolve::CombinedStoppingCondition::find_condition ( unsigned &  index) const
private

Finds the condition corresponding to the given index and modifies the index to be the index within the given condition.

Definition at line 37 of file CombinedStoppingCondition.cpp.

◆ find_condition() [2/2]

std::vector< StoppingCondition * >::iterator Evolve::CombinedStoppingCondition::find_condition ( unsigned &  index)
private

Finds the condition corresponding to the given index and modifies the index to be the index within the given condition.

Definition at line 50 of file CombinedStoppingCondition.cpp.

◆ no_delete_subcond()

void Evolve::CombinedStoppingCondition::no_delete_subcond ( )
inline

Disables the destruction of the subconditions when *this is destroyed.

Definition at line 99 of file CombinedStoppingCondition.h.

◆ num_subconditions()

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

The number of subconditions in the current condition.

Reimplemented from Evolve::StoppingCondition.

Definition at line 101 of file CombinedStoppingCondition.h.

◆ operator()()

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

Returns the values of all stopping sub_conditions, not necessarily in the order added.

See StoppingCondition::operator()() for a description of the arguments.

Implements Evolve::StoppingCondition.

Definition at line 89 of file CombinedStoppingCondition.cpp.

◆ operator|=() [1/2]

CombinedStoppingCondition & Evolve::CombinedStoppingCondition::operator|= ( CombinedStoppingCondition rhs)

Adds the conditions in RHS to the conditions of *this.

Definition at line 65 of file CombinedStoppingCondition.cpp.

◆ operator|=() [2/2]

CombinedStoppingCondition & Evolve::CombinedStoppingCondition::operator|= ( StoppingCondition rhs)

Adds RHS to the conditions of *this.

Definition at line 80 of file CombinedStoppingCondition.cpp.

◆ reached()

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

See StoppingCondition::reached().

Reimplemented from Evolve::StoppingCondition.

Definition at line 107 of file CombinedStoppingCondition.cpp.

◆ type()

StoppingConditionType Evolve::CombinedStoppingCondition::type ( unsigned  index = 0) const
inlinevirtual

What event is the index-th stopping sub-condition associated with.

Implements Evolve::StoppingCondition.

Definition at line 103 of file CombinedStoppingCondition.h.

◆ update_meta_information()

void Evolve::CombinedStoppingCondition::update_meta_information ( const StoppingCondition rhs)
private

Updates all private methods except the sub_condition lists for adding rhs.

Definition at line 6 of file CombinedStoppingCondition.cpp.

Member Data Documentation

◆ __delete_subcond

bool Evolve::CombinedStoppingCondition::__delete_subcond
private

Whether to delete the sub-conditions then *this is destroyed.

Definition at line 31 of file CombinedStoppingCondition.h.

◆ __num_subconditions

unsigned Evolve::CombinedStoppingCondition::__num_subconditions
private

The number of subconditinos included, allowing for subconditions with multiple entries.

Definition at line 28 of file CombinedStoppingCondition.h.

◆ __sub_conditions

std::vector<StoppingCondition *> Evolve::CombinedStoppingCondition::__sub_conditions
private

The conditions that are combined.

Definition at line 24 of file CombinedStoppingCondition.h.

◆ __types

std::vector<StoppingConditionType> Evolve::CombinedStoppingCondition::__types
private

The types of the subconditinos, including subconditions of subconditions.

Definition at line 35 of file CombinedStoppingCondition.h.


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