Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

reflect_velocities.C

Go to the documentation of this file.
00001 
00007 
00008 //   Piet Hut, Nov. 1994
00009 
00010 #include "dyn.h"
00011 
00012 #ifdef TOOLBOX
00013 
00014 local void  flip_velocities(dyn * b)
00015 {
00016     dyn * bi;
00017 
00018     b->scale_vel(-1);
00019 
00020     for (bi=b->get_oldest_daughter(); bi != NULL; bi=bi->get_younger_sister())
00021         bi->scale_vel(-1);
00022 }
00023 
00024 
00025 main(int argc, char ** argv)
00026 {
00027     bool  c_flag = FALSE;
00028     char  *comment;
00029 
00030     check_help();
00031 
00032     extern char *poptarg;
00033     int c;
00034     char* param_string = "c:";
00035 
00036     while ((c = pgetopt(argc, argv, param_string)) != -1)
00037         switch(c) {
00038 
00039             case 'c': c_flag = TRUE;
00040                       comment = poptarg;
00041                       break;
00042             case '?': params_to_usage(cerr, argv[0], param_string);
00043                       get_help();
00044                       exit(1);
00045         }            
00046 
00047     dyn *b;
00048 
00049     while (b = get_dyn(cin)) {
00050 
00051         if (c_flag == TRUE)
00052             b->log_comment(comment);
00053         b->log_history(argc, argv);
00054 
00055         flip_velocities(b);
00056         put_dyn(cout, *b);      
00057         delete b;
00058     }
00059 }
00060 
00061 #endif
00062 
00063 // end of: reflect_velocities.C

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