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
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