CGMomentUnitTest.cpp File Reference
#include <Walls/InfiniteWall.h>
#include <CG/TimeAveragedCG.h>
#include <random>
#include "Mercury3D.h"
#include "CG/CG.h"
#include "Species/LinearViscoelasticSpecies.h"

Classes

class  Packing
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
71 {
72  logger(INFO,"Testing if the particle size momenta are correctly computed by the cg implementation.");
73  Packing dpm;
74  dpm.setName("CGMomentSelfTest");
75  dpm.setTimeStep(1e-4);
76  dpm.setTimeMax(0);
78  dpm.solve();
79  //cg->getPoint(0).outputStandardisedParticleSizeMomenta(std::cout);
80  auto momenta = cg->getPoint(0).getStandardisedParticleSizeMomenta();
81 
82  //Checks if moments are computed correctly
83  helpers::check(momenta[0],10000,1e-5, "Particle Number");
84  helpers::check(momenta[1],1.001,1e-5, "Mean Radius");
85  helpers::check(momenta[2],0.0101141,1e-5, "Standard deviation");
86  helpers::check(momenta[3],-0.0198724,1e-5, "Skewness");
87  helpers::check(momenta[4],2.91938,1e-5, "Kurtosis");
88  helpers::check(momenta[5],-0.0762574,1e-5, "5-th moment");
89  return 0;
90 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:76
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Definition: CG3DPackingUnitTest.cpp:35
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References DPMBase::cgHandler, helpers::check(), BaseHandler< T >::copyAndAddObject(), INFO, logger, DPMBase::setName(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), and DPMBase::solve().