Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

energy.C

Go to the documentation of this file.
00001 
00006 
00007 #include "dyn.h"
00008 
00009 #ifdef TOOLBOX
00010 
00011 main(int argc, char **argv)
00012 {
00013     dyn *root;
00014     int  e_flag = 0;
00015     real eps = 0;
00016 
00017     check_help();
00018 
00019     extern char *poptarg;
00020     int c;
00021     char* param_string = "e:";
00022 
00023     while ((c = pgetopt(argc, argv, param_string)) != -1)
00024         switch(c) {
00025             case 'e': e_flag = 1;
00026                       eps = atof(poptarg);
00027                       break;
00028             case '?': params_to_usage(cerr, argv[0], param_string);
00029                       get_help();
00030                       exit(1);
00031         }
00032 
00033     // Loop over input until no more data remain.
00034 
00035     while ( (root = get_dyn(cin)) != NULL) {
00036 
00037         real kinetic_energy, potential_energy;
00038         get_top_level_energies(root, eps*eps, potential_energy, kinetic_energy);
00039 
00040         cout << "Top-level energies (T, U, E):  "
00041              << kinetic_energy << "  "
00042              << potential_energy << "  "
00043              << kinetic_energy + potential_energy 
00044              << endl;
00045     }
00046 }
00047 
00048 #endif
00049 
00050 // endof: energy.C

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