MercuryDPM  Alpha
 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")||!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 == XZ)
89  { // averaging in y-direction
90  std::cout << "averaging in y-direction" << std::endl;
91  StatisticsVector<XZ> stats(argc, argv);
92  //std::cout << "Hello" << std::endl;
93  stats.setDoPeriodicWalls(false);
94  stats.statistics_from_fstat_and_data();
95  }
96  else if (T == YZ)
97  { // averaging in x-direction
98  std::cout << "averaging in x-direction" << std::endl;
99  StatisticsVector<YZ> stats(argc, argv);
100  stats.setDoPeriodicWalls(false);
101  stats.statistics_from_fstat_and_data();
102  }
103  else if (T == X)
104  { // averaging in yz-direction
105  std::cout << "averaging in yz-direction" << std::endl;
106  StatisticsVector<X> stats(argc, argv);
107  stats.setDoPeriodicWalls(false);
108  stats.statistics_from_fstat_and_data();
109  }
110  else if (T == Y)
111  { // averaging in yz-direction
112  std::cout << "averaging in xz-direction" << std::endl;
113  StatisticsVector<Y> stats(argc, argv);
114  stats.setDoPeriodicWalls(false);
115  stats.statistics_from_fstat_and_data();
116  }
117  else if (T == Z)
118  { // averaging in yz-direction
119  std::cout << "averaging in xy-direction" << std::endl;
120  StatisticsVector<Z> stats(argc, argv);
121  stats.setDoPeriodicWalls(false);
122  stats.statistics_from_fstat_and_data();
123  }
124  else if (T == O)
125  { // averaging in all directions
126  std::cout << "averaging in xyz-direction" << std::endl;
127  StatisticsVector<O> stats(argc, argv);
128  stats.setDoPeriodicWalls(false);
129  stats.statistics_from_fstat_and_data();
130  }
131  else if (T == RAZ)
132  { //no averaging
133  std::cout << "cylindrical, no averaging" << std::endl;
134  StatisticsVector<RAZ> stats(argc, argv);
135  stats.statistics_from_fstat_and_data();
136  }
137  else if (T == RA)
138  { //no averaging
139  std::cout << "cylindrical, Z averaging" << std::endl;
140  StatisticsVector<RA> stats(argc, argv);
141  stats.statistics_from_fstat_and_data();
142  }
143  else if (T == RZ)
144  { //no averaging
145  std::cout << "cylindrical, A averaging" << std::endl;
146  StatisticsVector<RZ> stats(argc, argv);
147  stats.statistics_from_fstat_and_data();
148  }
149  else if (T == AZ)
150  { //no averaging
151  std::cout << "cylindrical, R averaging" << std::endl;
152  StatisticsVector<AZ> stats(argc, argv);
153  stats.statistics_from_fstat_and_data();
154  }
155  else if (T == A)
156  { //no averaging
157  std::cout << "cylindrical, RZ averaging" << std::endl;
158  StatisticsVector<A> stats(argc, argv);
159  stats.statistics_from_fstat_and_data();
160  }
161  else if (T == R)
162  { //no averaging
163  std::cout << "cylindrical, AZ averaging" << std::endl;
164  StatisticsVector<R> stats(argc, argv);
165  stats.statistics_from_fstat_and_data();
166  }
167  else if (T == XYZ)
168  { //no averaging
169  std::cout << "no averaging" << std::endl;
170  StatisticsVector<XYZ> stats(argc, argv);
171  stats.statistics_from_fstat_and_data();
172  }
173 
174 }
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.