Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
StopInformation.h
Go to the documentation of this file.
1 
8 #ifndef __STOP_INFORMATION_H
9 #define __STOP_INFORMATION_H
10 
11 #include "../Core/SharedLibraryExportMacros.h"
12 #include "StoppingCondition.h"
13 
14 namespace Evolve {
15 
19  class LIB_LOCAL StopInformation {
20  private:
22  double __stop_age,
23 
32 
35 
36  bool
39 
41  __crossed_zero;
42 
45 
48  public:
53  double stop_age=Core::Inf,
54 
56  double stop_precision=Core::NaN,
57 
59  StoppingConditionType stop_reason=NO_STOP,
60 
63  bool is_crossing = false,
64 
66  bool crossed_zero = false,
67 
69  size_t stop_condition_index = 0,
70 
73  short deriv_sign_at_crossing = 0
74  ) :
75  __stop_age(stop_age),
76  __stop_condition_precision(stop_precision),
77  __stop_reason(stop_reason),
78  __is_crossing(is_crossing),
79  __crossed_zero(crossed_zero),
80  __stop_condition_index(stop_condition_index),
81  __deriv_sign_at_crossing(is_crossing ? deriv_sign_at_crossing : 0) {}
82 
85  __stop_age(orig.__stop_age),
86  __stop_condition_precision(orig.__stop_condition_precision),
87  __stop_reason(orig.__stop_reason),
88  __is_crossing(orig.__is_crossing),
89  __crossed_zero(orig.__crossed_zero),
90  __stop_condition_index(orig.__stop_condition_index),
91  __deriv_sign_at_crossing(orig.__deriv_sign_at_crossing)
92  {}
93 
95  double stop_age() const {return __stop_age;}
96 
98  double &stop_age() {return __stop_age;}
99 
102  {return __stop_condition_precision;}
103 
106  {return __stop_condition_precision;}
107 
109  StoppingConditionType stop_reason() const {return __stop_reason;}
110 
112  StoppingConditionType &stop_reason() {return __stop_reason;}
113 
115  bool is_crossing() const {return __is_crossing;}
117  bool &is_crossing() {return __is_crossing;}
118 
120  size_t stop_condition_index() const {return __stop_condition_index;}
121 
123  size_t &stop_condition_index() {return __stop_condition_index;}
124 
127  bool crossed_zero() const {return __crossed_zero;}
128 
131  bool &crossed_zero() {return __crossed_zero;}
132 
135  {
136  __stop_age=rhs.__stop_age;
137  __stop_condition_precision=rhs.__stop_condition_precision;
138  __stop_reason=rhs.__stop_reason;
139  __is_crossing=rhs.__is_crossing;
140  __crossed_zero=rhs.__crossed_zero;
141  __stop_condition_index=rhs.__stop_condition_index;
142  __deriv_sign_at_crossing=rhs.__deriv_sign_at_crossing;
143  return *this;
144  }
145 
148  {
149  assert(__is_crossing);
150 
151  return __deriv_sign_at_crossing;
152  }
153 
155  short &deriv_sign_at_crossing() {return __deriv_sign_at_crossing;}
156 
157  };//End StopInformation class.
158 
160  LIB_LOCAL std::ostream &operator<<(std::ostream &os,
161  const StopInformation &stop);
162 
163 }//End Evolve namespaec.
164 #endif
double stop_age() const
The target stopping age in Gyr.
StoppingConditionType __stop_reason
The reason for stopping.
size_t & stop_condition_index()
The index of the condition which caused us to stop.
StopInformation(double stop_age=Core::Inf, double stop_precision=Core::NaN, StoppingConditionType stop_reason=NO_STOP, bool is_crossing=false, bool crossed_zero=false, size_t stop_condition_index=0, short deriv_sign_at_crossing=0)
Create an object with the information about why we evolution should be stopped.
bool __crossed_zero
Did the last step actually cross zero?
short & deriv_sign_at_crossing()
The sign of the derivative at zero-crossing.
std::ostream & operator<<(std::ostream &os, const ZoneEvolutionQuantities &evol_var)
More civilized output for EvolVarType variables.
double & stop_age()
The target stopping age in Gyr.
bool & is_crossing()
Is the reason for stopping that a condition actually crossed zero?
StoppingConditionType & stop_reason()
The reason for stopping.
double __stop_age
The target stopping age in Gyr.
double stop_condition_precision() const
The precision up to which the reason to stop is satisfied.
StoppingConditionType
The reasons for stopping the evolution currently supported.
Orientations of zones of bodies in a binary system.
StopInformation & operator=(const StopInformation &rhs)
Copy rhs to *this.
short deriv_sign_at_crossing() const
The sign of the derivative at zero-crossing.
The information about why and where the evolution should stop.
double __stop_condition_precision
The precision up to which the reason to stop is satisfied.
double & stop_condition_precision()
The precision up to which the reason to stop is satisfied.
size_t stop_condition_index() const
The index of the condition which caused us to stop.
StopInformation(const StopInformation &orig)
Copy orig to *this.
bool & crossed_zero()
Did we stop after the stopping condition crossed zero (always false for extrema). ...
No reason to stop.
bool crossed_zero() const
Did we stop after the stopping condition crossed zero (always false for extrema). ...
short __deriv_sign_at_crossing
The sign of the derivative at zero-crossing.
bool __is_crossing
Is the reason for stopping that a condition actually crossed zero?
Defines the various stopping conditions needed by OrbitSolver.
size_t __stop_condition_index
The index of the condition which caused us to stop.
bool is_crossing() const
Is the reason for stopping that a condition actually crossed zero?
StoppingConditionType stop_reason() const
The reason for stopping.