Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

hydro_io.C

Go to the documentation of this file.
00001 //
00002 // hydro_io.C
00003 //
00004 
00005 #include "hydro.h"
00006 #include "util_io.h"
00007 
00008 istream & hydro::scan_hydro_story(istream& s)
00009 {
00010     char input_line[MAX_INPUT_LINE_LENGTH];
00011 
00012     while(get_line(s,input_line), !matchbracket(END_HYDRO, input_line)){
00013 
00014         char keyword[MAX_INPUT_LINE_LENGTH];
00015         char *val = getequals(input_line, keyword);
00016 
00017         if(0){   // trick to keep the if() statement, for the else below
00018         }else if(!strcmp("R_eff",keyword)){
00019             effective_radius = strtod(val, &val);
00020         }else if(!strcmp("mf",keyword)){
00021             m_conv_hydro_to_dyn = strtod(val, &val);
00022         }else if(!strcmp("rf",keyword)){
00023             r_conv_hydro_to_dyn = strtod(val, &val);
00024         }else if(!strcmp("tf",keyword)){
00025             t_conv_hydro_to_dyn = strtod(val, &val);
00026         }else{
00027             add_story_line(hydro_story, input_line);
00028         }
00029     }
00030     return s;
00031 }
00032 
00033 ostream& hydro::print_hydro_story(ostream& s)
00034 {
00035     put_story_header(s, HYDRO_ID);
00036 
00037     put_real_number(s, "  R_eff =  ", effective_radius);
00038 
00039     put_real_number(s, "  mf =  ", m_conv_hydro_to_dyn);
00040     put_real_number(s, "  rf =  ", r_conv_hydro_to_dyn);
00041     put_real_number(s, "  tf =  ", t_conv_hydro_to_dyn);
00042 
00043     if (hydro_story)
00044         put_story_contents(s, *hydro_story);
00045     put_story_footer(s, HYDRO_ID);
00046     
00047     return s;
00048 }
00049 

Generated at Sun Feb 24 09:57:04 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001