Planetary Orbital Evolution due to Tides
Orbital evolution of two objects experiencing tides
SaturatingSkumanichWindBody.h
Go to the documentation of this file.
1 
10 #ifndef __SATURATING_SKUMANICH_WIND_BODY_H
11 #define __SATURATING_SKUMANICH_WIND_BODY_H
12 
13 #include "../Core/SharedLibraryExportMacros.h"
14 #include "../Evolve/DissipatingBody.h"
15 #include "../Evolve/BinarySystem.h"
16 
17 namespace Star {
18 
23  class LIB_PUBLIC SaturatingSkumanichWindBody :
24  virtual public Evolve::DissipatingBody {
25  private:
28 
30  __saturation_freq;
31 
34 
36  std::list<bool> __saturation_evolution;
37 
38 #ifndef NDEBUG
39  bool __detected_saturation;
40 #endif
41  public:
44  double wind_strength,
45 
47  double saturation_frequency
48  ) :
49  __wind_strength(wind_strength),
50  __saturation_freq(saturation_frequency)
51 #ifndef NDEBUG
52  , __detected_saturation(false)
53 #endif
54  {}
55 
57  double angular_momentum_loss(
58  Evolve::Dissipation::QuantityEntry entry = Evolve::Dissipation::NO_DERIV
59  ) const;
60 
62  double saturation_frequency() {return __saturation_freq;}
63 
66  {
67  __saturated = (std::abs(spin_frequency()) > __saturation_freq);
68 #ifndef NDEBUG
69  __detected_saturation = true;
70 #endif
71  }
72 
74  bool saturated() {return __saturated;}
75 
80  short
81 #ifndef NDEBUG
82  deriv_sign
83 #endif
84  )
85  {
86  assert(deriv_sign == (__saturated ? -1 : 1));
87 
88  __saturated = !__saturated;
89  }
90 
92  virtual void add_to_evolution()
93  {
94  __saturation_evolution.push_back(__saturated);
96  }
97 
99  virtual void rewind_evolution(
101  unsigned nsteps
102  )
103  {
104  for(unsigned i = 0; i < nsteps; ++i)
105  __saturation_evolution.pop_back();
107  }
108 
110  virtual void reset_evolution()
111  {
112  __saturation_evolution.clear();
114  }
115 
120  virtual Evolve::CombinedStoppingCondition *stopping_conditions(
122  Evolve::BinarySystem &system,
123 
125  bool primary
126  );
127 
129  const std::list<bool> &wind_saturation_evolution() const
130  {return __saturation_evolution;}
131 
133  void spin_jumped()
134  {
135  detect_saturation();
137  }
138 
139  virtual ~SaturatingSkumanichWindBody() {}
140  };//End SaturatingSkumanichWindBody class.
141 
142 }//End Star namespace.
143 
144 #endif
SaturatingSkumanichWindBody(double wind_strength, double saturation_frequency)
double saturation_frequency()
The frequency at which the wind loss saturates in rad/day.
virtual void rewind_evolution(unsigned nsteps)
Discards the last steps from the evolution.
virtual void reset_evolution()
Discards all evolution.
virtual void add_to_evolution()
Appends the state defined by last configure(), to the evolution.
virtual void add_to_evolution()
Appends the state defined by last configure(), to the evolution.
void saturation_freq_crossed(short deriv_sign)
Called by the stopping condition monitoring wind saturation.
void detect_saturation()
Sets the saturation based on the currently configured spin frequency.
A base class for any body contributing to tidal dissipation.
double __wind_strength
The strength of the magnetic wind.
void spin_jumped()
Resets its saturation state after a discontinous spin jump.
const std::list< bool > & wind_saturation_evolution() const
The tabulated wind saturation states so far.
virtual void reset_evolution()
Discards all evolution.
virtual void spin_jumped()
Notifies the body that its spin just discontinously jumped.
virtual void rewind_evolution(unsigned nsteps)
Discards the last steps from the evolution.
NO_DERIV
The quantity itself, undifferentiated.
std::list< bool > __saturation_evolution
The saturation states recorded by add_to_evolution() so far.
bool saturated()
Is the wind loss currently saturated?
A class combining the the outputs of multiple stopping conditions.
A DissipatingBody which loses angular momentum at a rate .
bool __saturated
Is the wind currently saturated?
Describes a system of two bodies orbiting each other.
Definition: BinarySystem.h:56