Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
CombinedStoppingCondition.h
Go to the documentation of this file.
1 
9 #ifndef __COMBINED_STOPPING_CONDITION_H
10 #define __COMBINED_STOPPING_CONDITION_H
11 
12 #include "../Core/SharedLibraryExportMacros.h"
13 #include "StoppingCondition.h"
14 #include <vector>
15 
16 namespace Evolve {
17 
21  class LIB_PUBLIC CombinedStoppingCondition : public StoppingCondition {
22  private:
24  std::vector<StoppingCondition *> __sub_conditions;
25 
29 
32 
35  std::vector<StoppingConditionType> __types;
36 
39  void update_meta_information(const StoppingCondition *rhs);
40 
42  void add_subcondition_values(
44  const StoppingCondition *cond,
45 
47  Core::EvolModeType evol_mode,
48 
50  const std::valarray<double> &orbit,
51 
53  const std::valarray<double> &derivatives,
54 
58  size_t &first_index,
59 
61  std::valarray<double> &values,
62 
64  std::valarray<double> &derivs) const;
65 
68  std::vector<StoppingCondition *>::const_iterator
69  find_condition(unsigned &index) const;
70 
73  std::vector<StoppingCondition *>::iterator
74  find_condition(unsigned &index);
75 
76  public:
79  __sub_conditions(), __num_subconditions(0), __delete_subcond(true) {}
80 
83 
86 
92  std::valarray<double> operator()(
93  Core::EvolModeType evol_mode,
94  const std::valarray<double> &orbit,
95  const std::valarray<double> &derivatives,
96  std::valarray<double> &stop_deriv) const;
97 
99  void no_delete_subcond() {__delete_subcond=false;}
100 
101  virtual size_t num_subconditions() const {return __num_subconditions;}
102 
103  StoppingConditionType type(unsigned index=0) const
104  {return __types[index];}
105 
107  virtual void reached(short deriv_sign, unsigned index=0);
108 
110  short expected_crossing_deriv_sign(unsigned index = 0) const;
111 
113  virtual std::string describe(int index) const;
114 
118  }; //End CombinedStoppingCondition class.
119 
120 } //End Evolve namespace.
121 
122 #endif
CombinedStoppingCondition()
Create an empty stopping condition (identical to NoStopCondition).
void no_delete_subcond()
Disables the destruction of the subconditions when *this is destroyed.
unsigned __num_subconditions
The number of subconditinos included, allowing for subconditions with multiple entries.
StoppingConditionType
The reasons for stopping the evolution currently supported.
Orientations of zones of bodies in a binary system.
std::vector< StoppingConditionType > __types
The types of the subconditinos, including subconditions of subconditions.
std::vector< StoppingCondition * > __sub_conditions
The conditions that are combined.
A base class for all stopping conditions.
bool __delete_subcond
Whether to delete the sub-conditions then *this is destroyed.
EvolModeType
The various evolution modes.
Definition: Common.h:42
virtual size_t num_subconditions() const
The number of subconditions in the current condition.
Defines the various stopping conditions needed by OrbitSolver.
A class combining the the outputs of multiple stopping conditions.
StoppingConditionType type(unsigned index=0) const
What event is the index-th stopping sub-condition associated with.