Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
LagSpinBreakCondition.h
Go to the documentation of this file.
1 
9 #ifndef __CRITICAL_SPIN_CONDITION_H
10 #define __CRITICAL_SPIN_CONDITION_H
11 
12 #include "../Core/SharedLibraryExportMacros.h"
13 #include "StoppingCondition.h"
14 #include "DissipatingBody.h"
15 #include "../Core/Error.h"
16 #include <vector>
17 
18 namespace Evolve {
19 
21 
23  class LIB_LOCAL LagSpinBreakCondition : public StoppingCondition {
24  private:
27 
28  const DissipatingBody
30  &__body,
31 
33  &__other_body;
34 
36  bool __primary;
37 
40  unsigned __zone_index;
41 
44  std::vector<double>::size_type __powerlaw_index;
45 
47  unsigned __num_subconditions;
48 
50  void set_num_subconditions();
51 
53  double derivative(
56  double surf_angmom_deriv,
57 
59  double wcritical
60  ) const;
61 
67  void fill_locked_derivs(
68  Core::EvolModeType evol_mode,
69  const std::valarray<double> &orbit,
70  const std::valarray<double> &derivatives,
71  std::valarray<double> &stop_deriv
72  ) const;
73 
79  void fill_unlocked_derivs(
80  Core::EvolModeType evol_mode,
81  const std::valarray<double> &orbit,
82  const std::valarray<double> &derivatives,
83  std::valarray<double> &stop_deriv
84  ) const;
85 
86  public:
88  LagSpinBreakCondition(
91 
93  const DissipatingBody &body,
94 
96  const DissipatingBody &other_body,
97 
99  bool primary,
100 
103  unsigned zone_index
104  );
105 
114  std::valarray<double> operator()(
115  Core::EvolModeType evol_mode,
116  const std::valarray<double> &orbit,
117  const std::valarray<double> &derivatives,
118  std::valarray<double> &stop_deriv
119  ) const;
120 
126  virtual void reached(short deriv_sign, unsigned index = 0);
127 
130  virtual size_t num_subconditions() const
131  {return __num_subconditions;}
132 
134  virtual StoppingConditionType type(unsigned =0) const
135  {return Evolve::EXTERNAL;}
136 
138  virtual short expected_crossing_deriv_sign(
140  unsigned index = 0
141  ) const;
142 
144  virtual std::string describe(int index = -1) const;
145 
146  };//End LagSpinBreakCondition class.
147 
148 }//End Evolve namespace.
149 
150 #endif
struct LIB_PUBLIC BrokenPowerlawPhaseLagZone
Opaque struct to cant to/from Evolve::BrokenPowerlawPhasLagZone.
Definition: CInterface.h:41
StoppingConditionType
The reasons for stopping the evolution currently supported.
Orientations of zones of bodies in a binary system.
Declares the DissipatingBody class.
EvolModeType
The various evolution modes.
Definition: Common.h:42
Defines the various stopping conditions needed by OrbitSolver.