26 #ifndef STATISTICSVECTOR_H
27 #define STATISTICSVECTOR_H
42 O,
X,
Y,
Z,
XY,
XZ,
YZ,
XYZ,
RAZ,
RZ,
AZ,
RA,
R,
A
164 logger(
WARN,
"Warning in set_nz: dimension less than 3");
301 void setN(
int nx_,
int ny_,
int nz_)
308 void getN(
int& nx_,
int& ny_,
int& nz_)
333 return std::sqrt(
w2);
820 CGPolynomial.set_polynomial(new_coefficients, num_coeff, new_dim);
973 std::vector<StatisticsPoint<T> >
dx;
977 std::vector<StatisticsPoint<T> >
dy;
981 std::vector<StatisticsPoint<T> >
dz;
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.
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
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
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