00001
00002
00003
00004
00005 #include "disintegrated.h"
00006
00007 #include "super_giant.h"
00008
00009 #include "helium_giant.h"
00010
00011
00012 disintegrated::disintegrated(super_giant & g) : single_star(g) {
00013
00014 delete &g;
00015
00016 for (int i=Emission; i<no_of_spec_type; i++)
00017 spec_type[i] = NAC;
00018 spec_type[Dsntgr] = Dsntgr;
00019
00020 suddenly_lost_mass = 0;
00021
00022 super_nova();
00023
00024 core_mass = envelope_mass = cnsts.safety(minimum_mass_step);
00025 radius = effective_radius = core_radius = 0;
00026 luminosity = 1;
00027 velocity = 0;
00028 wind_constant = accreted_mass = 0;
00029 magnetic_field = rotation_period = 0;
00030 birth_mass=0;
00031
00032 if (is_binary_component() &&
00033 get_binary()->get_bin_type()!=Merged)
00034 get_binary()->set_bin_type(Disrupted);
00035
00036 instantaneous_element();
00037
00038 post_constructor();
00039
00040 if (is_binary_component()) {
00041 get_binary()->set_first_contact(false);
00042 get_companion()->set_spec_type(Accreting, false);
00043 get_binary()->dump("binev.data", false);
00044 }
00045 else {
00046 dump("binev.data", false);
00047 }
00048 }
00049
00050 disintegrated::disintegrated(helium_giant & h) : single_star(h) {
00051
00052 delete &h;
00053
00054 for (int i=Emission; i<no_of_spec_type; i++)
00055 spec_type[i] = NAC;
00056 spec_type[Dsntgr] = Dsntgr;
00057
00058 suddenly_lost_mass = 0;
00059
00060 super_nova();
00061
00062 core_mass = envelope_mass = cnsts.safety(minimum_mass_step);
00063 radius = effective_radius = core_radius = 0;
00064 luminosity = 1;
00065 velocity = 0;
00066 wind_constant = accreted_mass = 0;
00067 magnetic_field = rotation_period = 0;
00068 birth_mass=0;
00069
00070 if (is_binary_component() &&
00071 get_binary()->get_bin_type()!=Merged)
00072 get_binary()->set_bin_type(Disrupted);
00073
00074 instantaneous_element();
00075
00076 post_constructor();
00077
00078 if (is_binary_component()) {
00079 get_binary()->set_first_contact(false);
00080 get_companion()->set_spec_type(Accreting, false);
00081 get_binary()->dump("binev.data", false);
00082 }
00083 else {
00084 dump("binev.data", false);
00085 }
00086 }
00087
00088 disintegrated::disintegrated(white_dwarf & w) : single_star(w) {
00089
00090
00091 delete &w;
00092
00093 for (int i=Emission; i<no_of_spec_type; i++)
00094 spec_type[i] = NAC;
00095 spec_type[Dsntgr] = Dsntgr;
00096
00097 suddenly_lost_mass = 0;
00098
00099 super_nova();
00100
00101 core_mass = envelope_mass = cnsts.safety(minimum_mass_step);
00102 radius = effective_radius = core_radius = 0;
00103 luminosity = 1;
00104 velocity = 0;
00105 wind_constant = accreted_mass = 0;
00106 magnetic_field = rotation_period = 0;
00107 birth_mass=0;
00108
00109 if (is_binary_component() &&
00110 get_binary()->get_bin_type()!=Merged)
00111 get_binary()->set_bin_type(Disrupted);
00112
00113 instantaneous_element();
00114
00115 post_constructor();
00116
00117 if (is_binary_component()) {
00118 get_binary()->set_first_contact(false);
00119 get_companion()->set_spec_type(Accreting, false);
00120 get_binary()->dump("binev.data", false);
00121 }
00122 else {
00123 dump("binev.data", false);
00124 }
00125 }
00126
00127 void disintegrated::instantaneous_element() {
00128
00129 evolve_element(relative_age);
00130 }
00131
00132 void disintegrated::evolve_element(const real end_time) {
00133
00134 real dt = end_time - current_time;
00135 current_time = end_time;
00136 relative_age += dt;
00137
00138 next_update_age = relative_age + cnsts.safety(maximum_timestep);
00139
00140 update();
00141 }
00142
00143 void disintegrated::update() {
00144
00145
00146
00147
00148 }
00149
00150 bool disintegrated::super_nova() {
00151
00152 suddenly_lost_mass = get_total_mass();
00153
00154 bool hit_companion = FALSE;
00155 spec_type[Dsntgr]=Dsntgr;
00156
00157 return hit_companion;
00158 }
00159
00160
00161 real disintegrated::mass_transfer_timescale(mass_transfer_type
00162 &type) {
00163
00164 cerr << "disintegrated::mass_transfer_timescale()" << endl;
00165 cerr << "Disintegrated cannot be donor star!"<<endl;
00166 cerr << "ABSOLUTE_DT_MIN (" << cnsts.safety(minimum_timestep)
00167 << ") returned." << endl;
00168
00169 return cnsts.safety(minimum_timestep);
00170 }
00171
00172 star* disintegrated::subtrac_mass_from_donor(const real dt, real& mdot) {
00173
00174 cerr << "disintegrated::subtrac_mass_from_donor(dt="
00175 << dt << ", mdot=" << mdot << ")" << endl;
00176 cerr << "Disintegrated cannot be donor star!"<<endl;
00177
00178 return this;
00179 }
00180
00181 real disintegrated::add_mass_to_accretor(const real mdot) {
00182
00183 cerr << "disintegrated::add_mass_to_accretor(mdot="
00184 << mdot << ")" <<endl;
00185
00186 return 0;
00187
00188 }
00189
00190 real disintegrated::add_mass_to_accretor(real mdot, const real dt) {
00191
00192 cerr << "disintegrated::add_mass_to_accretor(mdot="
00193 << mdot << ", dt=" << dt << ")" <<endl;
00194
00195 return 0;
00196
00197 }
00198
00199 star* disintegrated::merge_elements(star* str) {
00200
00201 cerr << "void disintegrated::merge_stars()"<<endl;
00202
00203 spec_type[Merger]=Merger;
00204
00205 return this;
00206 }
00207
00208
00209 star* disintegrated::reduce_mass(const real mdot) {
00210
00211 return this;
00212 }
00213
00214 real disintegrated::temperature() {
00215 return 1;
00216 }
00217
00218 real disintegrated::magnitude() {
00219 return 100;
00220 }
00221
00222 real disintegrated::bolometric_correction() {
00223 return 0;
00224 }
00225
00226 void disintegrated::stellar_wind(const real dt) {
00227 }
00228
00229 real disintegrated::sudden_mass_loss() {
00230
00231 real mass_lost = suddenly_lost_mass;
00232 suddenly_lost_mass = 0;
00233
00234 return mass_lost;
00235
00236 }
00237
00238 real disintegrated::gyration_radius_sq() {
00239
00240 return 0;
00241 }