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 ( )
50 {
51  logger(INFO,"Testing if the particle size momenta are correctly computed by the cg implementation.");
52  Packing dpm;
53  dpm.setName("CGMomentSelfTest");
54  dpm.setTimeStep(1e-4);
55  dpm.setTimeMax(0);
57  dpm.solve();
58  //cg->getPoint(0).outputStandardisedParticleSizeMomenta(std::cout);
59  auto momenta = cg->getPoint(0).getStandardisedParticleSizeMomenta();
60 
61  //Checks if moments are computed correctly
62  helpers::check(momenta[0],10000,1e-5, "Particle Number");
63  helpers::check(momenta[1],1.001,1e-5, "Mean Radius");
64  helpers::check(momenta[2],0.0101141,1e-5, "Standard deviation");
65  helpers::check(momenta[3],-0.0198724,1e-5, "Skewness");
66  helpers::check(momenta[4],2.91938,1e-5, "Kurtosis");
67  helpers::check(momenta[5],-0.0762574,1e-5, "5-th moment");
68  return 0;
69 }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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:360
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:55
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1479
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
Definition: CG3DPackingUnitTest.cpp:14
#define INFO(i)
Definition: mumps_solver.h:54
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:16

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