MercuryDPM  Beta
 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 34 of file Statistics.h.

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

35 {
36 
37  if (argc > 1 && strcmp(argv[1], "-help"))
38  std::cout << std::endl << "Get statistics for " << argv[1] << std::endl;
39 
40  //check for '-stattype' option
41  StatType T = XYZ;
42  for (unsigned int i = 2; i < argc; i++)
43  {
44  if (!strcmp(argv[i], "-stattype"))
45  {
46  if (!strcmp(argv[i + 1], "XYZ"))
47  T = XYZ;
48  else if (!strcmp(argv[i + 1], "RAZ"))
49  T = RAZ;
50  else if (!strcmp(argv[i + 1], "RA"))
51  T = RA;
52  else if (!strcmp(argv[i + 1], "RZ"))
53  T = RZ;
54  else if (!strcmp(argv[i + 1], "AZ"))
55  T = AZ;
56  else if (!strcmp(argv[i + 1], "R"))
57  T = R;
58  else if (!strcmp(argv[i + 1], "A"))
59  T = A;
60  else if (!strcmp(argv[i + 1], "XY"))
61  T = XY;
62  else if (!strcmp(argv[i + 1], "XZ"))
63  T = XZ;
64  else if (!strcmp(argv[i + 1], "YZ"))
65  T = YZ;
66  else if (!strcmp(argv[i + 1], "X"))
67  T = X;
68  else if (!strcmp(argv[i + 1], "Y"))
69  T = Y;
70  else if (!strcmp(argv[i + 1], "Z"))
71  T = Z;
72  else if (!strcmp(argv[i + 1], "O"))
73  T = O;
74  else
75  {
76  std::cerr << "stattype unknown" << std::endl;
77  exit(-1);
78  }
79  }
80  }
81  if (T == XY)
82  { // averaging in z-direction
83  std::cout << "averaging in z-direction" << std::endl;
84  StatisticsVector<XY> stats(argc, argv);
85  stats.setDoPeriodicWalls(false);
86  stats.statistics_from_fstat_and_data();
87  }
88  else if (T == XY)
89  { // averaging in y-direction
90  std::cout << "averaging in y-direction" << std::endl;
91  StatisticsVector<XY> stats(argc, argv);
92  stats.setDoPeriodicWalls(false);
93  stats.statistics_from_fstat_and_data();
94  }
95  else if (T == XZ)
96  { // averaging in y-direction
97  std::cout << "averaging in y-direction" << std::endl;
98  StatisticsVector<XZ> stats(argc, argv);
99  stats.setDoPeriodicWalls(false);
100  stats.statistics_from_fstat_and_data();
101  }
102  else if (T == YZ)
103  { // averaging in x-direction
104  std::cout << "averaging in x-direction" << std::endl;
105  StatisticsVector<YZ> stats(argc, argv);
106  stats.setDoPeriodicWalls(false);
107  stats.statistics_from_fstat_and_data();
108  }
109  else if (T == X)
110  { // averaging in yz-direction
111  std::cout << "averaging in yz-direction" << std::endl;
112  StatisticsVector<X> stats(argc, argv);
113  stats.setDoPeriodicWalls(false);
114  stats.statistics_from_fstat_and_data();
115  }
116  else if (T == Y)
117  { // averaging in yz-direction
118  std::cout << "averaging in xz-direction" << std::endl;
119  StatisticsVector<Y> stats(argc, argv);
120  stats.setDoPeriodicWalls(false);
121  stats.statistics_from_fstat_and_data();
122  }
123  else if (T == Z)
124  { // averaging in yz-direction
125  std::cout << "averaging in xy-direction" << std::endl;
126  StatisticsVector<Z> stats(argc, argv);
127  stats.setDoPeriodicWalls(false);
128  stats.statistics_from_fstat_and_data();
129  }
130  else if (T == O)
131  { // averaging in all directions
132  std::cout << "averaging in xyz-direction" << std::endl;
133  StatisticsVector<O> stats(argc, argv);
134  stats.setDoPeriodicWalls(false);
135  stats.statistics_from_fstat_and_data();
136  }
137  else if (T == RAZ)
138  { //no averaging
139  std::cout << "cylindrical, no averaging" << std::endl;
140  StatisticsVector<RAZ> stats(argc, argv);
141  stats.statistics_from_fstat_and_data();
142  }
143  else if (T == RA)
144  { //no averaging
145  std::cout << "cylindrical, Z averaging" << std::endl;
146  StatisticsVector<RA> stats(argc, argv);
147  stats.statistics_from_fstat_and_data();
148  }
149  else if (T == RZ)
150  { //no averaging
151  std::cout << "cylindrical, A averaging" << std::endl;
152  StatisticsVector<RZ> stats(argc, argv);
153  stats.statistics_from_fstat_and_data();
154  }
155  else if (T == AZ)
156  { //no averaging
157  std::cout << "cylindrical, R averaging" << std::endl;
158  StatisticsVector<AZ> stats(argc, argv);
159  stats.statistics_from_fstat_and_data();
160  }
161  else if (T == A)
162  { //no averaging
163  std::cout << "cylindrical, RZ averaging" << std::endl;
164  StatisticsVector<A> stats(argc, argv);
165  stats.statistics_from_fstat_and_data();
166  }
167  else if (T == R)
168  { //no averaging
169  std::cout << "cylindrical, AZ averaging" << std::endl;
170  StatisticsVector<R> stats(argc, argv);
171  stats.statistics_from_fstat_and_data();
172  }
173  else if (T == XYZ)
174  { //no averaging
175  std::cout << "no averaging" << std::endl;
176  StatisticsVector<XYZ> stats(argc, argv);
177  stats.statistics_from_fstat_and_data();
178  }
179 
180 }
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.