Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

makepyth.C

Go to the documentation of this file.
00001 
00006 
00007 //   version 1:  Nov 1994   Piet Hut               email: piet@iassns.bitnet
00008 //                          Institute for Advanced Study, Princeton, NJ, USA
00009 //.............................................................................
00010 //     litt: Szebehely, V. and Peters, C.F., 1967, Astron. J. 72, 876.
00011 //.............................................................................
00012 
00013 #include "dyn.h"
00014 
00015 #ifdef TOOLBOX
00016 
00017 main(int argc, char ** argv)
00018     {
00019     int  i;
00020     bool  c_flag = FALSE;
00021     bool  i_flag = FALSE;
00022     char  *comment;
00023 
00024     check_help();
00025 
00026     extern char *poptarg;
00027     int c;
00028     char* param_string = "c:i";
00029 
00030     while ((c = pgetopt(argc, argv, param_string)) != -1)
00031         switch(c)
00032             {
00033             case 'c': c_flag = TRUE;
00034                       comment = poptarg;
00035                       break;
00036             case 'i': i_flag = TRUE;
00037                       break;
00038             case '?': params_to_usage(cerr, argv[0], param_string);
00039                       get_help();
00040                       exit(1);
00041             }            
00042     
00043     dyn b, b1, b2, b3;
00044     if (i_flag)
00045         {
00046         b1.set_label(1);
00047         b2.set_label(2);
00048         b3.set_label(3);
00049         }
00050     b.set_oldest_daughter(&b1);
00051     b1.set_parent(&b);
00052     b2.set_parent(&b);
00053     b3.set_parent(&b);
00054 
00055     b1.set_younger_sister(&b2);
00056     b2.set_elder_sister(&b1);
00057     b2.set_younger_sister(&b3);
00058     b3.set_elder_sister(&b2);
00059 
00060     if (c_flag == TRUE)
00061         b.log_comment(comment);
00062     b.log_history(argc, argv);
00063 
00064     b1.set_mass(3);
00065     b2.set_mass(4);
00066     b3.set_mass(5);
00067 
00068     b1.set_pos(vector(1,3,0));
00069     b2.set_pos(vector(-2,-1,0));
00070     b3.set_pos(vector(1,-1,0));
00071 
00072     b.to_com();
00073 
00074     put_node(cout, b);
00075     }
00076 
00077 #endif
00078 
00079 /* end of: mkpyth.c */

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