Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

double_support.h

00001 
00002        //=======================================================//    _\|/_
00003       //  __  _____           ___                    ___       //      /|\ ~
00004      //  /      |      ^     |   \  |         ^     |   \     //          _\|/_
00005     //   \__    |     / \    |___/  |        / \    |___/    //            /|\ ~
00006    //       \   |    /___\   |  \   |       /___\   |   \   // _\|/_
00007   //     ___/   |   /     \  |   \  |____  /     \  |___/  //   /|\ ~
00008  //                                                       //            _\|/_
00009 //=======================================================//              /|\ ~
00010 
00011 /*
00012  *  double_support.h: derived class for element evolution systems.
00013  *          functions as derived class for the real elements.
00014  *.............................................................................
00015  *    version 1:  Feb 1994   Simon F. Portegies Zwart
00016  *    version 2:
00017  *.............................................................................
00018  *     This file includes:
00019  *  1) definition of class double_support
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  *  double_hist  -- base struct keeps track of double_star history.
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  *  double_init -- class double_star initial conditions.
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 //              More public access functions.
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  *  double_state -- class double_star initial conditions.
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 //      double_init       init;
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  *  double_profile -- class double_star profiler.
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 // Functions to perform a single binev experiement:
00138 //void  binev(double_star*, real, real, int);
00139 
00140 //              Independend initialization and constructor functions.
00141 //double_star * triple_star(double_init&, double_init&, int id=1);
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 

Generated on Wed Jul 20 12:43:36 2005 for Starlab by  doxygen 1.4.3