StatisticsVector.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef STATISTICSVECTOR_H
6 #define STATISTICSVECTOR_H
7 
8 #include "DPMBase.h"
9 #include "Math/Matrix.h"
10 #include "Math/MatrixSymmetric.h"
11 #include <string.h>
12 #include <fstream>
13 #include <math.h>
15 
20 {
21  O, X, Y, Z, XY, XZ, YZ, XYZ, RAZ, RZ, AZ, RA, R, A
22 };
23 
25 #include "StatisticsPoint.h"
26 
39 template<StatType T>
40 class StatisticsVector : public virtual DPMBase
41 {
42 public:
46  void constructor();
47 
52 
57  {
58  constructor();
59  }
60 
65  {
67  }
68 
73 
77  StatisticsVector(int argc, char* argv[]);
78 
82  void readStatArguments(int argc, char* argv[]);
83 
88 
92  void set_statType();
93 
95 
99  void print_help();
100 
101  //set functions should be called before executing the statistical routine
102 
106  void setNX(int new_)
107  {
108  nx = new_;
109  }
110 
114  void set_hx(Mdouble hx)
115  {
116  setNX(static_cast<int>(std::ceil((getXMaxStat() - getXMinStat()) / hx)));
117  }
118 
122  void setNY(int new_)
123  {
124  ny = new_;
125  }
126 
130  void set_hy(Mdouble hy)
131  {
132  setNY(static_cast<int>(std::ceil((getYMaxStat() - getYMinStat()) / hy)));
133  }
134 
138  void setNZ(int new_)
139  {
140  nz = new_;
141  if (getSystemDimensions() < 3)
142  {
143  logger(WARN, "Warning in set_nz: dimension less than 3");
144  }
145  }
146 
150  void set_hz(Mdouble hz)
151  {
152  setNZ(static_cast<int>(std::ceil((getZMaxStat() - getZMinStat()) / hz)));
153  }
154 
158  void setN(int n)
159  {
160  setNX(n);
161  setNY(n);
162  setNZ(n);
163  }
164 
168  void set_h(Mdouble h)
169  {
170  set_hx(h);
171  set_hy(h);
172  set_hz(h);
173  }
174 
178  int getNX()
179  {
180  return nx;
181  }
182 
186  int getNY()
187  {
188  return ny;
189  }
190 
194  int getNZ()
195  {
196  return nz;
197  }
198 
203  {
204  tMinStat = t;
205  }
206 
211  {
212  tMaxStat = t;
213  }
214 
219  {
220  tIntStat = t;
221  }
222 
227  {
228  return tMinStat;
229  }
230 
235  {
236  if (std::isnan(tMaxStat))
237  return getTimeMax();
238  else
239  return tMaxStat;
240  }
241 
246  {
247  return tIntStat;
248  }
249 
254  {
255  return (getTime() >= getCGTimeMin() && getTime() <= getTimeMaxStat() + getTimeStep());
256  }
257 
258 
262  void setCGShape(const char* new_);
263 
267  void setCGShape(CG_TYPE new_);
268 
273  {
274  return CG_type;
275  }
276 
280  void setN(int nx_, int ny_, int nz_)
281  {
282  nx = nx_;
283  ny = ny_;
284  nz = nz_;
285  }
286 
287  void getN(int& nx_, int& ny_, int& nz_)
288  {
289  nx_ = nx;
290  ny_ = ny;
291  nz_ = nz;
292  }
293 
294 
297  {
299  }
300 
301 
305  void setCGWidth2(Mdouble new_);
306 
311  {
312  return std::sqrt(w2);
313  }
314 
319  {
320  return w2;
321  }
322 
327  {
328  return cutoff;
329  }
330 
335  {
336  return mathsFunc::square(cutoff);
337  }
338 
339 
340  //~ bool get_boundedDomain() {return boundedDomain;};
341  //~ void set_boundedDomain(bool new_) {boundedDomain=new_;};
342 
347 
352 
356  virtual void reset_statistics();
357 
362 
367 
371  void jump_p3c();
372 
376  void setDoTimeAverage(bool new_)
377  {
378  doTimeAverage = new_;
379  }
380 
385  {
386  return doTimeAverage;
387  }
388 
389 
394  {
396  }
397 
402  {
404  }
405 
406 
407  // to keep compatible with older versions
412  {
413  StressTypeForFixedParticles = 2 + new_;
414  }
415 
416 
421  {
422  mirrorAtDomainBoundary = new_;
423  }
424 
429  {
430  return mirrorAtDomainBoundary;
431  }
432 
433 
437  void setDoVariance(bool new_)
438  {
439  doVariance = new_;
440  }
441 
446  {
447  return doVariance;
448  }
449 
450 
454  void setDoGradient(bool new_)
455  {
456  doGradient = new_;
457  }
458 
463  {
464  return doGradient;
465  }
466 
470  void setSuperExact(bool new_)
471  {
472  superexact = new_;
473  }
474 
479  {
480  return superexact;
481  }
482 
487  {
488  ignoreFixedParticles = new_;
489  }
490 
495  {
496  return ignoreFixedParticles;
497  }
498 
502  void verbose()
503  {
504  verbosity = 2;
505  }
506 
510  void setVerbosityLevel(int new_)
511  {
512  verbosity = new_;
513  }
514 
518  int getVerbosityLevel() const
519  {
520  return verbosity;
521  }
522 
526  void setCGWidthalls(bool new_)
527  {
528  walls = new_;
529  }
530 
535  {
536  return walls;
537  }
538 
542  void setDoPeriodicWalls(bool new_)
543  {
544  periodicWalls = new_;
545  }
546 
551  {
552  return periodicWalls;
553  }
554 
555 
560  {
561  w_over_rmax = new_;
562  }
563 
568  {
569  return w_over_rmax;
570  }
571 
572 
576  void setPositions();
577 
581  bool readNextDataFile(unsigned int format);
582 
587 
592 
596  void gather_force_statistics_from_p3w(int version, std::vector<int>& index);
597 
601  void evaluate_force_statistics(int wp = 0);
602 
607 
611  void jump_fstat();
612 
617 
622 
626  void gatherContactStatistics(unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta,
627  Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential);
628 
632  void processStatistics(bool usethese);
633 
638 
643 
648 
652  void evaluate_particle_statistics(std::vector<BaseParticle*>::iterator P, int wp = 0);
653 
657  std::vector<StatisticsPoint<T> > getCGPoints()
658  {
659  return Points;
660  }
661 
666  {
667  if (std::isnan(xMinStat))
668  return getXMin();
669  else
670  return xMinStat;
671  }
672 
677  {
678  if (std::isnan(yMinStat))
679  return getYMin();
680  else
681  return yMinStat;
682  }
683 
688  {
689  if (std::isnan(zMinStat))
690  return getZMin();
691  else
692  return zMinStat;
693  }
694 
699  {
700  if (std::isnan(xMaxStat))
701  return getXMax();
702  else
703  return xMaxStat;
704  }
705 
710  {
711  if (std::isnan(yMaxStat))
712  return getYMax();
713  else
714  return yMaxStat;
715  }
716 
721  {
722  if (std::isnan(zMaxStat))
723  return getZMax();
724  else
725  return zMaxStat;
726  }
727 
731  void setXMinStat(Mdouble xMinStat_)
732  {
733  xMinStat = xMinStat_;
734  }
735 
739  void setYMinStat(Mdouble yMinStat_)
740  {
741  yMinStat = yMinStat_;
742  }
743 
747  void setZMinStat(Mdouble zMinStat_)
748  {
749  zMinStat = zMinStat_;
750  }
751 
755  void setXMaxStat(Mdouble xMaxStat_)
756  {
757  xMaxStat = xMaxStat_;
758  }
759 
763  void setYMaxStat(Mdouble yMaxStat_)
764  {
765  yMaxStat = yMaxStat_;
766  }
767 
771  void setZMaxStat(Mdouble zMaxStat_)
772  {
773  zMaxStat = zMaxStat_;
774  }
775 
780  {
781  return nTimeAverage;
782  }
783 
788 
789  void set_Polynomial(std::vector<Mdouble> new_coefficients, unsigned int new_dim)
790  {
791  CGPolynomial.set_polynomial(new_coefficients, new_dim);
792  }
793 
797  void set_Polynomial(Mdouble* new_coefficients, unsigned int num_coeff, unsigned int new_dim)
798  {
799  CGPolynomial.set_polynomial(new_coefficients, num_coeff, new_dim);
800  }
801 
805  void setPolynomialName(const char* new_name)
806  {
807  CGPolynomial.setName(new_name);
808  }
809 
814  {
815  return CGPolynomial.getName();
816  }
817 
821  void setDoDoublePoints(bool new_)
822  {
823  doDoublePoints = new_;
824  }
825 
830  {
831  return doDoublePoints;
832  }
833 
837  void setNTimeAverageReset(int new_)
838  {
839  nTimeAverageReset = new_;
840  }
841 
846  {
847  return nTimeAverageReset;
848  }
849 
853  void set_rmin(Mdouble new_)
854  {
855  rmin = new_;
856  }
857 
861  void set_rmax(Mdouble new_)
862  {
863  rmax = new_;
864  }
865 
869  void set_hmax(Mdouble new_)
870  {
871  hmax = new_;
872  }
873 
878  {
879  return CGPolynomial.evaluate(r);
880  }
881 
886  {
887  return CGPolynomial.evaluateGradient(r);
888  }
889 
894  {
895  return CGPolynomial.evaluateIntegral(n1, n2, t);
896  }
897 
901  unsigned int getStepSize() const
902  {
903  return stepSize_;
904  }
905 
909  void setStepSize(unsigned int stepSize)
910  {
911  stepSize_ = stepSize;
912  }
913 
917  void setIndSpecies(unsigned int indSpecies)
918  {
919  this->indSpecies = indSpecies;
920  }
921  //Member Variables
922 protected:
923 
924  //General Variables
932  int nx;
933  int ny;
934  int nz;
943 
944  //Storage of points and gradients
948  std::vector<StatisticsPoint<T> > Points;
952  std::vector<StatisticsPoint<T> > dx;
956  std::vector<StatisticsPoint<T> > dy;
960  std::vector<StatisticsPoint<T> > dz;
961 
962  //For time averaging
966  std::vector<StatisticsPoint<T> > timeAverage;
967 
971  std::vector<StatisticsPoint<T> > timeVariance;
972 
976  std::vector<StatisticsPoint<T> > dxTimeAverage;
977 
981  std::vector<StatisticsPoint<T> > dyTimeAverage;
982 
986  std::vector<StatisticsPoint<T> > dzTimeAverage;
987 
992 
997 
1002 
1007 
1012 
1013  //Coarse graining variables
1022 
1023  // ///<if true, then the course-graining function will be cut at the domain boundaries and resized to satisfy int(W) = 1
1024  // bool boundedDomain;
1025 
1030 
1035 
1040 
1041  //Options that can be set before evaluation
1042 
1047 
1052 
1057 
1062 
1068 
1073 
1078 
1082  bool walls;
1083 
1089 
1094 
1103 
1111 
1112  int format;
1113 
1118 
1120  bool isMDCLR;
1123 
1124  //uses close points to allow calculation of gradients
1126 
1131 
1132  //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
1161 
1165  bool loadVelocityProfile(const char* filename);
1166 
1167  bool loadPositions(const char* filename);
1168 
1173 
1177  std::vector<Vec3D> VelocityProfile;
1178 
1183 
1188 
1189  std::fstream p3p_file;
1190  std::fstream p3c_file;
1191  std::fstream p3w_file;
1192  bool p3Format = true;
1193 
1198 
1203 
1204  unsigned int stepSize_;
1205 
1206  std::vector<Vec3D> positions_;
1207 
1208  bool centerPointInFStat_ = true;
1209 };
1210 
1211 #include "StatisticsPoint.hcc"
1212 #include "StatisticsVector.hcc"
1213 
1214 #endif
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ WARN
RowVector3d w
Definition: Matrix_resize_int.cpp:3
CG_TYPE
enum used to store the type of coarse-graining function used
Definition: StatisticsPoint.h:10
StatType
Creates averaged statistics (only valid if density field is homogenous along averaged direction)
Definition: StatisticsVector.h:20
@ AZ
Definition: StatisticsVector.h:21
@ XY
Definition: StatisticsVector.h:21
@ XZ
Definition: StatisticsVector.h:21
@ R
Definition: StatisticsVector.h:21
@ RA
Definition: StatisticsVector.h:21
@ YZ
Definition: StatisticsVector.h:21
@ Y
Definition: StatisticsVector.h:21
@ X
Definition: StatisticsVector.h:21
@ Z
Definition: StatisticsVector.h:21
@ XYZ
Definition: StatisticsVector.h:21
@ RAZ
Definition: StatisticsVector.h:21
@ RZ
Definition: StatisticsVector.h:21
@ O
Definition: StatisticsVector.h:21
Definition: BaseParticle.h:33
Definition: SpeedTestParticleInteractions.cpp:15
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1421
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:879
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:634
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
Implementation of a 3D symmetric matrix.
Definition: MatrixSymmetric.h:16
This class is used to define polynomial axisymmetric coarse-graining functions.
Definition: NormalisedPolynomial.h:31
This class is used to extract statistical data from MD simulations.
Definition: StatisticsVector.h:41
std::vector< StatisticsPoint< T > > dx
A vector that stores the gradient in x of all statistical variables at a given position.
Definition: StatisticsVector.h:952
bool getDoIgnoreFixedParticles()
Definition: StatisticsVector.h:494
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:1140
bool getCGWidthalls()
Definition: StatisticsVector.h:534
bool doVariance
Determines if variance is outputted.
Definition: StatisticsVector.h:1001
Mdouble getCGTimeAveragingInterval()
Definition: StatisticsVector.h:245
Vec3D getVelocityProfile(Vec3D Position)
void evaluate_force_statistics(int wp=0)
Vec3D P1_P2_normal
Direction of contact.
Definition: StatisticsVector.h:1138
bool doDoublePoints
Definition: StatisticsVector.h:1125
bool p3Format
Definition: StatisticsVector.h:1192
Mdouble yMinStat
Definition: StatisticsVector.h:938
void setPositions()
Set position of StatisticsPoint points and set variables to 0.
int getNX()
Definition: StatisticsVector.h:178
void setCGWidth_over_rmax(Mdouble new_)
Definition: StatisticsVector.h:559
void setN(int nx_, int ny_, int nz_)
Definition: StatisticsVector.h:280
std::vector< Vec3D > positions_
Definition: StatisticsVector.h:1206
int getVerbosityLevel() const
Definition: StatisticsVector.h:518
Matrix3D P1_P2_NormalStress
Contact stress from normal forces along the line of contact.
Definition: StatisticsVector.h:1142
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:1039
void readStatArguments(int argc, char *argv[])
void set_rmin(Mdouble new_)
Definition: StatisticsVector.h:853
Mdouble evaluatePolynomialGradient(Mdouble r)
Definition: StatisticsVector.h:885
bool doTimeAverage
Determines if output is averaged over time.
Definition: StatisticsVector.h:991
int getStressTypeForFixedParticles()
Definition: StatisticsVector.h:401
Mdouble getCGTimeMin()
Definition: StatisticsVector.h:226
void setStepSize(unsigned int stepSize)
Definition: StatisticsVector.h:909
std::fstream p3p_file
Definition: StatisticsVector.h:1189
bool readNextDataFile(unsigned int format)
void setDoVariance(bool new_)
Definition: StatisticsVector.h:437
bool loadPositions(const char *filename)
Mdouble cutoff2
Definition: StatisticsVector.h:1034
bool check_current_time_for_statistics()
Definition: StatisticsVector.h:253
void set_hmax(Mdouble new_)
Definition: StatisticsVector.h:869
void evaluate_particle_statistics(std::vector< BaseParticle * >::iterator P, int wp=0)
Calculates statistics for a single Particle.
bool getDoDoublePoints()
Definition: StatisticsVector.h:829
Mdouble getYMaxStat()
Definition: StatisticsVector.h:709
int getNTimeAverage()
Definition: StatisticsVector.h:779
int getNZ()
Definition: StatisticsVector.h:194
void setYMaxStat(Mdouble yMaxStat_)
Definition: StatisticsVector.h:763
Mdouble getCutoff()
Definition: StatisticsVector.h:326
Vec3D P1_P2_NormalTraction
Traction from normal forces at contact of flow with fixed particles or walls.
Definition: StatisticsVector.h:1150
void evaluate_wall_force_statistics(Vec3D P, int wp=0)
void constructor(std::string name)
Mdouble getXMaxStat()
Definition: StatisticsVector.h:698
void set_Polynomial(std::vector< Mdouble > new_coefficients, unsigned int new_dim)
Definition: StatisticsVector.h:789
Vec3D P1
Position of first contact point.
Definition: StatisticsVector.h:1134
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:1061
unsigned int stepSize_
Definition: StatisticsVector.h:1204
bool loadVelocityProfile(const char *filename)
void setN(int n)
Definition: StatisticsVector.h:158
void setCGWidthalls(bool new_)
Definition: StatisticsVector.h:526
NORMALIZED_POLYNOMIAL< T > CGPolynomial
Stores the Polynomial, if the cg function is an axisymmetric function Polynomial in r.
Definition: StatisticsVector.h:1021
MatrixSymmetric3D P1_P2_Fabric
Fabric.
Definition: StatisticsVector.h:1154
Mdouble getCGWidth_over_rmax()
Definition: StatisticsVector.h:567
bool satisfiesInclusionCriteria(BaseParticle *P)
void setStressTypeForFixedParticles(int new_)
Definition: StatisticsVector.h:393
void outputStatistics()
Calculates statistics for Particles (i.e. not collisions)
int ny
see nx
Definition: StatisticsVector.h:933
Mdouble tMinStat
Statistical output will only be created if t>tMinStat.
Definition: StatisticsVector.h:1046
Mdouble zMaxStat
Definition: StatisticsVector.h:938
Mdouble getZMaxStat()
Definition: StatisticsVector.h:720
void setCGShape(CG_TYPE new_)
void setZMaxStat(Mdouble zMaxStat_)
Definition: StatisticsVector.h:771
bool walls
Turns off walls before evaluation.
Definition: StatisticsVector.h:1082
void setDoIgnoreFixedParticles(bool new_)
Definition: StatisticsVector.h:486
int getNY()
Definition: StatisticsVector.h:186
int nz
see nx
Definition: StatisticsVector.h:934
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:938
int format
format of the data input file
Definition: StatisticsVector.h:1112
void setCGWidth2(Mdouble new_)
Set CG variables w2 and CG_invvolume.
void setXMaxStat(Mdouble xMaxStat_)
Definition: StatisticsVector.h:755
void setDoGradient(bool new_)
Definition: StatisticsVector.h:454
StatisticsPoint< T > average(std::vector< StatisticsPoint< T > > &P)
Output average of statistical variables.
void setMirrorAtDomainBoundary(Mdouble new_)
Definition: StatisticsVector.h:420
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:960
void setNTimeAverageReset(int new_)
Definition: StatisticsVector.h:837
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:971
bool getNTimeAverageReset()
Definition: StatisticsVector.h:845
Mdouble getYMinStat()
Definition: StatisticsVector.h:676
void set_Polynomial(Mdouble *new_coefficients, unsigned int num_coeff, unsigned int new_dim)
Definition: StatisticsVector.h:797
void set_infiniteStressForFixedParticles(bool new_)
Definition: StatisticsVector.h:411
Mdouble getTimeMaxStat()
Definition: StatisticsVector.h:234
Mdouble rmax
defines the maximum radius of the particles for which statistics are extracted
Definition: StatisticsVector.h:1072
void setDoDoublePoints(bool new_)
Definition: StatisticsVector.h:821
Mdouble tIntStat
Statistical output will only be created if tMaxStat-tIntStat< t< tMaxStat.
Definition: StatisticsVector.h:1056
Mdouble getXMinStat()
Functions to acces and change the domain of statistics.
Definition: StatisticsVector.h:665
unsigned int getStepSize() const
Definition: StatisticsVector.h:901
Vec3D VelocityProfile_D
Definition: StatisticsVector.h:1187
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:966
std::vector< StatisticsPoint< T > > dxTimeAverage
a vector used to sum up all statistical gradients in dx for time-averaging
Definition: StatisticsVector.h:976
std::vector< StatisticsPoint< T > > getCGPoints()
Definition: StatisticsVector.h:657
void setVerbosityLevel(int new_)
Definition: StatisticsVector.h:510
Mdouble P1_P2_Dissipation
not yet working
Definition: StatisticsVector.h:1158
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:1067
void setPolynomialName(const char *new_name)
Definition: StatisticsVector.h:805
void setCGTimeAveragingInterval(Mdouble t)
Definition: StatisticsVector.h:218
bool centerPointInFStat_
Definition: StatisticsVector.h:1208
void setSuperExact(bool new_)
Definition: StatisticsVector.h:470
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:928
Mdouble getCGWidth()
Definition: StatisticsVector.h:310
Mdouble getMirrorAtDomainBoundary()
Definition: StatisticsVector.h:428
std::vector< StatisticsPoint< T > > dzTimeAverage
a vector used to sum up all statistical gradients in dz for time-averaging
Definition: StatisticsVector.h:986
void setXMinStat(Mdouble xMinStat_)
Definition: StatisticsVector.h:731
std::fstream p3w_file
Definition: StatisticsVector.h:1191
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:202
void setNX(int new_)
Definition: StatisticsVector.h:106
bool doGradient
Determines if gradient is outputted.
Definition: StatisticsVector.h:1006
void set_hy(Mdouble hy)
Definition: StatisticsVector.h:130
bool getDoVariance()
Definition: StatisticsVector.h:445
std::vector< Vec3D > VelocityProfile
Definition: StatisticsVector.h:1177
Mdouble getCutoff2()
Definition: StatisticsVector.h:334
int nTimeAverageReset
Determines after how many time steps the time average is reset.
Definition: StatisticsVector.h:996
Mdouble cutoff
The distance from the origin at which the cg function vanishes; cutoff=w for HeavisideSphere or Polyn...
Definition: StatisticsVector.h:1034
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:1088
Vec3D P1_P2_Contact
Definition: StatisticsVector.h:1146
bool getDoPeriodicWalls()
Definition: StatisticsVector.h:550
Mdouble xMaxStat
Definition: StatisticsVector.h:938
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:932
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:296
Matrix3D P1_P2_ContactCoupleStress
Definition: StatisticsVector.h:1144
std::string printStat()
Outputs member variable values to a std::string.
Vec3D VelocityProfile_Min
Definition: StatisticsVector.h:1182
std::string getPolynomialName()
Definition: StatisticsVector.h:813
bool getDoTimeAverage()
Definition: StatisticsVector.h:384
Mdouble P1_P2_Potential
not yet working
Definition: StatisticsVector.h:1160
std::vector< StatisticsPoint< T > > Points
A vector that stores the values of the statistical variables at a given position.
Definition: StatisticsVector.h:948
Mdouble getZMinStat()
Definition: StatisticsVector.h:687
bool isMDCLR
Definition: StatisticsVector.h:1120
void constructor()
this is the actual constructor, sets up all basic things
StatisticsVector(std::string name)
Definition: StatisticsVector.h:64
bool getSuperExact()
Definition: StatisticsVector.h:478
void setZMinStat(Mdouble zMinStat_)
Definition: StatisticsVector.h:747
void statistics_from_p3()
void setNZ(int new_)
Definition: StatisticsVector.h:138
int StressTypeForFixedParticles
Stress type for fixed particles.
Definition: StatisticsVector.h:1102
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:542
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:981
Mdouble evaluatePolynomial(Mdouble r)
Definition: StatisticsVector.h:877
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:287
Matrix3D P1_P2_TangentialStress
Contact stress from tangential forces along the line of contact.
Definition: StatisticsVector.h:1148
void setDoTimeAverage(bool new_)
Definition: StatisticsVector.h:376
Vec3D P1_P2_CollisionalHeatFlux
not yet working
Definition: StatisticsVector.h:1156
void autoSetSystemDimensions()
void verbose()
Definition: StatisticsVector.h:502
CG_TYPE getCGShape()
Definition: StatisticsVector.h:272
void set_hx(Mdouble hx)
Definition: StatisticsVector.h:114
void setTimeMaxStat(Mdouble t)
Definition: StatisticsVector.h:210
Mdouble yMaxStat
Definition: StatisticsVector.h:938
void gather_force_statistics_from_p3w(int version, std::vector< int > &index)
void setIndSpecies(unsigned int indSpecies)
Definition: StatisticsVector.h:917
Mdouble hmax
defines the maximum height of the particles for which statistics are extracted
Definition: StatisticsVector.h:1077
Mdouble getCGWidthSquared()
Definition: StatisticsVector.h:318
void set_rmax(Mdouble new_)
Definition: StatisticsVector.h:861
void set_h(Mdouble h)
Definition: StatisticsVector.h:168
int verbosity
Determines how much is outputted to the terminal.
Definition: StatisticsVector.h:1110
Mdouble mirrorAtDomainBoundary
0: Statistics near the wall are equal to statistics away from the wall; 1: Statistics are mirrored at...
Definition: StatisticsVector.h:1117
int nTimeAverage
A counter needed to average over time.
Definition: StatisticsVector.h:1011
void set_hz(Mdouble hz)
Definition: StatisticsVector.h:150
StatisticsVector()
Basic constructor only calls constructor()
Definition: StatisticsVector.h:56
void setNY(int new_)
Definition: StatisticsVector.h:122
bool getDoGradient()
Definition: StatisticsVector.h:462
Mdouble evaluateIntegral(Mdouble n1, Mdouble n2, Mdouble t)
Definition: StatisticsVector.h:893
void statistics_from_fstat_and_data()
get StatisticsPoint
std::fstream p3c_file
Definition: StatisticsVector.h:1190
int nxMirrored
extension of grid size from mirrored points
Definition: StatisticsVector.h:942
CG_TYPE CG_type
coarse graining type (Gaussian, Heaviside, Polynomial)
Definition: StatisticsVector.h:1017
virtual void reset_statistics()
Set all statistical variables to zero.
Mdouble zMinStat
Definition: StatisticsVector.h:938
Mdouble setInfinitelyLongDistance()
Vec3D P1_P2_TangentialTraction
Traction from tangential forces at contact of flow with fixed particles or walls.
Definition: StatisticsVector.h:1152
std::vector< StatisticsPoint< T > > dy
A vector that stores the gradient in y of all statistical variables at a given position.
Definition: StatisticsVector.h:956
Mdouble w2
coarse graining width squared; for HeavisideSphere and Gaussian
Definition: StatisticsVector.h:1029
int nyMirrored
Definition: StatisticsVector.h:942
void setYMinStat(Mdouble yMinStat_)
Definition: StatisticsVector.h:739
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:1122
Vec3D P2
Position of second contact point.
Definition: StatisticsVector.h:1136
void gather_force_statistics_from_fstat_and_data()
bool ignoreFixedParticles
Determines if fixed particles contribute to particle statistics (density, ...)
Definition: StatisticsVector.h:1093
Mdouble tMaxStat
Statistical output will only be created if t<tMaxStat.
Definition: StatisticsVector.h:1051
int nzMirrored
Definition: StatisticsVector.h:942
Definition: Kernel/Math/Vector.h:30
#define isnan(X)
Definition: main.h:109
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 ceil(const bfloat16 &a)
Definition: BFloat16.h:644
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
string filename
Definition: MergeRestartFiles.py:39
int delta
Definition: MultiOpt.py:96
r
Definition: UniformPSDSelfTest.py:20
T square(const T val)
squares a number
Definition: ExtendedMath.h:86
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
string name
Definition: plotDoE.py:33
t
Definition: plotPSD.py:36
This class stores statistical values for a given spatial position; to be used in combination with Sta...
Definition: StatisticsPoint.h:26