1 #define BUILDING_LIBRARY 13 const std::valarray<double> &orbit,
14 const std::valarray<double> &derivatives,
15 std::valarray<double> &stop_deriv)
const 17 assert(evol_mode == Core::BINARY);
18 assert(orbit.size() == (1
23 assert(orbit.size() == derivatives.size());
28 dsemimajor_dt = derivatives[0],
29 de_dt = derivatives[1];
31 dsemimajor_dt *= semimajor/(6.5 * orbit[0]);
36 dsemimajor_dt * min_semimajor
41 semimajor * min_semimajor * de_dt
44 std::pow(min_semimajor, 2));
46 std::cerr <<
"amin = " << min_semimajor
47 <<
", a = " << semimajor
48 <<
", da/dt = " << dsemimajor_dt
50 <<
", de/dt = " << de_dt
51 <<
", d(death cond)/dt: " << stop_deriv[0] << std::endl;
53 return std::valarray<double>(
54 (semimajor * (1 - e) - min_semimajor) / min_semimajor,
63 assert(deriv_sign == -1);
71 std::ostringstream description;
72 description <<
"Semimajor axis crossing death boundary of " 74 return description.str();
BinarySystem & __system
The system this condition is attached to.
virtual double minimum_separation(bool deriv=false) const
Smallest semimajor axis at which the secondary can survive for the latest system configuration.
Orientations of zones of bodies in a binary system.
void reached(short deriv_sign, unsigned index=0)
See StoppingCondition::reached().
unsigned number_locked_zones() const
How many zones on either body are currently locked.
virtual void secondary_died()
Update the system to account for the death of the secondary.
virtual std::string describe(int index=-1) const
See StoppingCondition::describe().
Defines the BinarySystem class.
Declares a stopping condition class monitoring for the death of the secondary object.
EvolModeType
The various evolution modes.
std::valarray< double > operator()(Core::EvolModeType evol_mode, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, std::valarray< double > &stop_deriv) const
The difference between the semimajor axis and the larger of the roche radius and the stellar radius d...
double semimajor() const
The current semimajor axis of the system.
unsigned number_zones() const
The total number of zones in both system bodies.
double eccentricity() const
The current eccentricity of the system.
virtual void reached(short deriv_sign, unsigned index=0)
Called when a stopping condition has been reached by the evolution.