MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Statistics.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2014, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef STATISTICS_H
27 #define STATISTICS_H
28 #include "StatisticsVector.h"
29 
31 void Statistics(unsigned int argc, char *argv[]) {
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);
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);
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);
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);
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);
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);
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);
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);
96  } else if (T==RAZ) { //no averaging
97  std::cout << "cylindrical, no averaging" << std::endl;
98  StatisticsVector<RAZ> stats(argc, argv);
100  } else if (T==RA) { //no averaging
101  std::cout << "cylindrical, Z averaging" << std::endl;
102  StatisticsVector<RA> stats(argc, argv);
104  } else if (T==RZ) { //no averaging
105  std::cout << "cylindrical, A averaging" << std::endl;
106  StatisticsVector<RZ> stats(argc, argv);
108  } else if (T==AZ) { //no averaging
109  std::cout << "cylindrical, R averaging" << std::endl;
110  StatisticsVector<AZ> stats(argc, argv);
112  } else if (T==A) { //no averaging
113  std::cout << "cylindrical, RZ averaging" << std::endl;
114  StatisticsVector<A> stats(argc, argv);
116  } else if (T==R) { //no averaging
117  std::cout << "cylindrical, AZ averaging" << std::endl;
118  StatisticsVector<R> stats(argc, argv);
120  } else if (T==XYZ) { //no averaging
121  std::cout << "no averaging" << std::endl;
122  StatisticsVector<XYZ> stats(argc, argv);
124  }
125 
126 }
127 
128 #endif
129 
StatType
Creates averaged statistics (only valid if density field is homogenous along averaged direction) ...
void statistics_from_fstat_and_data()
get StatisticsPoint
void set_periodicWalls(bool new_)
This class is used to extract statistical data from MD simulations.
void Statistics(unsigned int argc, char *argv[])
this is the function the user should call
Definition: Statistics.h:31