MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Statistics.h File Reference
#include "StatisticsVector.h"

Go to the source code of this file.

Functions

void Statistics (unsigned int argc, char *argv[])
 this is the function the user should call More...
 

Function Documentation

void Statistics ( unsigned int  argc,
char *  argv[] 
)

this is the function the user should call

Definition at line 31 of file Statistics.h.

References A, AZ, O, R, RA, RAZ, RZ, StatisticsVector< T >::set_periodicWalls(), StatisticsVector< T >::statistics_from_fstat_and_data(), X, XY, XYZ, XZ, Y, YZ, and Z.

31  {
32 
33  if (argc>1&&strcmp(argv[1],"-help")) std::cout << std::endl << "Get statistics for " << argv[1] << std::endl;
34 
35  //check for '-stattype' option
36  StatType T = XYZ;
37  for (unsigned int i = 2; i<argc; i++) {
38  if (!strcmp(argv[i],"-stattype")) {
39  if (!strcmp(argv[i+1],"XYZ")) T = XYZ;
40  else if (!strcmp(argv[i+1],"RAZ")) T = RAZ;
41  else if (!strcmp(argv[i+1],"RA")) T = RA;
42  else if (!strcmp(argv[i+1],"RZ")) T = RZ;
43  else if (!strcmp(argv[i+1],"AZ")) T = AZ;
44  else if (!strcmp(argv[i+1],"R")) T = R;
45  else if (!strcmp(argv[i+1],"A")) T = A;
46  else if (!strcmp(argv[i+1],"XY")) T = XY;
47  else if (!strcmp(argv[i+1],"XZ")) T = XZ;
48  else if (!strcmp(argv[i+1],"YZ")) T = YZ;
49  else if (!strcmp(argv[i+1],"X")) T = X;
50  else if (!strcmp(argv[i+1],"Y")) T = Y;
51  else if (!strcmp(argv[i+1],"Z")) T = Z;
52  else if (!strcmp(argv[i+1],"O")) T = O;
53  else {std::cerr << "stattype unknown" << std::endl; exit(-1);}
54  }
55  }
56  if (T==XY) { // averaging in z-direction
57  std::cout << "averaging in z-direction" << std::endl;
58  StatisticsVector<XY> stats(argc, argv);
59  stats.set_periodicWalls(false);
60  stats.statistics_from_fstat_and_data();
61  } else if (T==XY) { // averaging in y-direction
62  std::cout << "averaging in y-direction" << std::endl;
63  StatisticsVector<XY> stats(argc, argv);
64  stats.set_periodicWalls(false);
65  stats.statistics_from_fstat_and_data();
66  } else if (T==XZ) { // averaging in y-direction
67  std::cout << "averaging in y-direction" << std::endl;
68  StatisticsVector<XZ> stats(argc, argv);
69  stats.set_periodicWalls(false);
70  stats.statistics_from_fstat_and_data();
71  } else if (T==YZ) { // averaging in x-direction
72  std::cout << "averaging in x-direction" << std::endl;
73  StatisticsVector<YZ> stats(argc, argv);
74  stats.set_periodicWalls(false);
75  stats.statistics_from_fstat_and_data();
76  } else if (T==X) { // averaging in yz-direction
77  std::cout << "averaging in yz-direction" << std::endl;
78  StatisticsVector<X> stats(argc, argv);
79  stats.set_periodicWalls(false);
80  stats.statistics_from_fstat_and_data();
81  } else if (T==Y) { // averaging in yz-direction
82  std::cout << "averaging in xz-direction" << std::endl;
83  StatisticsVector<Y> stats(argc, argv);
84  stats.set_periodicWalls(false);
85  stats.statistics_from_fstat_and_data();
86  } else if (T==Z) { // averaging in yz-direction
87  std::cout << "averaging in xy-direction" << std::endl;
88  StatisticsVector<Z> stats(argc, argv);
89  stats.set_periodicWalls(false);
90  stats.statistics_from_fstat_and_data();
91  } else if (T==O) { // averaging in all directions
92  std::cout << "averaging in xyz-direction" << std::endl;
93  StatisticsVector<O> stats(argc, argv);
94  stats.set_periodicWalls(false);
95  stats.statistics_from_fstat_and_data();
96  } else if (T==RAZ) { //no averaging
97  std::cout << "cylindrical, no averaging" << std::endl;
98  StatisticsVector<RAZ> stats(argc, argv);
99  stats.statistics_from_fstat_and_data();
100  } else if (T==RA) { //no averaging
101  std::cout << "cylindrical, Z averaging" << std::endl;
102  StatisticsVector<RA> stats(argc, argv);
103  stats.statistics_from_fstat_and_data();
104  } else if (T==RZ) { //no averaging
105  std::cout << "cylindrical, A averaging" << std::endl;
106  StatisticsVector<RZ> stats(argc, argv);
107  stats.statistics_from_fstat_and_data();
108  } else if (T==AZ) { //no averaging
109  std::cout << "cylindrical, R averaging" << std::endl;
110  StatisticsVector<AZ> stats(argc, argv);
111  stats.statistics_from_fstat_and_data();
112  } else if (T==A) { //no averaging
113  std::cout << "cylindrical, RZ averaging" << std::endl;
114  StatisticsVector<A> stats(argc, argv);
115  stats.statistics_from_fstat_and_data();
116  } else if (T==R) { //no averaging
117  std::cout << "cylindrical, AZ averaging" << std::endl;
118  StatisticsVector<R> stats(argc, argv);
119  stats.statistics_from_fstat_and_data();
120  } else if (T==XYZ) { //no averaging
121  std::cout << "no averaging" << std::endl;
122  StatisticsVector<XYZ> stats(argc, argv);
123  stats.statistics_from_fstat_and_data();
124  }
125 
126 }
StatType
Creates averaged statistics (only valid if density field is homogenous along averaged direction) ...
This class is used to extract statistical data from MD simulations.