SpeedTestParticleInteractions.cpp File Reference
#include <iostream>
#include "Species/LinearViscoelasticSpecies.h"
#include "Mercury3D.h"
#include "Walls/InfiniteWall.h"
#include "MercuryTime.h"

Classes

class  Contact
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )
107 {
108  logger(INFO,
109  "A gas of non-dissipative particles are simulated, colliding at a constant rate.\n"
110  "An external potential force field, f_i=-r_i, keeps the particles in the center of the box.\n"
111  "No walls, boundaries, file output, thus testing the speed of particle collisions.");
112 
113  Time time;
114 
115  time.tic();
116  Contact mono(1.0);
117  mono.solve();
118  logger(INFO, "Total time to run monodisperse simulation: %s (Expected: 3s)", time.toc());
119  //expected time was measured on Thomas' pc 26-Apr-2018 (r2816, Release)
120 
121  time.tic();
122  Contact poly(2.0);
123  poly.setTimeMax(0.51 * poly.getTimeMax());
124  poly.solve();
125  logger(INFO, "Total time to run polydisperse simulation: %s (Expected: 3s)", time.toc());
126 
127  time.tic();
128  Contact highPoly(5.0);
129  highPoly.setTimeMax(0.44 * highPoly.getTimeMax());
130  highPoly.solve();
131  logger(INFO, "Total time to run highly polydisperse simulation: %s (Expected: 3s)", time.toc());
132 
133  return 0;
134 }
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.
Definition: SpeedTestParticleInteractions.cpp:36
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:46
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:70
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:59

References DPMBase::getTimeMax(), INFO, logger, DPMBase::setTimeMax(), DPMBase::solve(), Time::tic(), and Time::toc().