//Stellar wind routine borrowed from class helium_star void hyper_giant::stellar_wind(const real dt) { if (relative_mass<cnsts.parameters(massive_star_mass_limit)) return; real wind_mass = wind_constant * dt; if (wind_mass>=envelope_mass) { wind_mass = envelope_mass; radius = core_radius; } if (is_binary_component()) get_binary()->adjust_binary_after_wind_loss(this, wind_mass, dt); else reduce_donor_mass(wind_mass); return; }
void star_cluster::stellar_wind(const real dt) { if (!get_use_hdyn()) cerr << " No stellar dynamical information present in star_cluster" << endl; real wind_mass = mass_loss_by_evolution(dt); // PRC(wind_mass); if (wind_mass >= envelope_mass) wind_mass = envelope_mass; if (is_binary_component()) get_binary()->adjust_binary_after_wind_loss(this, wind_mass, dt); else reduce_mass(wind_mass); return; }
static void prt_nesc_function_hdr(data_declaration fn_decl, psd_options options) /* Effects: prints the C function declaration for fn_decl */ { /* We print the declaration from the interface rather than that of fn_decl itself, as this latter may use not-yet-defined typedefs. prt_declarator will use the name from fn_decl in its output. */ variable_decl ifn_vd = CAST(variable_decl, fn_decl->ast); data_decl fn_dd = CAST(data_decl, ifn_vd->parent); psd_options opts; function_declarator fd; asttype ret; prt_diff_info(fn_decl); set_location(fn_dd->location); if (!is_binary_component(fn_decl->container->impl)) output("static "); /* Functions returning a network type should return the base type instead */ if (is_function_declarator(ifn_vd->declarator)) opts = psd_rewrite_nxbase; else opts = 0; options |= psd_rename_parameters; fd = get_fdeclarator(ifn_vd->declarator); /* Handle nesdoc-overridden return type */ if (fd && (ret = fd->return_type)) { prt_attribute_elements(fn_dd->modifiers); prt_type_elements(ret->qualifiers, opts); prt_declarator(ret->declarator, NULL, ifn_vd->attributes, fn_decl, options | psd_print_ddecl_fdeclarator); } else { prt_type_elements(fn_dd->modifiers, opts); prt_declarator(ifn_vd->declarator, NULL, ifn_vd->attributes, fn_decl, options); } }
void single_star::star_transformation_story(stellar_type new_type) { char info_line[MAX_STORY_LINE_LENGTH]; stellar_type old_type = get_element_type(); real time = get_current_time(); sprintf(info_line, "%s_to_%s_at_time = %6.2f", type_string(old_type), type_string(new_type), time); add_story_line(get_node()->get_log_story(), info_line); // cerr output for debugging! cerr << endl << get_node()->format_label() << " " << info_line << " Myr (old mass = " << get_total_mass() << ")" << endl; if(is_binary_component()) { #if 0 // This should be fixed some time SPZ:26/02/03 if(get_binary()->obtain_binary_type() == Merged) { cerr << "binary is merged." << endl; } else if(get_binary()->obtain_binary_type() == Disrupted) { cerr << "binary is disrupted, other component: " << endl << type_string(get_companion()->get_element_type()) << endl; } else { cerr << "binary companion: " << type_string(get_companion()->get_element_type()) << endl; } #endif cerr << "binary companion: " << type_string(get_companion()->get_element_type()) << endl; cerr << "parent: " << get_node()->get_parent()->format_label() << endl; } }