1 #define BUILDING_LIBRARY 10 const std::valarray<double> &orbit,
13 const std::valarray<double> &,
15 const std::valarray<double> &derivatives,
16 std::valarray<double> &stop_deriv)
const 19 assert(evol_mode==Core::BINARY);
22 assert(orbit.size()==derivatives.size());
40 unsigned deriv_zone_ind=0,
43 unsigned inclination_offset=2,
44 periapsis_offset=inclination_offset+num_zones-1,
45 angmom_offset=periapsis_offset+num_zones;
46 for(
int body_ind=0; body_ind<2; ++body_ind) {
49 for(
unsigned zone_ind=0; zone_ind<body.
number_zones(); ++zone_ind) {
53 dangmom_dt=derivatives[angmom_offset+unlocked_zone_ind++];
55 double dworb_dt=Core::orbital_angular_velocity(
72 *derivatives[inclination_offset+deriv_zone_ind]
77 *derivatives[inclination_offset+deriv_zone_ind]
83 *derivatives[periapsis_offset+deriv_zone_ind];
89 stop_deriv.resize(2, dfrac_dt);
90 std::valarray<double> result(2);
105 if(index==0) assert(deriv_sign == -1);
108 assert(deriv_sign == 1);
116 std::ostringstream description;
117 description <<
"Locked zone #" 119 <<
" exiting its current lock";
120 return description.str();
std::valarray< double > operator()(Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const
How far away from breaking the lock the system is.
RADIUS
The derivative w.r.t. the radius of the body in .
const DissipatingBody & primary() const
Returns the primary body in the system (const).
A base class for any body contributing to tidal dissipation.
Declares a class for a stopping condition monitoring when a locked zone loses the lock...
void reached(short deriv_sign, unsigned index=0)
See StoppingCondition::reached().
virtual const DissipatingZone & zone(unsigned zone_index) const =0
A modifiable reference to one of the body's zones.
double above_lock_fraction(unsigned locked_zone_index, Dissipation::QuantityEntry entry=Dissipation::NO_DERIV, unsigned deriv_zone_index=0, bool secondary_radius=false)
The fraction of an infinitesimal timestep that a zone spends spinning faster than the lock it is in...
Orientations of zones of bodies in a binary system.
double spin(double orbital_frequency) const
Spin frequency at exactly the lock that corresponds to the given orbital frequency.
unsigned __locked_zone_index
The index within the list of locked zones of the checked zone.
virtual double moment_of_inertia(int deriv_order=0) const =0
Moment of inertia of the zone or its age derivative at the age of last configure() call...
double mass() const
The mass of the body (constant with age).
double radius(int deriv_order=0) const
The current radius or its derivative with age of the body.
A layer of a system body for which the tidal bulge is not exactly in phase with the tidal potential...
unsigned number_locked_zones() const
How many zones on either body are currently locked.
const DissipatingBody & secondary() const
Returns the secondary body in the system (const).
BinarySystem & __system
The binary system this condition is attached to.
AGE
The derivative w.r.t. age, excluding the dependence through the body's radius and the moments of iner...
Defines the BinarySystem class.
virtual bool locked(int orbital_frequency_multiplier, int spin_frequency_multiplier) const
Should return true iff the given term is presently locked.
const SpinOrbitLockInfo & lock_held() const
The currntly held lock.
EvolModeType
The various evolution modes.
double semimajor() const
The current semimajor axis of the system.
SPIN_ANGMOM
The derivative w.r.t. the spin angular momentum in .
virtual std::string describe(int index=0) const
See StoppingCondition::describe().
unsigned number_zones() const
The total number of zones in both system bodies.
virtual void release_lock(unsigned locked_zone_index, short direction)
Releases the lock to one of the locked zones.
double spin_frequency() const
The spin frequency of the given zone.
virtual unsigned number_zones() const =0
The number of zones the body consists of.