HG-MD  1
Statistics.h
Go to the documentation of this file.
00001 #ifndef STATISTICS_H
00002 #define STATISTICS_H
00003 #include "StatisticsVector.h"
00004 
00006 void Statistics(unsigned int argc, char *argv[]) {      
00007         
00008         if (argc>1&&strcmp(argv[1],"-help")) cout << endl << "Get statistics for " << argv[1] << endl;
00009 
00010         //check for '-stattype' option
00011         StatType T = XYZ;
00012         for (unsigned int i = 2; i<argc; i++) {
00013                 if (!strcmp(argv[i],"-stattype")) {
00014                         if (!strcmp(argv[i+1],"XYZ")) T = XYZ;
00015                         else if (!strcmp(argv[i+1],"XY")) T = XY;
00016                         else if (!strcmp(argv[i+1],"XZ")) T = XZ;
00017                         else if (!strcmp(argv[i+1],"YZ")) T = YZ;
00018                         else if (!strcmp(argv[i+1],"X")) T = X;
00019                         else if (!strcmp(argv[i+1],"Y")) T = Y;
00020                         else if (!strcmp(argv[i+1],"Z")) T = Z;
00021                         else if (!strcmp(argv[i+1],"O")) T = O;
00022                         else {cerr << "stattype unknown" << endl; exit(-1);}
00023                 }
00024         }
00025         if (T==XY) { // averaging in z-direction
00026                 cout << "averaging in z-direction" << endl;
00027                 StatisticsVector<XY> stats(argc, argv);
00028                 stats.set_periodicWalls(false);
00029                 stats.statistics_from_fstat_and_data();
00030         } else if (T==XZ) { // averaging in y-direction
00031                 cout << "averaging in y-direction" << endl;
00032                 StatisticsVector<XZ> stats(argc, argv);
00033                 stats.set_periodicWalls(false);
00034                 stats.statistics_from_fstat_and_data();
00035         } else if (T==YZ) { // averaging in x-direction
00036                 cout << "averaging in x-direction" << endl;
00037                 StatisticsVector<YZ> stats(argc, argv);
00038                 stats.set_periodicWalls(false);
00039                 stats.statistics_from_fstat_and_data();
00040         } else if (T==X) { // averaging in yz-direction
00041                 cout << "averaging in yz-direction" << endl;
00042                 StatisticsVector<X> stats(argc, argv);
00043                 stats.set_periodicWalls(false);
00044                 stats.statistics_from_fstat_and_data();
00045         } else if (T==Y) { // averaging in yz-direction
00046                 cout << "averaging in xz-direction" << endl;
00047                 StatisticsVector<Y> stats(argc, argv);
00048                 stats.set_periodicWalls(false);
00049                 stats.statistics_from_fstat_and_data();
00050         } else if (T==Z) { // averaging in yz-direction
00051                 cout << "averaging in xy-direction" << endl;
00052                 StatisticsVector<Z> stats(argc, argv);
00053                 stats.set_periodicWalls(false);
00054                 stats.statistics_from_fstat_and_data();
00055         } else { //default: no averaging
00056                 StatisticsVector<XYZ> stats(argc, argv);
00057                 stats.statistics_from_fstat_and_data();
00058         }
00059 
00060 }
00061         
00062 #endif
00063 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines