10 #define BUILDING_LIBRARY 17 const double MIN_RELATIVE_STEP = (
20 10.0 * std::numeric_limits<double>::epsilon()
24 const double *parameters,
28 void **input_params =
static_cast<void **
>(system_mode);
39 #ifdef ENABLE_DERIVATIVES 41 double *param_derivs,
double *age_derivs,
void *system_mode)
43 void **input_params =
static_cast<void **
>(system_mode);
48 return system.jacobian(age,
65 std::streamsize orig_precision=os.precision();
67 std::ios_base::fmtflags orig_flags=os.flags();
68 os.setf(std::ios_base::scientific);
70 os <<
"Stored stop condition information:" << std::endl
71 << std::setw(20) <<
"Age:";
72 bool skip_check =
true;
73 std::list<double>::const_iterator age_i;
76 std::advance(age_i, -5);
89 os << std::setw(28) << *age_i;
100 os << std::endl << hline << std::endl;
108 os << std::setw(13) <<
"Condition[" 116 bool marked_skip_extremum=
false;
118 std::list< std::valarray<double> >::const_iterator cond_i;
121 std::advance(cond_i, -5);
137 os <<
"z"; marked=
true;
140 && !marked_skip_extremum) {
141 os <<
"e"; marked_skip_extremum=
true; marked=
true;
142 }
else os << (marked ?
"-" :
" ");
143 os << (marked ?
">" :
" ");
144 os << std::setw(25) << (*cond_i)[i];
149 os << std::setw(13) <<
"Derivative[" << std::setw(5) << i
152 std::list< std::valarray<double> >::const_iterator deriv_i;
155 std::advance(deriv_i, -5);
168 os << std::setw(28) << (*deriv_i)[i];
173 os.precision(orig_precision);
174 os.flags(orig_flags);
186 const std::valarray<double> ¤t_stop_cond,
187 const std::valarray<double> ¤t_stop_deriv)
190 std::list< std::valarray<double> >::iterator
194 age_i++; cond_i++; deriv_i++;
213 std::valarray<double> &orbit)
242 __skip_history_extremum[i]
281 size_t num_points = std::min(
292 std::list< std::valarray<double> >::const_iterator
295 int go_back = (
static_cast<int>(num_points)
298 go_back = std::max(go_back, (crossing ? 1 : 2));
299 size_t failed_back = 0;
300 for(
int i = 0; i <
go_back; ++i) {
312 if(go_back - failed_back < (crossing ? 1 : 2))
326 num_points - (crossing ? 2 : 3));
327 int history_limit = 0;
343 max_left_shift = std::min(history_limit, max_left_shift);
344 for(
int i = 0; i < max_left_shift; i++) {
347 (interval.last_age() - interval.first_age())
349 result.last_age() - result.first_age()
357 size_t condition_index
367 std::list< std::valarray<double> >::const_iterator stop_cond_i =
369 double pre1_cond = (*(--stop_cond_i))[condition_index],
370 pre2_cond = (*(--stop_cond_i))[condition_index],
373 std::abs(pre1_cond) > std::abs(pre2_cond)
375 std::abs(pre1_cond) > std::abs(post_cond)
378 !std::isfinite(pre1_cond)
380 !std::isfinite(pre2_cond)
382 !std::isfinite(post_cond)
394 double t0 = stop_interval.
age(),
396 t1 = (++stop_interval).age(),
398 t2 = (++stop_interval).age(),
400 abs_c0 = std::abs(c0),
401 abs_c1 = std::abs(c1),
402 abs_c2 = std::abs(c2);
404 const double min_fractional_diff = (
407 std::numeric_limits<double>::epsilon()
410 bool ignore_10_diff = (std::abs(c1 - c0) / std::max(abs_c0, abs_c1)
412 min_fractional_diff),
413 ignore_21_diff = (std::abs(c2 - c1) / std::max(abs_c1, abs_c2)
415 min_fractional_diff);
419 if((c1 - c0) * (c2 - c1) > 0 || ignore_10_diff || ignore_21_diff)
423 result.
x() = Core::quadratic_extremum(t0, c0, t1, c1, t2, c2,
426 double t3 = (++stop_interval).age(),
428 abs_c3 = std::abs(c3);
429 bool ignore_32_diff = (
430 std::abs(c3 - c2) / std::max(abs_c3, abs_c2)
436 (c1 - c0) * (c2 - c1) > 0
438 abs_c1 >= std::max(abs_c0, abs_c2)
446 (c2 - c1) * (c3 - c2) > 0
448 abs_c2 >= std::max(abs_c1, abs_c3)
462 std::abs(c1) <= std::abs(c0)
464 std::abs(c1) <= std::abs(c2)
478 "Searching for extremum among monotonic stopping condition " 479 "values in OrbitSolver::extremum_from_history_no_deriv." 481 result.
x() = Core::cubic_extremum(t0, c0, t1, c1, t2, c2, t3, c3,
483 range_low, range_high);
489 size_t condition_index,
490 double min_extremum_x
506 if(next_stop_cond * prev_stop_cond <= 0)
519 next_stop_cond * next_stop_deriv < 0
521 next_stop_deriv * prev_stop_deriv >= 0
533 if(result.
x() < min_extremum_x) {
534 result.
x() = min_extremum_x;
535 result.
y() = Core::NaN;
549 if(stop_interval.
num_points() < 2)
return Core::Inf;
550 double t0 = stop_interval.
age(),
552 t1 = (++stop_interval).age(),
555 return Core::estimate_zerocrossing(t0, c0, t1, c1);
556 double t2 = (++stop_interval).age(),
558 double range_low = Core::NaN,
559 range_high = Core::NaN;
560 short crossing_sign =
564 if(c0 * c1 <= 0 && c1 * crossing_sign > 0) {
567 }
else if(c1 * c2 <= 0 && c2 * crossing_sign > 0) {
572 assert(!std::isnan(range_low) && !std::isnan(range_high));
573 return Core::quadratic_zerocrossing(
574 t0, c0, t1, c1, t2, c2, range_low, range_high
577 double t3 = (++stop_interval).age(),
579 if(std::isnan(range_low)) {
583 assert(c3 * crossing_sign > 0);
585 return Core::cubic_zerocrossing(
586 t0, c0, t1, c1, t2, c2, t3, c3, range_low, range_high
605 next_stop_cond * prev_stop_cond > 0
637 return Core::estimate_zerocrossing(prev_age,
647 const std::valarray<double> &stop_cond_values,
652 std::cerr <<
"Initializing skip history with stop reason: " 677 stop_cond_type == stop_reason
681 std::abs(stop_cond_values[cond_ind]) <=
__precision 684 std::cerr <<
"Skipping first step of condition " 686 <<
"(" << stop_cond_type <<
")" 693 (1.0+std::numeric_limits<double>::epsilon())
698 std::cerr <<
"Not skipping condition " 700 <<
"(" << stop_cond_type <<
")" 707 const std::valarray<double> ¤t_stop_cond,
711 for(
size_t i = 0; i < current_stop_cond.size(); i++) {
746 previous_age * MIN_RELATIVE_STEP
756 std::cerr <<
"From t = " << previous_age
757 <<
", stepped to t = " << current_age
758 <<
", stop at t = " << stop_info.
stop_age()
759 <<
", must be at least: " << previous_age * MIN_RELATIVE_STEP
766 std::cerr <<
"Failed to meet precision for " 784 const std::valarray<double> &orbit,
785 const std::valarray<double> &derivatives,
787 unsigned current_expansion_order,
791 for(
unsigned i = 0; i < orbit.size(); ++i)
795 (evolution_mode == Core::BINARY && orbit[0] <= 0)
798 std::cerr <<
"Bad orbit: " << orbit << std::endl;
806 std::pair<double, double> expansion_range =
810 if(evolution_mode == Core::BINARY)
811 std::cerr <<
"Updating stop condition history. Current e = " 813 <<
" current expansion order: " 814 << current_expansion_order
815 <<
" current expansion range: " 816 << expansion_range.first
818 << expansion_range.second
824 evolution_mode == Core::BINARY
826 orbit[1] > expansion_range.second
829 std::cerr <<
"Eccentricity (" 831 <<
") exceeds current expansion error limit of " 832 << expansion_range.second
833 <<
". Choosing to stop half way between t = " 848 std::valarray<double> current_stop_cond(
851 std::valarray<double> current_stop_deriv;
852 current_stop_cond = (*__stopping_conditions)(evolution_mode,
864 std::cerr << std::string(77,
'@') << std::endl;
866 std::cerr <<
"Decreasing expansion order is " 867 << (current_expansion_order == 0 ?
"not" :
"")
876 cond_ind < current_stop_cond.size()
880 double stop_cond_value = current_stop_cond[cond_ind],
884 bool crossed_zero =
false;
885 if(std::abs(crossing_precision) >= std::abs(stop_cond_value)) {
886 crossing_precision = stop_cond_value;
893 double extremum_precision;
894 if(std::isnan(extremum.
y())) extremum_precision = Core::NaN;
896 extremum_precision = (
898 std::abs(extremum.
y() - stop_cond_value),
899 std::abs(extremum.
y()
904 std::abs(extremum.
y())
906 bool is_crossing = crossing_age <= extremum.
x();
907 short deriv_sign = 0;
908 if(is_crossing) deriv_sign = (stop_cond_value > 0 ? 1 : -1);
910 stop_info.
stop_age() = std::min(crossing_age, extremum.
x());
913 : extremum_precision);
920 std::cerr <<
"Condition " << cond_ind <<
" " 938 std::cerr <<
"SELECTED" << std::endl;
940 std::cerr <<
"NOT SELECTED!" << std::endl;
960 evolution_mode == Core::BINARY
962 orbit[1] < expansion_range.first
968 current_expansion_order > 0
971 std::cerr <<
"Eccentricity (" 973 <<
" is sufficiently small (< " 974 << expansion_range.first
975 <<
") to decrease expansion order." 987 std::cerr <<
"Step to age = " 989 <<
" deemed unacceptable: " 1001 std::valarray<double> &orbit,
1005 , std::string reason
1014 <<
"Reverting step from t = " 1028 last_good_t * MIN_RELATIVE_STEP
1031 std::cerr <<
"Stepped only " 1046 step_size = 0.1 * (max_next_t - t);
1052 std::valarray<double> &orbit,
1058 size_t nargs = orbit.size();
1060 std::cerr <<
"Starting evolution leg in " << evolution_mode
1061 <<
" from t=" << system.
age() <<
" with initial orbit:\n";
1062 for(
size_t i = 0; i < nargs; ++i) {
1063 if(i) std::cerr <<
", ";
1064 std::cerr <<
"\t" << orbit[i] << std::endl;
1066 std::cerr << std::endl;
1067 std::cerr <<
"Stopping conditions:" << std::endl
1071 const gsl_odeiv2_step_type *step_type = gsl_odeiv2_step_rkf45;
1073 gsl_odeiv2_step *step = gsl_odeiv2_step_alloc(step_type, nargs);
1074 gsl_odeiv2_control *step_control = gsl_odeiv2_control_standard_new(
1080 gsl_odeiv2_evolve *evolve = gsl_odeiv2_evolve_alloc(nargs);
1082 void *sys_mode[2]={&system, &evolution_mode};
1084 #ifdef ENABLE_DERIVATIVES 1091 double t=system.
age();
1092 std::valarray<double> derivatives(nargs),
1093 param_derivatives(nargs),
1094 age_derivatives(nargs);
1099 double step_size = std::min(0.1 * (max_age - t),
1103 bool first_step =
true;
1106 double max_next_t = std::min(t + max_step, max_age);
1107 int status=GSL_SUCCESS;
1108 bool step_rejected=
false;
1111 std::cerr <<
"Attempting step from t = " << t
1112 <<
" not to miss t = " << max_next_t
1113 <<
", suggested step = " << step_size
1115 for(
size_t i=0; i<nargs; ++i) {
1116 if(i) std::cerr <<
", ";
1117 std::cerr <<
"\t" << orbit[i] << std::endl;
1119 std::cerr << std::endl;
1123 step_size = std::max(step_size,
1124 3.0 * (MIN_RELATIVE_STEP * t - t));
1125 status = gsl_odeiv2_evolve_apply(evolve,
1134 if (status == GSL_FAILURE) {
1136 std::cerr <<
"Failed, (presume zero step size)!" 1140 }
else if (status != GSL_SUCCESS && status != GSL_EDOM) {
1141 std::ostringstream msg;
1142 msg <<
"GSL signaled failure while evolving (error code " <<
1166 std::ostringstream msg;
1171 <<
" discarded), exceeded evolution time limit of " 1173 <<
" seconds or step limit of " 1178 if(status == GSL_SUCCESS) {
1182 std::cerr <<
"Succeeded! Now t = " << t << std::endl;
1183 #ifdef VERBOSE_DEBUG 1184 std::cerr <<
"GSL suggested new step size:" 1217 , (status == GSL_EDOM ?
"EDOM error" :
"bad step")
1220 step_rejected =
true;
1221 gsl_odeiv2_evolve_reset(evolve);
1223 if(!first_step && t < from_t * MIN_RELATIVE_STEP) {
1225 std::cerr <<
"Stepped only " 1232 step_rejected=
false;
1249 if(!step_rejected) {
1251 std::cerr <<
"Stepped to t = " << t << std::endl;
1256 std::cerr <<
"Stop: " << stop
1259 <<
"max age: " << max_age
1277 std::cerr <<
"Breaking for = " << stop << std::endl;
1291 gsl_odeiv2_evolve_free(evolve);
1292 gsl_odeiv2_control_free(step_control);
1293 gsl_odeiv2_step_free(step);
1302 #ifdef EXTERNAL_CONDITION 1303 (*result) |=
new EXTERNAL_CONDITION;
1307 for(
size_t cond_ind = 0; cond_ind <
__stop_info.size(); ++cond_ind)
1310 __stop_info[cond_ind].stop_condition_index() = cond_ind;
1317 const std::list<double> &required_ages)
1320 std::cerr <<
"Determining next stop age: " << std::endl;
1324 std::cerr <<
"Next system stop age: " << result << std::endl;
1326 if(required_ages.size() == 0)
return result;
1328 static std::list<double>::const_iterator
1329 next_required_age = required_ages.begin();
1330 if(age <= required_ages.front())
1331 next_required_age = required_ages.begin();
1333 next_required_age != required_ages.end()
1335 age == *next_required_age
1337 ++next_required_age;
1339 next_required_age != required_ages.end()
1341 result > *next_required_age
1343 result = *next_required_age;
1345 std::cerr <<
"Required ages change that to: " << result << std::endl;
1356 std::cerr <<
"Stopped due to condition at t = " 1361 std::vector<StopInformation>::const_iterator stop_i =
1367 stop_i->is_crossing()
1370 stop_i->stop_age() < stop_age
1373 stop_i->stop_reason() == stop_reason
1380 std::cerr <<
"Triggered condition: " 1382 stop_i->stop_condition_index()
1387 stop_i->deriv_sign_at_crossing(),
1388 stop_i->stop_condition_index()
1397 const std::valarray<double> &orbit,
1403 std::cerr <<
"Adjusting expansion order at t =" 1406 std::cerr <<
" upward!";
1407 std::cerr << std::endl;
1409 assert(evolution_mode == Core::BINARY);
1413 required_expansion_order =
1417 required_expansion_order = std::max(required_expansion_order,
1418 current_expansion_order + 1);
1420 if(required_expansion_order != current_expansion_order) {
1421 if(required_expansion_order > current_expansion_order)
1429 std::cerr <<
"At e(t = " 1433 <<
" adjusted expansion order from " 1434 << current_expansion_order
1436 << required_expansion_order
1448 double required_precision,
1449 bool print_progress) :
1463 const std::list<double> &required_ages,
1465 unsigned max_time_steps,
1466 double min_extremum_search_step)
1469 std::cerr <<
"Calculating evolution from t = " << system.
age()
1470 <<
" to t = " <<
__end_age << std::endl;
1482 double last_age = system.
age();
1483 std::valarray<double> orbit;
1487 if(evolution_mode == Core::BINARY) {
1494 while(last_age < stop_evol_age) {
1500 last_age = next_stop_age;
1502 std::cerr <<
"Next stop age: " << next_stop_age << std::endl;
1514 std::cerr <<
"Stop information: " 1519 if(last_age < stop_evol_age) {
1520 if(stop_reason ==
NO_STOP || last_age == next_stop_age) {
1538 std::valarray<double> old_orbit(orbit);
1542 if(evolution_mode == Core::BINARY) {
1543 if(old_evolution_mode != Core::BINARY) {
1563 <<
"At t=" << last_age
1564 <<
", changing evolution mode from " << old_evolution_mode
1565 <<
" with " << old_locked_zones
1566 <<
" zones locked to " << evolution_mode
1570 <<
"Transforming orbit from: " << old_orbit
1571 <<
" to " << orbit << std::endl;
void adjust_expansion_order(BinarySystem &system, const std::valarray< double > &orbit, Core::EvolModeType evolution_mode, bool must_increase=false)
Increase/decrease the eccentricity expansion order until error is acceptable and return the new order...
Maximum allowed step size decreased below machine precision.
virtual void add_to_evolution()
Appends the state defined by last configure(), to the evolution.
double __min_extremum_search_step
Extremum searching cannot limit the step size below this.
void initialize_locks(double sync_precision)
Identify and lock all zones within precision of a lock that can hold the lock at the current configur...
OrbitSolver(double max_age, double required_precision, bool print_progress=false)
Prepare to solve for the orbital evolution.
double __runtime_limit
Max number of seconds current evolution is allowed to run.
Function arguments do not satisfy some requirement.
double __last_order_upgrade_age
The last age at which the eccentricity order was increased.
void reset(BinarySystem &system)
Clears any previously calculated evolution.
virtual unsigned expansion_order() const
ExtremumInformation extremum_from_history_no_deriv(size_t condition_index) const
Estimates the value and age of an extremum of a stopping condition for which no derivative informatio...
double __precision
The precision required of the solution.
LIB_LOCAL int stellar_system_jacobian(double age, const double *parameters, double *param_derivs, double *age_derivs, void *system_mode)
A wrapper tha allows the stellar system jacobian to be passed to the GSL ODE solver.
The spin-orbit lock can no longer be maintaned.
void reject_step(double &age, StopInformation &stop, BinarySystem &system, std::valarray< double > &orbit, double &max_next_t, double &step_size, std::string reason)
Handle the situation when the last step has to be rejected.
std::list< Core::EvolModeType > __tabulated_evolution_modes
The evolution mode corresponding to the matching tabulated age.
virtual StoppingConditionType type(unsigned index=0) const =0
What event is the index-th stopping sub-condition associated with.
std::list< std::valarray< double > > __stop_cond_history
Past values of the stop conditions.
The error due to truncating the eccentricity expansion is too small.
virtual size_t num_subconditions() const
The number of subconditions in the current condition.
virtual double next_stop_age() const
The next age when the evolution needs to be stopped for a system change.
StoppingConditionType
The reasons for stopping the evolution currently supported.
Orientations of zones of bodies in a binary system.
time_t __evolution_start_time
When did the currently running evolution start.
std::list< std::valarray< double > > __stop_deriv_history
Past values of the stop condition derivatives.
Defines the OrbitSolver class, the various stopping conditions and a number of other classes used whi...
double go_back(double max_age, BinarySystem &system, std::valarray< double > &orbit)
Rewinds the evlution to the last step before the given age and returns the age of that step...
int differential_equations(double age, const double *parameters, Core::EvolModeType evolution_mode, double *differential_equations)
The differential equation and jacobian for the evolution of the system.
void add_to_evolution(double age, Core::EvolModeType evolution_mode, BinarySystem &system)
Adds the last step to the evolution.
virtual void reset_evolution()
Resets the evolution of the system.
double age() const
Returns the present age of the system in Gyr.
double crossing_from_history(size_t condition_index) const
Estimates the age at which a stopping condition with derivative information crossed zero...
CombinedStoppingCondition * get_stopping_condition(BinarySystem &system)
Returns the stopping conditions which end the given evolution mode and update __stop_info.
void output_history_and_discarded(std::ostream &os)
Generates a nicely formatted table of the contents of the discarded and history stopping condition in...
bool at_exact_condition(double previous_age, const StopInformation &stop_info)
Is the condition causing a stop match to within the required precision?
unsigned number_locked_zones() const
How many zones on either body are currently locked.
virtual void reached_critical_age(double age)
Change the system as necessary at the given age.
StopInformation update_stop_condition_history(double age, const std::valarray< double > &orbit, const std::valarray< double > &derivatives, Core::EvolModeType evolution_mode, unsigned current_expansion_order, StoppingConditionType stop_reason=NO_STOP)
Updates stop_cond_history and stop_deriv_history after a GSL step, returning if/where the evolution n...
double stopping_age(double age, const BinarySystem &system, const std::list< double > &required_ages)
The age at which the evolution should stop next if no other stopping condition occurs.
The error due to truncating the eccentricity expansion is too large.
std::vector< StopInformation > __stop_info
StopInformation evolve_until(BinarySystem &system, double &max_age, std::valarray< double > &orbit, StoppingConditionType &stop_reason, double max_step, Core::EvolModeType evolution_mode)
Evolves a system until either some age cut-off is reached or some stopping condition crosses zero...
static std::pair< double, double > get_expansion_range(int max_mp)
Return the range of eccentricities (min, max) over which an expansion going up to given max m' is val...
void reached_stopping_condition(double stop_age, StoppingConditionType stop_reason)
Handle a stop in the evolution due to at least one condition reaching a critical value.
virtual short expected_crossing_deriv_sign(unsigned index=0) const
The expected sign of the derivative at the next zero-crossing.
virtual std::string describe(int index=-1) const =0
Overwrite with something returning a description of what the stopping condition is monitoring...
size_t num_points()
Returns the number of points in the interval.
unsigned __num_step_limit
Max number of steps allowed to be stored in history and/or discarded.
A base class for all stopping conditions.
void clear_history()
Clears the current stopping condition history.
static unsigned required_expansion_order(double e)
The maximum orbital frequency multiplier to include in the potential Fourier expansion in order to ac...
bool __print_progress
See print_progress argument of constructor.
virtual void rewind_evolution(unsigned nsteps)
Discards the last steps from the evolution.
std::list< std::valarray< double > > __stop_deriv_discarded
Discarded derivatives of the stop conditions.
Core::EvolModeType evolution_mode()
The evolution mode of last call to configure().
void initialize_skip_history(const StoppingCondition &stop_cond, const std::valarray< double > &stop_cond_values, StoppingConditionType stop_reason)
Initializes the skip_history_zerocrossing and skip_history_extremum arrays appropriately after a mode...
std::list< double > __discarded_stop_ages
The ages of steps which were discarded becauset they are past a zero or an extremum of a stopping con...
std::list< std::valarray< double > > __orbit_deriv_history
Past orbital derivatives.
EvolModeType
The various evolution modes.
virtual size_t num_subconditions() const
The number of subconditions in the current condition.
std::valarray< size_t > __skip_history_zerocrossing
The number of points at the start of the history to skip when lookng for a zero crossing for each con...
StopHistoryInterval select_stop_condition_interval(bool crossing, size_t cond_ind, size_t max_points) const
Selects a history interval for interpolating to a reason to stop the evolution.
void update_skip_history(const std::valarray< double > ¤t_stop_cond, const StopInformation &stop_info)
Updates the skip_history_zerocrossing and skip_history_extremum arrays appropriately after an accepta...
double crossing_from_history_no_deriv(size_t condition_index) const
Estimates the age at which a stopping condition with no derivative information crossed zero...
double stop_condition_value(size_t condition_index) const
Returns the value of the stop condition with the given index for the current point.
double __end_age
The last age for which evolution is required.
ExtremumInformation extremum_from_history(size_t condition_index, double min_extremum_x) const
Estimates the value and age of an extremum of a stopping condition for which derivative information i...
virtual void change_expansion_order(unsigned new_expansion_order)
Change the tidal potential expansion order for all dissipative zones.
A class combining the the outputs of multiple stopping conditions.
void operator()(BinarySystem &system, double max_step=Core::Inf, const std::list< double > &required_ages=std::list< double >(), double max_runtime=0, unsigned max_time_steps=0, double min_extremum_search_step=1e-5)
Actually solves the given differential equation with the given boundary conditions.
StoppingConditionType type(unsigned index=0) const
What event is the index-th stopping sub-condition associated with.
std::list< double > __stop_history_ages
The ages at which the stop condition history is kept.
GSL step size decreased below machine precision.
void clear_discarded()
Removes all stored discarded stop condition information.
virtual CombinedStoppingCondition * stopping_conditions()
Conditions detecting the next possible doscontinuity in the evolution.
std::valarray< double > __skip_history_extremum
The age after which to look for extrema for each condition.
std::list< double > __tabulated_ages
The ages at which solution is tabulated.
double age() const
Returns the age of the current point.
std::list< std::valarray< double > > __orbit_history
Past orbits.
Describes a system of two bodies orbiting each other.
void insert_discarded(double age, const std::valarray< double > ¤t_stop_cond, const std::valarray< double > ¤t_stop_deriv)
Adds an entry in the discarded ages, stop conditions and derivatives.
A collection of accepted and discarded evolution steps which contain some reason to stop...
StoppingCondition * __stopping_conditions
The current set of stopping conditions.
Core::EvolModeType fill_orbit(std::valarray< double > &orbit) const
Fills an array with the parameters expected by differential_equations() and jacobian(), returning the evolution mode.
std::list< std::valarray< double > > __stop_cond_discarded
Discarded values of the stop conditions.
bool acceptable_step(double current_age, double previous_age, const StopInformation &stop_info)
Return true iff the step with the given stop information is acceptable.
int stellar_system_diff_eq(double age, const double *parameters, double *derivatives, void *system_mode)
A wrapper tha allows the stellar system differential equation to be passed to the GSL ODE solver...
virtual void reached(short deriv_sign, unsigned index=0)
Called when a stopping condition has been reached by the evolution.