00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _DOUBLE_SUPPORT
00024 # define _DOUBLE_SUPPORT
00025
00026 #include "stdinc.h"
00027 #include "star_state.h"
00028
00029 class double_star;
00030 struct double_init;
00031 enum binary_type {Strong_Encounter=-1, Unknown_Binary_Type=0,
00032 Synchronized, Detached,
00033 Semi_Detached, Contact, Common_Envelope,
00034 Double_Spiral_In,
00035 Merged, Disrupted, Spiral_In};
00036
00037 char * type_string(binary_type);
00038 double_star * get_new_binary(double_init&, const int);
00039 binary_type extract_binary_type_string(char*);
00040
00041
00042
00043
00044
00045 struct double_hist
00046 {
00047 public:
00048 real binary_age;
00049 real semi;
00050 real eccentricity;
00051
00052 real donor_timescale;
00053
00054 void put_double_hist();
00055 void clean() {binary_age=semi=eccentricity=donor_timescale=0;}
00056 };
00057
00058
00059
00060
00061
00062 struct double_init
00063 {
00064 public:
00065
00066 real start_time;
00067 real end_time;
00068 int n_steps;
00069
00070 real mass_prim;
00071 real semi;
00072 real q;
00073 real eccentricity;
00074
00075
00076 void clean() {end_time=mass_prim=semi=q=eccentricity=0;}
00077 void read_element();
00078 void put_element();
00079 void dump(ostream &);
00080 void dump(char*);
00081
00082 };
00083
00084
00085
00086
00087
00088 struct double_state
00089 {
00090 int identity;
00091
00092 real time;
00093 binary_type type;
00094
00095 real semi;
00096 real ecc;
00097 real velocity;
00098
00099
00100 real total_mass;
00101
00102 star_state primary;
00103 star_state secondary;
00104
00105 void make_double_state(double_star*, star*, star*);
00106 void init_double_state(double_star*, star*, star*);
00107 void clean() {
00108 type=Detached;
00109 total_mass=0;
00110 }
00111 };
00112 double_state make_state(double_star*);
00113 void put_state(double_state, ostream& s = cerr);
00114
00115
00116
00117
00118
00119 struct double_profile
00120 {
00121
00122 double_state init;
00123 double_state final;
00124
00125 real mdot;
00126
00127 void init_double_profile(double_star*, star_state&, star_state&);
00128 void init_double_profile(double_star*);
00129 void enhance_double_profile(double_star*, star_state&, star_state&);
00130 void enhance_double_profile(double_star*);
00131
00132 };
00133
00134 void make_profile(int, real, double_profile&, double_init&);
00135 void put_profile(double_profile&);
00136
00137
00138
00139
00140
00141
00142
00143 void ppperiod(real period, ostream & s = cerr, char *p ="Porb");
00144 void pptime(real time, ostream & s = cerr, char *t = "time");
00145
00146
00147 real period_to_semi(real period, real m_prim, real m_sec);
00148 real semi_to_period(real semi, real m_prim, real m_sec);
00149
00150 #endif // _DOUBLE_SUPPORT
00151