revision: v0.14
CSCStats Class Reference
+ Inheritance diagram for CSCStats:

Public Member Functions

 CSCStats ()
void printTime () const
void setupInitialConditions ()
- Public Member Functions inherited from StatisticsVector< XZ >
void constructor ()
 this is the actual constructor, sets up all basic things More...
void constructor (std::string name)
 StatisticsVector ()
 Basic constructor only calls constructor() More...
 StatisticsVector (std::string name)
 StatisticsVector (StatisticsVector &other)
 Copy constructor. More...
 StatisticsVector (int argc, char *argv[])
 Advanced constructor that accepts arguments from the command line. More...
void readStatArguments (int argc, char *argv[])
std::string printStat ()
 Outputs member variable values to a std::string. More...
void set_statType ()
void writeOutputFiles ()
void print_help ()
void setNX (int new_)
void set_hx (Mdouble hx)
void setNY (int new_)
void set_hy (Mdouble hy)
void setNZ (int new_)
void set_hz (Mdouble hz)
void setN (int n)
void setN (int nx_, int ny_, int nz_)
void set_h (Mdouble h)
int getNX ()
int getNY ()
int getNZ ()
void setCGTimeMin (Mdouble t)
void setTimeMaxStat (Mdouble t)
void setCGTimeAveragingInterval (Mdouble t)
Mdouble getCGTimeMin ()
Mdouble getTimeMaxStat ()
Mdouble getCGTimeAveragingInterval ()
bool check_current_time_for_statistics ()
void setCGShape (const char *new_)
void setCGShape (CG_TYPE new_)
CG_TYPE getCGShape ()
void getN (int &nx_, int &ny_, int &nz_)
void setCGWidth (Mdouble w)
 Set CG variables w2 and CG_invvolume. More...
void setCGWidth2 (Mdouble new_)
 Set CG variables w2 and CG_invvolume. More...
Mdouble getCGWidth ()
Mdouble getCGWidthSquared ()
Mdouble getCutoff ()
Mdouble getCutoff2 ()
std::string print_CG ()
 Output coarse graining variables. More...
StatisticsPoint< T > average (std::vector< StatisticsPoint< T > > &P)
 Output average of statistical variables. More...
virtual void reset_statistics ()
 Set all statistical variables to zero. More...
void statistics_from_fstat_and_data ()
 get StatisticsPoint More...
void statistics_from_p3 ()
void jump_p3c ()
void setDoTimeAverage (bool new_)
bool getDoTimeAverage ()
void setStressTypeForFixedParticles (int new_)
int getStressTypeForFixedParticles ()
void set_infiniteStressForFixedParticles (bool new_)
void setMirrorAtDomainBoundary (Mdouble new_)
Mdouble getMirrorAtDomainBoundary ()
void setDoVariance (bool new_)
bool getDoVariance ()
void setDoGradient (bool new_)
bool getDoGradient ()
void setSuperExact (bool new_)
bool getSuperExact ()
void setDoIgnoreFixedParticles (bool new_)
bool getDoIgnoreFixedParticles ()
void verbose ()
void setVerbosityLevel (int new_)
int getVerbosityLevel () const
void setCGWidthalls (bool new_)
bool getCGWidthalls ()
void setDoPeriodicWalls (bool new_)
bool getDoPeriodicWalls ()
void setCGWidth_over_rmax (Mdouble new_)
Mdouble getCGWidth_over_rmax ()
void setPositions ()
 Set position of StatisticsPoint points and set variables to 0. More...
bool readNextDataFile (unsigned int format)
void gather_force_statistics_from_fstat_and_data ()
void gather_force_statistics_from_p3c (int version)
void gather_force_statistics_from_p3w (int version, std::vector< int > &index)
void evaluate_force_statistics (int wp=0)
void evaluate_wall_force_statistics (Vec3D P, int wp=0)
void jump_fstat ()
void initialiseStatistics ()
 Initializes statistics, i.e. setting w2, setting the grid and writing the header lines in the .stat file. More...
void outputStatistics ()
 Calculates statistics for Particles (i.e. not collisions) More...
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) More...
void processStatistics (bool usethese)
 Processes all gathered statistics and resets them afterwards. (Processing means either calculating time averages or writing out statistics) More...
void finishStatistics ()
 Finish all statistics (i.e. write out final data) More...
void write_statistics ()
 Writes regular statistics. More...
void write_time_average_statistics ()
 Writes out time averaged statistics. More...
void evaluate_particle_statistics (std::vector< BaseParticle * >::iterator P, int wp=0)
 Calculates statistics for a single Particle. More...
std::vector< StatisticsPoint< T > > getCGPoints ()
Mdouble getXMinStat ()
 Functions to acces and change the domain of statistics. More...
Mdouble getYMinStat ()
Mdouble getZMinStat ()
Mdouble getXMaxStat ()
Mdouble getYMaxStat ()
Mdouble getZMaxStat ()
void setXMinStat (Mdouble xMinStat_)
void setYMinStat (Mdouble yMinStat_)
void setZMinStat (Mdouble zMinStat_)
void setXMaxStat (Mdouble xMaxStat_)
void setYMaxStat (Mdouble yMaxStat_)
void setZMaxStat (Mdouble zMaxStat_)
int getNTimeAverage ()
Mdouble setInfinitelyLongDistance ()
void set_Polynomial (std::vector< Mdouble > new_coefficients, unsigned int new_dim)
void set_Polynomial (Mdouble *new_coefficients, unsigned int num_coeff, unsigned int new_dim)
void setPolynomialName (const char *new_name)
std::string getPolynomialName ()
void setDoDoublePoints (bool new_)
bool getDoDoublePoints ()
void setNTimeAverageReset (int new_)
bool getNTimeAverageReset ()
void set_rmin (Mdouble new_)
void set_rmax (Mdouble new_)
void set_hmax (Mdouble new_)
Mdouble evaluatePolynomial (Mdouble r)
Mdouble evaluatePolynomialGradient (Mdouble r)
Mdouble evaluateIntegral (Mdouble n1, Mdouble n2, Mdouble t)
unsigned int getStepSize () const
void setStepSize (unsigned int stepSize)
void setIndSpecies (unsigned int indSpecies)

Additional Inherited Members

- Protected Member Functions inherited from StatisticsVector< XZ >
bool satisfiesInclusionCriteria (BaseParticle *P)
bool loadVelocityProfile (const char *filename)
bool loadPositions (const char *filename)
Vec3D getVelocityProfile (Vec3D Position)
bool read_next_from_p3p_file ()
void autoSetSystemDimensions ()
- Protected Attributes inherited from StatisticsVector< XZ >
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 averaged; f.e. StatType X is averaged over y and z. More...
int nx
 Grid size nx,ny,nz (by default the points of evaluation are placed in an grid on the domain [xMinStat,xMaxStat]x[yMinStat,yMaxStat]x[zMinStat,zMaxStat]. More...
int ny
 see nx More...
int nz
 see nx More...
Mdouble xMinStat
 By default the domain is set to the domain of the MD problem (indicated by setting the stat-domain values to nan), but can be resized. More...
Mdouble xMaxStat
Mdouble yMinStat
Mdouble yMaxStat
Mdouble zMinStat
Mdouble zMaxStat
int nxMirrored
 extension of grid size from mirrored points More...
int nyMirrored
int nzMirrored
std::vector< StatisticsPoint< T > > Points
 A vector that stores the values of the statistical variables at a given position. More...
std::vector< StatisticsPoint< T > > dx
 A vector that stores the gradient in x of all statistical variables at a given position. More...
std::vector< StatisticsPoint< T > > dy
 A vector that stores the gradient in y of all statistical variables at a given position. More...
std::vector< StatisticsPoint< T > > dz
 A vector that stores the gradient in z of all statistical variables at a given position. More...
std::vector< StatisticsPoint< T > > timeAverage
 A vector used to sum up all statistical values in Points for time-averaging. More...
std::vector< StatisticsPoint< T > > timeVariance
 a vector used to sum up the variance in time of all statistical values More...
std::vector< StatisticsPoint< T > > dxTimeAverage
 a vector used to sum up all statistical gradients in dx for time-averaging More...
std::vector< StatisticsPoint< T > > dyTimeAverage
 a vector used to sum up all statistical gradients in dy for time-averaging More...
std::vector< StatisticsPoint< T > > dzTimeAverage
 a vector used to sum up all statistical gradients in dz for time-averaging More...
bool doTimeAverage
 Determines if output is averaged over time. More...
int nTimeAverageReset
 Determines after how many time steps the time average is reset. More...
bool doVariance
 Determines if variance is outputted. More...
bool doGradient
 Determines if gradient is outputted. More...
int nTimeAverage
 A counter needed to average over time. More...
 coarse graining type (Gaussian, Heaviside, Polynomial) More...
 Stores the Polynomial, if the cg function is an axisymmetric function Polynomial in r. More...
Mdouble w2
 coarse graining width squared; for HeavisideSphere and Gaussian More...
Mdouble cutoff
 The distance from the origin at which the cg function vanishes; cutoff=w for HeavisideSphere or Polynomial, 3*w for Gaussian. More...
Mdouble cutoff2
Mdouble w_over_rmax
 if w is not set manually then w will be set by multiplying this value by the largest particle radius at t=0 More...
Mdouble tMinStat
 Statistical output will only be created if t>tMinStat. More...
Mdouble tMaxStat
 Statistical output will only be created if t<tMaxStat. More...
Mdouble tIntStat
 Statistical output will only be created if tMaxStat-tIntStat< t< tMaxStat. More...
Mdouble indSpecies
 defines the species for which statistics are extracted (-1 for all species) More...
Mdouble rmin
 defines the minimum radius of the particles for which statistics are extracted More...
Mdouble rmax
 defines the maximum radius of the particles for which statistics are extracted More...
Mdouble hmax
 defines the maximum height of the particles for which statistics are extracted More...
bool walls
 Turns off walls before evaluation. More...
bool periodicWalls
 Turns off periodic walls before evaluation (needed for averaging, because we do not yet check if particle is in domain) More...
bool ignoreFixedParticles
 Determines if fixed particles contribute to particle statistics (density, ...) More...
int StressTypeForFixedParticles
 Stress type for fixed particles. More...
int verbosity
 Determines how much is outputted to the terminal. More...
int format
 format of the data input file More...
Mdouble mirrorAtDomainBoundary
 0: Statistics near the wall are equal to statistics away from the wall; 1: Statistics are mirrored at the domain boundaries; up to a maximum depth specified by this number More...
bool isMDCLR
bool superexact
 If true, cutoff radius for Gaussian is set to 5*w (from 3*w) More...
bool doDoublePoints
Vec3D P1
 Position of first contact point. More...
Vec3D P2
 Position of second contact point. More...
Vec3D P1_P2_normal
 Direction of contact. More...
Mdouble P1_P2_distance
 Length of contact line. More...
Matrix3D P1_P2_NormalStress
 Contact stress from normal forces along the line of contact. More...
Matrix3D P1_P2_ContactCoupleStress
Vec3D P1_P2_Contact
Matrix3D P1_P2_TangentialStress
 Contact stress from tangential forces along the line of contact. More...
Vec3D P1_P2_NormalTraction
 Traction from normal forces at contact of flow with fixed particles or walls. More...
Vec3D P1_P2_TangentialTraction
 Traction from tangential forces at contact of flow with fixed particles or walls. More...
MatrixSymmetric3D P1_P2_Fabric
 Fabric. More...
Vec3D P1_P2_CollisionalHeatFlux
 not yet working More...
Mdouble P1_P2_Dissipation
 not yet working More...
Mdouble P1_P2_Potential
 not yet working More...
std::vector< Vec3DVelocityProfile
Vec3D VelocityProfile_Min
Vec3D VelocityProfile_D
std::fstream p3p_file
std::fstream p3c_file
std::fstream p3w_file
bool p3Format
unsigned int stepSize_
std::vector< Vec3Dpositions_
bool centerPointInFStat_

Constructor & Destructor Documentation

◆ CSCStats()

CSCStats::CSCStats ( )
32  {
33  setName("CSCRun");
34  //restartFile.setFileType(FileType::MULTIPLE_FILES_PADDED);
35  logger(INFO, "Reading file %", restartFile.getFullName());
36  readRestartFile();
37  setRestarted(false);
38  setName("CSCStats");
39  setFileType(FileType::NO_FILE);
40  restartFile.setFileType(FileType::ONE_FILE);
41  statFile.setFileType(FileType::ONE_FILE);
44  setDoPeriodicWalls(false);
45  setN(50);
46  //setCGShape("Lucy");
47  setCGWidth(1.0);
48  setSaveCount(50);
49  setCGTimeMin(getTime());
50  setTimeMax(20); //40'000 time steps
51  }

References INFO, logger, StatisticsVector< XZ >::setCGTimeMin(), StatisticsVector< XZ >::setCGWidth(), StatisticsVector< XZ >::setDoPeriodicWalls(), StatisticsVector< XZ >::setN(), and StatisticsVector< XZ >::setNTimeAverageReset().

Member Function Documentation

◆ printTime()

void CSCStats::printTime ( ) const
54  {
55  logger(INFO, "t=% Ene=%", getTime(), getKineticEnergy() / getElasticEnergy());
56  }

References INFO, and logger.

◆ setupInitialConditions()

void CSCStats::setupInitialConditions ( )
60  {
61  std::string filename;
62  filename = getName()
63  + "SC" + std::to_string(restartFile.getSaveCount())
64  + "N" + std::to_string(getNX())
65  + "T" + std::to_string(static_cast<int>(round(getTimeMax())));
66  setName(filename);
67  setTime(getCGTimeMin());
68  setTimeMax(getCGTimeMin()+getTimeMax()); //40'000 time steps
69  }

References StatisticsVector< XZ >::getCGTimeMin(), getName(), StatisticsVector< XZ >::getNX(), helpers::round(), and helpers::to_string().

The documentation for this class was generated from the following file:
StatisticsVector< XZ >::setN
void setN(int n)
Definition: StatisticsVector.h:179
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Info log level.
StatisticsVector< XZ >::getCGTimeMin
Mdouble getCGTimeMin()
Definition: StatisticsVector.h:247
std::string getName(int argc, char *argv[])
Definition: CombineParallelDataFiles.cpp:12
StatisticsVector< XZ >::setDoPeriodicWalls
void setDoPeriodicWalls(bool new_)
Definition: StatisticsVector.h:563
StatisticsVector< XZ >::setCGTimeMin
void setCGTimeMin(Mdouble t)
Definition: StatisticsVector.h:223
Mdouble round(const Mdouble value, unsigned precision)
StatisticsVector< XZ >::setCGWidth
void setCGWidth(Mdouble w)
Set CG variables w2 and CG_invvolume.
Definition: StatisticsVector.h:317
StatisticsVector< XZ >::setNTimeAverageReset
void setNTimeAverageReset(int new_)
Definition: StatisticsVector.h:858
StatisticsVector< XZ >::getNX
int getNX()
Definition: StatisticsVector.h:199
std::string to_string(const T &n)
Definition: Helpers.h:227