1 #define BUILDING_LIBRARY 9 std::valarray<double> angmom(nzones),
10 zeros(0.0, nzones - 1);
11 for(
unsigned zone_ind = 0; zone_ind < nzones; ++zone_ind)
26 std::cerr <<
"Adding secondary" << std::endl;
29 std::valarray<double> angmom(nzones),
31 periapsis(nzones - 1);
32 unsigned zone_ind = 0;
33 for(
short body_ind = 0; body_ind < 2; ++body_ind) {
38 unsigned body_zone_ind = 0;
47 if(zone_ind) periapsis[zone_ind - 1] = 0;
69 double initial_eccentricity,
double initial_inclination,
71 double secondary_formation_age) :
80 if(initial_eccentricity<0 || initial_eccentricity>1) {
81 std::ostringstream msg;
82 msg <<
"Invalid initial eccentricity: " << initial_eccentricity
83 <<
" encountered in DiskBinarySystem constructor!";
86 if(__initial_inclination<0 || __initial_inclination>M_PI) {
87 std::ostringstream msg;
88 msg <<
"Invalid initial inclination: " << initial_eccentricity
89 <<
" encountered in DiskBinarySystem constructor, must be " 94 std::ostringstream msg;
95 msg <<
"Forming the secondary (at age= " << secondary_formation_age
96 <<
") before the disk dissipates (at age=" 97 << disk_dissipation_age <<
") is not supported at this time.";
119 else result = Core::Inf;
Function arguments do not satisfy some requirement.
double angular_momentum() const
The angular momentum of the given zone in .
const DissipatingBody & primary() const
Returns the primary body in the system (const).
A base class for any body contributing to tidal dissipation.
virtual double minimum_separation(bool deriv=false) const
Smallest semimajor axis at which the secondary can survive for the latest system configuration.
double __initial_inclination
Inclination between surface zone of primary and initial orbit.
double __disk_dissipation_age
Age when disk dissipates.
double periapsis(bool evolution_rate=false) const
The argument of periapsis of this zone minus the reference zone's.
virtual const DissipatingZone & zone(unsigned zone_index) const =0
A modifiable reference to one of the body's zones.
double __secondary_formation_age
Age when the secondary forms.
virtual double next_stop_age() const
The next age when the evolution needs to be stopped for a system change.
Orientations of zones of bodies in a binary system.
double __initial_semimajor
The semimajor axis of the orbit at which the secondary forms.
double age() const
Returns the present age of the system in Gyr.
A layer of a system body for which the tidal bulge is not exactly in phase with the tidal potential...
DiskBinarySystem(DissipatingBody &body1, DissipatingBody &body2, double initial_semimajor, double initial_eccentricity, double initial_inclination, double disk_lock_frequency, double disk_dissipation_age, double secondary_formation_age)
Create the system.
const DissipatingBody & secondary() const
Returns the secondary body in the system (const).
virtual void reached_critical_age(double age)
Change the system as necessary at the given age.
virtual void reached_critical_age(double age)
Change the system as necessary at the given age.
virtual void secondary_died()
Update the system to account for the death of the secondary.
Declares a class of binary systems which start with a disk-locked star which is then released and at ...
void add_secondary()
Adds the secondary to the system in its initial orbit.
virtual double next_stop_age() const
The next age when the evolution needs to be stopped for a system change.
double inclination(bool evolution_rate=false) const
The angle between the angular momenta of the zone and the orbit.
double semimajor() const
The current semimajor axis of the system.
void release_surface_spin()
Releases the surface spin of the star when the disk dissipates.
void set_surface_lock_frequency(double frequency)
Sets the frequency at which the surface is locked (if any).
double eccentricity() const
The current eccentricity of the system.
double disk_dissipation_age()
The age when the disk dissipates.
virtual int configure(bool initialize, double age, double semimajor, double eccentricity, const double *spin_angmom, const double *inclination, const double *periapsis, Core::EvolModeType evolution_mode)
Sets the current state of the system.
Describes a system of two bodies orbiting each other.
double __disk_lock_frequency
Frequency of the surface spin of the primary when disk is present.
double __initial_eccentricity
The eccentricity of the orbit at which the secondary forms.
virtual unsigned number_zones() const =0
The number of zones the body consists of.