StatisticsVector.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, 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 STATISTICSVECTOR_H
27 #define STATISTICSVECTOR_H
28 
29 #include "DPMBase.h"
30 #include "Math/Matrix.h"
31 #include "Math/MatrixSymmetric.h"
32 #include <string.h>
33 #include <fstream>
34 #include <math.h>
36 
41 {
42  O, X, Y, Z, XY, XZ, YZ, XYZ, RAZ, RZ, AZ, RA, R, A
43 };
44 
46 #include "StatisticsPoint.h"
47 
60 template<StatType T>
61 class StatisticsVector : public virtual DPMBase
62 {
63 public:
67  void constructor();
68 
72  void constructor(std::string name);
73 
78  {
79  constructor();
80  }
81 
85  StatisticsVector(std::string name)
86  {
88  }
89 
94 
98  StatisticsVector(int argc, char* argv[]);
99 
103  void readStatArguments(int argc, char* argv[]);
104 
108  std::string printStat();
109 
113  void set_statType();
114 
116 
120  void print_help();
121 
122  //set functions should be called before executing the statistical routine
123 
127  void setNX(int new_)
128  {
129  nx = new_;
130  }
131 
135  void set_hx(Mdouble hx)
136  {
137  setNX(static_cast<int>(std::ceil((getXMaxStat() - getXMinStat()) / hx)));
138  }
139 
143  void setNY(int new_)
144  {
145  ny = new_;
146  }
147 
151  void set_hy(Mdouble hy)
152  {
153  setNY(static_cast<int>(std::ceil((getYMaxStat() - getYMinStat()) / hy)));
154  }
155 
159  void setNZ(int new_)
160  {
161  nz = new_;
162  if (getSystemDimensions() < 3)
163  {
164  logger(WARN, "Warning in set_nz: dimension less than 3");
165  }
166  }
167 
171  void set_hz(Mdouble hz)
172  {
173  setNZ(static_cast<int>(std::ceil((getZMaxStat() - getZMinStat()) / hz)));
174  }
175 
179  void setN(int n)
180  {
181  setNX(n);
182  setNY(n);
183  setNZ(n);
184  }
185 
189  void set_h(Mdouble h)
190  {
191  set_hx(h);
192  set_hy(h);
193  set_hz(h);
194  }
195 
199  int getNX()
200  {
201  return nx;
202  }
203 
207  int getNY()
208  {
209  return ny;
210  }
211 
215  int getNZ()
216  {
217  return nz;
218  }
219 
224  {
225  tMinStat = t;
226  }
227 
232  {
233  tMaxStat = t;
234  }
235 
240  {
241  tIntStat = t;
242  }
243 
248  {
249  return tMinStat;
250  }
251 
256  {
257  if (std::isnan(tMaxStat))
258  return getTimeMax();
259  else
260  return tMaxStat;
261  }
262 
267  {
268  return tIntStat;
269  }
270 
275  {
276  return (getTime() >= getCGTimeMin() && getTime() <= getTimeMaxStat() + getTimeStep());
277  }
278 
279 
283  void setCGShape(const char* new_);
284 
288  void setCGShape(CG_TYPE new_);
289 
294  {
295  return CG_type;
296  }
297 
301  void setN(int nx_, int ny_, int nz_)
302  {
303  nx = nx_;
304  ny = ny_;
305  nz = nz_;
306  }
307 
308  void getN(int& nx_, int& ny_, int& nz_)
309  {
310  nx_ = nx;
311  ny_ = ny;
312  nz_ = nz;
313  }
314 
315 
318  {
320  }
321 
322 
326  void setCGWidth2(Mdouble new_);
327 
332  {
333  return std::sqrt(w2);
334  }
335 
340  {
341  return w2;
342  }
343 
348  {
349  return cutoff;
350  }
351 
356  {
357  return mathsFunc::square(cutoff);
358  }
359 
360 
361  //~ bool get_boundedDomain() {return boundedDomain;};
362  //~ void set_boundedDomain(bool new_) {boundedDomain=new_;};
363 
367  std::string print_CG();
368 
373 
377  virtual void reset_statistics();
378 
383 
388 
392  void jump_p3c();
393 
397  void setDoTimeAverage(bool new_)
398  {
399  doTimeAverage = new_;
400  }
401 
406  {
407  return doTimeAverage;
408  }
409 
410 
415  {
417  }
418 
423  {
425  }
426 
427 
428  // to keep compatible with older versions
433  {
434  StressTypeForFixedParticles = 2 + new_;
435  }
436 
437 
442  {
443  mirrorAtDomainBoundary = new_;
444  }
445 
450  {
451  return mirrorAtDomainBoundary;
452  }
453 
454 
458  void setDoVariance(bool new_)
459  {
460  doVariance = new_;
461  }
462 
467  {
468  return doVariance;
469  }
470 
471 
475  void setDoGradient(bool new_)
476  {
477  doGradient = new_;
478  }
479 
484  {
485  return doGradient;
486  }
487 
491  void setSuperExact(bool new_)
492  {
493  superexact = new_;
494  }
495 
500  {
501  return superexact;
502  }
503 
508  {
509  ignoreFixedParticles = new_;
510  }
511 
516  {
517  return ignoreFixedParticles;
518  }
519 
523  void verbose()
524  {
525  verbosity = 2;
526  }
527 
531  void setVerbosityLevel(int new_)
532  {
533  verbosity = new_;
534  }
535 
539  int getVerbosityLevel() const
540  {
541  return verbosity;
542  }
543 
547  void setCGWidthalls(bool new_)
548  {
549  walls = new_;
550  }
551 
556  {
557  return walls;
558  }
559 
563  void setDoPeriodicWalls(bool new_)
564  {
565  periodicWalls = new_;
566  }
567 
572  {
573  return periodicWalls;
574  }
575 
576 
581  {
582  w_over_rmax = new_;
583  }
584 
589  {
590  return w_over_rmax;
591  }
592 
593 
597  void setPositions();
598 
602  bool readNextDataFile(unsigned int format);
603 
608 
613 
617  void gather_force_statistics_from_p3w(int version, std::vector<int>& index);
618 
622  void evaluate_force_statistics(int wp = 0);
623 
628 
632  void jump_fstat();
633 
638 
643 
647  void gatherContactStatistics(unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta,
648  Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential);
649 
653  void processStatistics(bool usethese);
654 
659 
664 
669 
673  void evaluate_particle_statistics(std::vector<BaseParticle*>::iterator P, int wp = 0);
674 
678  std::vector<StatisticsPoint<T> > getCGPoints()
679  {
680  return Points;
681  }
682 
687  {
688  if (std::isnan(xMinStat))
689  return getXMin();
690  else
691  return xMinStat;
692  }
693 
698  {
699  if (std::isnan(yMinStat))
700  return getYMin();
701  else
702  return yMinStat;
703  }
704 
709  {
710  if (std::isnan(zMinStat))
711  return getZMin();
712  else
713  return zMinStat;
714  }
715 
720  {
721  if (std::isnan(xMaxStat))
722  return getXMax();
723  else
724  return xMaxStat;
725  }
726 
731  {
732  if (std::isnan(yMaxStat))
733  return getYMax();
734  else
735  return yMaxStat;
736  }
737 
742  {
743  if (std::isnan(zMaxStat))
744  return getZMax();
745  else
746  return zMaxStat;
747  }
748 
752  void setXMinStat(Mdouble xMinStat_)
753  {
754  xMinStat = xMinStat_;
755  }
756 
760  void setYMinStat(Mdouble yMinStat_)
761  {
762  yMinStat = yMinStat_;
763  }
764 
768  void setZMinStat(Mdouble zMinStat_)
769  {
770  zMinStat = zMinStat_;
771  }
772 
776  void setXMaxStat(Mdouble xMaxStat_)
777  {
778  xMaxStat = xMaxStat_;
779  }
780 
784  void setYMaxStat(Mdouble yMaxStat_)
785  {
786  yMaxStat = yMaxStat_;
787  }
788 
792  void setZMaxStat(Mdouble zMaxStat_)
793  {
794  zMaxStat = zMaxStat_;
795  }
796 
801  {
802  return nTimeAverage;
803  }
804 
809 
810  void set_Polynomial(std::vector<Mdouble> new_coefficients, unsigned int new_dim)
811  {
812  CGPolynomial.set_polynomial(new_coefficients, new_dim);
813  }
814 
818  void set_Polynomial(Mdouble* new_coefficients, unsigned int num_coeff, unsigned int new_dim)
819  {
820  CGPolynomial.set_polynomial(new_coefficients, num_coeff, new_dim);
821  }
822 
826  void setPolynomialName(const char* new_name)
827  {
828  CGPolynomial.setName(new_name);
829  }
830 
834  std::string getPolynomialName()
835  {
836  return CGPolynomial.getName();
837  }
838 
842  void setDoDoublePoints(bool new_)
843  {
844  doDoublePoints = new_;
845  }
846 
851  {
852  return doDoublePoints;
853  }
854 
858  void setNTimeAverageReset(int new_)
859  {
860  nTimeAverageReset = new_;
861  }
862 
867  {
868  return nTimeAverageReset;
869  }
870 
874  void set_rmin(Mdouble new_)
875  {
876  rmin = new_;
877  }
878 
882  void set_rmax(Mdouble new_)
883  {
884  rmax = new_;
885  }
886 
890  void set_hmax(Mdouble new_)
891  {
892  hmax = new_;
893  }
894 
899  {
900  return CGPolynomial.evaluate(r);
901  }
902 
907  {
908  return CGPolynomial.evaluateGradient(r);
909  }
910 
915  {
916  return CGPolynomial.evaluateIntegral(n1, n2, t);
917  }
918 
922  unsigned int getStepSize() const
923  {
924  return stepSize_;
925  }
926 
930  void setStepSize(unsigned int stepSize)
931  {
932  stepSize_ = stepSize;
933  }
934 
938  void setIndSpecies(unsigned int indSpecies)
939  {
940  this->indSpecies = indSpecies;
941  }
942  //Member Variables
943 protected:
944 
945  //General Variables
953  int nx;
954  int ny;
955  int nz;
964 
965  //Storage of points and gradients
969  std::vector<StatisticsPoint<T> > Points;
973  std::vector<StatisticsPoint<T> > dx;
977  std::vector<StatisticsPoint<T> > dy;
981  std::vector<StatisticsPoint<T> > dz;
982 
983  //For time averaging
987  std::vector<StatisticsPoint<T> > timeAverage;
988 
992  std::vector<StatisticsPoint<T> > timeVariance;
993 
997  std::vector<StatisticsPoint<T> > dxTimeAverage;
998 
1002  std::vector<StatisticsPoint<T> > dyTimeAverage;
1003 
1007  std::vector<StatisticsPoint<T> > dzTimeAverage;
1008 
1013 
1018 
1023 
1028 
1033 
1034  //Coarse graining variables
1043 
1044  // ///<if true, then the course-graining function will be cut at the domain boundaries and resized to satisfy int(W) = 1
1045  // bool boundedDomain;
1046 
1051 
1056 
1061 
1062  //Options that can be set before evaluation
1063 
1068 
1073 
1078 
1083 
1089 
1094 
1099 
1103  bool walls;
1104 
1110 
1115 
1124 
1132 
1133  int format;
1134 
1139 
1141  bool isMDCLR;
1144 
1145  //uses close points to allow calculation of gradients
1147 
1152 
1153  //Variables communicate values between member functions #evaluate_force_statistics and #gatherContactStatistics)used to communicate values between member functions evaluate_force_statistics and gather_force_statistics
1182 
1186  bool loadVelocityProfile(const char* filename);
1187 
1188  bool loadPositions(const char* filename);
1189 
1194 
1198  std::vector<Vec3D> VelocityProfile;
1199 
1204 
1209 
1210  std::fstream p3p_file;
1211  std::fstream p3c_file;
1212  std::fstream p3w_file;
1213  bool p3Format = true;
1214 
1219 
1224 
1225  unsigned int stepSize_;
1226 
1227  std::vector<Vec3D> positions_;
1228 
1229  bool centerPointInFStat_ = true;
1230 };
1231 
1232 #include "StatisticsPoint.hcc"
1233 #include "StatisticsVector.hcc"
1234 
1235 #endif
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ WARN
CG_TYPE
enum used to store the type of coarse-graining function used
Definition: StatisticsPoint.h:31
StatType
Creates averaged statistics (only valid if density field is homogenous along averaged direction)
Definition: StatisticsVector.h:41
@ AZ
Definition: StatisticsVector.h:42
@ XY
Definition: StatisticsVector.h:42
@ XZ
Definition: StatisticsVector.h:42
@ R
Definition: StatisticsVector.h:42
@ RA
Definition: StatisticsVector.h:42
@ YZ
Definition: StatisticsVector.h:42
@ A
Definition: StatisticsVector.h:42
@ Y
Definition: StatisticsVector.h:42
@ X
Definition: StatisticsVector.h:42
@ Z
Definition: StatisticsVector.h:42
@ XYZ
Definition: StatisticsVector.h:42
@ RAZ
Definition: StatisticsVector.h:42
@ RZ
Definition: StatisticsVector.h:42
@ O
Definition: StatisticsVector.h:42
Definition: BaseParticle.h:54
Definition: SpeedTestParticleInteractions.cpp:36
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1430
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644
Implementation of a 3D matrix.
Definition: Matrix.h:38
Implementation of a 3D symmetric matrix.
Definition: MatrixSymmetric.h:37
This class is used to define polynomial axisymmetric coarse-graining functions.
Definition: NormalisedPolynomial.h:52
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:62
std::vector< StatisticsPoint< T > > dx
A vector that stores the gradient in x of all statistical variables at a given position.
Definition: StatisticsVector.h:973
bool getDoIgnoreFixedParticles()
Definition: StatisticsVector.h:515
void write_statistics()
Writes regular statistics.
void gather_force_statistics_from_p3c(int version)
bool read_next_from_p3p_file()
void setCGShape(const char *new_)
Mdouble P1_P2_distance
Length of contact line.
Definition: StatisticsVector.h:1161
bool getCGWidthalls()
Definition: StatisticsVector.h:555
bool doVariance
Determines if variance is outputted.
Definition: StatisticsVector.h:1022
Mdouble getCGTimeAveragingInterval()
Definition: StatisticsVector.h:266
Vec3D getVelocityProfile(Vec3D Position)
void evaluate_force_statistics(int wp=0)
Vec3D P1_P2_normal
Direction of contact.
Definition: StatisticsVector.h:1159
bool doDoublePoints
Definition: StatisticsVector.h:1146
bool p3Format
Definition: StatisticsVector.h:1213
Mdouble yMinStat
Definition: StatisticsVector.h:959
void setPositions()
Set position of StatisticsPoint points and set variables to 0.
int getNX()
Definition: StatisticsVector.h:199
void setCGWidth_over_rmax(Mdouble new_)
Definition: StatisticsVector.h:580
void setN(int nx_, int ny_, int nz_)
Definition: StatisticsVector.h:301
std::vector< Vec3D > positions_
Definition: StatisticsVector.h:1227
int getVerbosityLevel() const
Definition: StatisticsVector.h:539
Matrix3D P1_P2_NormalStress
Contact stress from normal forces along the line of contact.
Definition: StatisticsVector.h:1163
Mdouble w_over_rmax
if w is not set manually then w will be set by multiplying this value by the largest particle radius ...
Definition: StatisticsVector.h:1060
void readStatArguments(int argc, char *argv[])
void set_rmin(Mdouble new_)
Definition: StatisticsVector.h:874
Mdouble evaluatePolynomialGradient(Mdouble r)
Definition: StatisticsVector.h:906
bool doTimeAverage
Determines if output is averaged over time.
Definition: StatisticsVector.h:1012
int getStressTypeForFixedParticles()
Definition: StatisticsVector.h:422
Mdouble getCGTimeMin()
Definition: StatisticsVector.h:247
void setStepSize(unsigned int stepSize)
Definition: StatisticsVector.h:930
std::fstream p3p_file
Definition: StatisticsVector.h:1210
bool readNextDataFile(unsigned int format)
void setDoVariance(bool new_)
Definition: StatisticsVector.h:458
bool loadPositions(const char *filename)
Mdouble cutoff2
Definition: StatisticsVector.h:1055
bool check_current_time_for_statistics()
Definition: StatisticsVector.h:274
void set_hmax(Mdouble new_)
Definition: StatisticsVector.h:890
void evaluate_particle_statistics(std::vector< BaseParticle * >::iterator P, int wp=0)
Calculates statistics for a single Particle.
bool getDoDoublePoints()
Definition: StatisticsVector.h:850
Mdouble getYMaxStat()
Definition: StatisticsVector.h:730
int getNTimeAverage()
Definition: StatisticsVector.h:800
int getNZ()
Definition: StatisticsVector.h:215
void setYMaxStat(Mdouble yMaxStat_)
Definition: StatisticsVector.h:784
Mdouble getCutoff()
Definition: StatisticsVector.h:347
Vec3D P1_P2_NormalTraction
Traction from normal forces at contact of flow with fixed particles or walls.
Definition: StatisticsVector.h:1171
void evaluate_wall_force_statistics(Vec3D P, int wp=0)
void constructor(std::string name)
Mdouble getXMaxStat()
Definition: StatisticsVector.h:719
void set_Polynomial(std::vector< Mdouble > new_coefficients, unsigned int new_dim)
Definition: StatisticsVector.h:810
Vec3D P1
Position of first contact point.
Definition: StatisticsVector.h:1155
void finishStatistics()
Finish all statistics (i.e. write out final data)
Mdouble indSpecies
defines the species for which statistics are extracted (-1 for all species)
Definition: StatisticsVector.h:1082
unsigned int stepSize_
Definition: StatisticsVector.h:1225
bool loadVelocityProfile(const char *filename)
void setN(int n)
Definition: StatisticsVector.h:179
void setCGWidthalls(bool new_)
Definition: StatisticsVector.h:547
NORMALIZED_POLYNOMIAL< T > CGPolynomial
Stores the Polynomial, if the cg function is an axisymmetric function Polynomial in r.
Definition: StatisticsVector.h:1042
MatrixSymmetric3D P1_P2_Fabric
Fabric.
Definition: StatisticsVector.h:1175
Mdouble getCGWidth_over_rmax()
Definition: StatisticsVector.h:588
bool satisfiesInclusionCriteria(BaseParticle *P)
void setStressTypeForFixedParticles(int new_)
Definition: StatisticsVector.h:414
void outputStatistics()
Calculates statistics for Particles (i.e. not collisions)
int ny
see nx
Definition: StatisticsVector.h:954
Mdouble tMinStat
Statistical output will only be created if t>tMinStat.
Definition: StatisticsVector.h:1067
Mdouble zMaxStat
Definition: StatisticsVector.h:959
Mdouble getZMaxStat()
Definition: StatisticsVector.h:741
void setCGShape(CG_TYPE new_)
void setZMaxStat(Mdouble zMaxStat_)
Definition: StatisticsVector.h:792
bool walls
Turns off walls before evaluation.
Definition: StatisticsVector.h:1103
void setDoIgnoreFixedParticles(bool new_)
Definition: StatisticsVector.h:507
int getNY()
Definition: StatisticsVector.h:207
int nz
see nx
Definition: StatisticsVector.h:955
Mdouble xMinStat
By default the domain is set to the domain of the MD problem (indicated by setting the stat-domain va...
Definition: StatisticsVector.h:959
int format
format of the data input file
Definition: StatisticsVector.h:1133
void setCGWidth2(Mdouble new_)
Set CG variables w2 and CG_invvolume.
void setXMaxStat(Mdouble xMaxStat_)
Definition: StatisticsVector.h:776
void setDoGradient(bool new_)
Definition: StatisticsVector.h:475
StatisticsPoint< T > average(std::vector< StatisticsPoint< T > > &P)
Output average of statistical variables.
void setMirrorAtDomainBoundary(Mdouble new_)
Definition: StatisticsVector.h:441
void gatherContactStatistics(unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta, Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential)
Calculates statistics for one collision (can be any kind of collision)
std::vector< StatisticsPoint< T > > dz
A vector that stores the gradient in z of all statistical variables at a given position.
Definition: StatisticsVector.h:981
void setNTimeAverageReset(int new_)
Definition: StatisticsVector.h:858
StatisticsVector(StatisticsVector &other)
Copy constructor.
std::vector< StatisticsPoint< T > > timeVariance
a vector used to sum up the variance in time of all statistical values
Definition: StatisticsVector.h:992
bool getNTimeAverageReset()
Definition: StatisticsVector.h:866
Mdouble getYMinStat()
Definition: StatisticsVector.h:697
void set_Polynomial(Mdouble *new_coefficients, unsigned int num_coeff, unsigned int new_dim)
Definition: StatisticsVector.h:818
void set_infiniteStressForFixedParticles(bool new_)
Definition: StatisticsVector.h:432
Mdouble getTimeMaxStat()
Definition: StatisticsVector.h:255
Mdouble rmax
defines the maximum radius of the particles for which statistics are extracted
Definition: StatisticsVector.h:1093
void setDoDoublePoints(bool new_)
Definition: StatisticsVector.h:842
Mdouble tIntStat
Statistical output will only be created if tMaxStat-tIntStat< t< tMaxStat.
Definition: StatisticsVector.h:1077
Mdouble getXMinStat()
Functions to acces and change the domain of statistics.
Definition: StatisticsVector.h:686
unsigned int getStepSize() const
Definition: StatisticsVector.h:922
Vec3D VelocityProfile_D
Definition: StatisticsVector.h:1208
std::string print_CG()
Output coarse graining variables.
std::vector< StatisticsPoint< T > > timeAverage
A vector used to sum up all statistical values in Points for time-averaging.
Definition: StatisticsVector.h:987
std::vector< StatisticsPoint< T > > dxTimeAverage
a vector used to sum up all statistical gradients in dx for time-averaging
Definition: StatisticsVector.h:997
std::vector< StatisticsPoint< T > > getCGPoints()
Definition: StatisticsVector.h:678
void setVerbosityLevel(int new_)
Definition: StatisticsVector.h:531
Mdouble P1_P2_Dissipation
not yet working
Definition: StatisticsVector.h:1179
void processStatistics(bool usethese)
Processes all gathered statistics and resets them afterwards. (Processing means either calculating ti...
Mdouble rmin
defines the minimum radius of the particles for which statistics are extracted
Definition: StatisticsVector.h:1088
void setPolynomialName(const char *new_name)
Definition: StatisticsVector.h:826
void setCGTimeAveragingInterval(Mdouble t)
Definition: StatisticsVector.h:239
bool centerPointInFStat_
Definition: StatisticsVector.h:1229
void setSuperExact(bool new_)
Definition: StatisticsVector.h:491
StatType statType
Possible values X,Y,Z,XY,XZ,YZ,XYZ,RAZ,RA,RZ,AZ,R,A are used to determine if the statistics are avera...
Definition: StatisticsVector.h:949
Mdouble getCGWidth()
Definition: StatisticsVector.h:331
Mdouble getMirrorAtDomainBoundary()
Definition: StatisticsVector.h:449
std::vector< StatisticsPoint< T > > dzTimeAverage
a vector used to sum up all statistical gradients in dz for time-averaging
Definition: StatisticsVector.h:1007
void setXMinStat(Mdouble xMinStat_)
Definition: StatisticsVector.h:752
std::fstream p3w_file
Definition: StatisticsVector.h:1212
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
void setNX(int new_)
Definition: StatisticsVector.h:127
bool doGradient
Determines if gradient is outputted.
Definition: StatisticsVector.h:1027
void set_hy(Mdouble hy)
Definition: StatisticsVector.h:151
bool getDoVariance()
Definition: StatisticsVector.h:466
std::vector< Vec3D > VelocityProfile
Definition: StatisticsVector.h:1198
Mdouble getCutoff2()
Definition: StatisticsVector.h:355
int nTimeAverageReset
Determines after how many time steps the time average is reset.
Definition: StatisticsVector.h:1017
Mdouble cutoff
The distance from the origin at which the cg function vanishes; cutoff=w for HeavisideSphere or Polyn...
Definition: StatisticsVector.h:1055
void write_time_average_statistics()
Writes out time averaged statistics.
bool periodicWalls
Turns off periodic walls before evaluation (needed for averaging, because we do not yet check if part...
Definition: StatisticsVector.h:1109
Vec3D P1_P2_Contact
Definition: StatisticsVector.h:1167
bool getDoPeriodicWalls()
Definition: StatisticsVector.h:571
Mdouble xMaxStat
Definition: StatisticsVector.h:959
int nx
Grid size nx,ny,nz (by default the points of evaluation are placed in an grid on the domain [xMinStat...
Definition: StatisticsVector.h:953
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
Matrix3D P1_P2_ContactCoupleStress
Definition: StatisticsVector.h:1165
std::string printStat()
Outputs member variable values to a std::string.
Vec3D VelocityProfile_Min
Definition: StatisticsVector.h:1203
std::string getPolynomialName()
Definition: StatisticsVector.h:834
bool getDoTimeAverage()
Definition: StatisticsVector.h:405
Mdouble P1_P2_Potential
not yet working
Definition: StatisticsVector.h:1181
std::vector< StatisticsPoint< T > > Points
A vector that stores the values of the statistical variables at a given position.
Definition: StatisticsVector.h:969
Mdouble getZMinStat()
Definition: StatisticsVector.h:708
bool isMDCLR
Definition: StatisticsVector.h:1141
void constructor()
this is the actual constructor, sets up all basic things
StatisticsVector(std::string name)
Definition: StatisticsVector.h:85
bool getSuperExact()
Definition: StatisticsVector.h:499
void setZMinStat(Mdouble zMinStat_)
Definition: StatisticsVector.h:768
void statistics_from_p3()
void setNZ(int new_)
Definition: StatisticsVector.h:159
int StressTypeForFixedParticles
Stress type for fixed particles.
Definition: StatisticsVector.h:1123
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
StatisticsVector(int argc, char *argv[])
Advanced constructor that accepts arguments from the command line.
std::vector< StatisticsPoint< T > > dyTimeAverage
a vector used to sum up all statistical gradients in dy for time-averaging
Definition: StatisticsVector.h:1002
Mdouble evaluatePolynomial(Mdouble r)
Definition: StatisticsVector.h:898
void initialiseStatistics()
Initializes statistics, i.e. setting w2, setting the grid and writing the header lines in the ....
void getN(int &nx_, int &ny_, int &nz_)
Definition: StatisticsVector.h:308
Matrix3D P1_P2_TangentialStress
Contact stress from tangential forces along the line of contact.
Definition: StatisticsVector.h:1169
void setDoTimeAverage(bool new_)
Definition: StatisticsVector.h:397
Vec3D P1_P2_CollisionalHeatFlux
not yet working
Definition: StatisticsVector.h:1177
void autoSetSystemDimensions()
void verbose()
Definition: StatisticsVector.h:523
CG_TYPE getCGShape()
Definition: StatisticsVector.h:293
void set_hx(Mdouble hx)
Definition: StatisticsVector.h:135
void setTimeMaxStat(Mdouble t)
Definition: StatisticsVector.h:231
Mdouble yMaxStat
Definition: StatisticsVector.h:959
void gather_force_statistics_from_p3w(int version, std::vector< int > &index)
void setIndSpecies(unsigned int indSpecies)
Definition: StatisticsVector.h:938
Mdouble hmax
defines the maximum height of the particles for which statistics are extracted
Definition: StatisticsVector.h:1098
Mdouble getCGWidthSquared()
Definition: StatisticsVector.h:339
void set_rmax(Mdouble new_)
Definition: StatisticsVector.h:882
void set_h(Mdouble h)
Definition: StatisticsVector.h:189
int verbosity
Determines how much is outputted to the terminal.
Definition: StatisticsVector.h:1131
Mdouble mirrorAtDomainBoundary
0: Statistics near the wall are equal to statistics away from the wall; 1: Statistics are mirrored at...
Definition: StatisticsVector.h:1138
int nTimeAverage
A counter needed to average over time.
Definition: StatisticsVector.h:1032
void set_hz(Mdouble hz)
Definition: StatisticsVector.h:171
StatisticsVector()
Basic constructor only calls constructor()
Definition: StatisticsVector.h:77
void setNY(int new_)
Definition: StatisticsVector.h:143
bool getDoGradient()
Definition: StatisticsVector.h:483
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
Definition: StatisticsVector.h:914
void statistics_from_fstat_and_data()
get StatisticsPoint
std::fstream p3c_file
Definition: StatisticsVector.h:1211
int nxMirrored
extension of grid size from mirrored points
Definition: StatisticsVector.h:963
CG_TYPE CG_type
coarse graining type (Gaussian, Heaviside, Polynomial)
Definition: StatisticsVector.h:1038
virtual void reset_statistics()
Set all statistical variables to zero.
Mdouble zMinStat
Definition: StatisticsVector.h:959
Mdouble setInfinitelyLongDistance()
Vec3D P1_P2_TangentialTraction
Traction from tangential forces at contact of flow with fixed particles or walls.
Definition: StatisticsVector.h:1173
std::vector< StatisticsPoint< T > > dy
A vector that stores the gradient in y of all statistical variables at a given position.
Definition: StatisticsVector.h:977
Mdouble w2
coarse graining width squared; for HeavisideSphere and Gaussian
Definition: StatisticsVector.h:1050
int nyMirrored
Definition: StatisticsVector.h:963
void setYMinStat(Mdouble yMinStat_)
Definition: StatisticsVector.h:760
void writeOutputFiles()
Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and ....
bool superexact
If true, cutoff radius for Gaussian is set to 5*w (from 3*w)
Definition: StatisticsVector.h:1143
Vec3D P2
Position of second contact point.
Definition: StatisticsVector.h:1157
void gather_force_statistics_from_fstat_and_data()
bool ignoreFixedParticles
Determines if fixed particles contribute to particle statistics (density, ...)
Definition: StatisticsVector.h:1114
Mdouble tMaxStat
Statistical output will only be created if t<tMaxStat.
Definition: StatisticsVector.h:1072
int nzMirrored
Definition: StatisticsVector.h:963
Definition: Vector.h:51
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
std::string name
Definition: MercuryProb.h:48
This class stores statistical values for a given spatial position; to be used in combination with Sta...
Definition: StatisticsPoint.h:47