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 ( )
86 {
87  logger(INFO,
88  "A gas of non-dissipative particles are simulated, colliding at a constant rate.\n"
89  "An external potential force field, f_i=-r_i, keeps the particles in the center of the box.\n"
90  "No walls, boundaries, file output, thus testing the speed of particle collisions.");
91 
92  Time time;
93 
94  time.tic();
95  Contact mono(1.0);
96  mono.solve();
97  logger(INFO, "Total time to run monodisperse simulation: %s (Expected: 3s)", time.toc());
98  //expected time was measured on Thomas' pc 26-Apr-2018 (r2816, Release)
99 
100  time.tic();
101  Contact poly(2.0);
102  poly.setTimeMax(0.51 * poly.getTimeMax());
103  poly.solve();
104  logger(INFO, "Total time to run polydisperse simulation: %s (Expected: 3s)", time.toc());
105 
106  time.tic();
107  Contact highPoly(5.0);
108  highPoly.setTimeMax(0.44 * highPoly.getTimeMax());
109  highPoly.solve();
110  logger(INFO, "Total time to run highly polydisperse simulation: %s (Expected: 3s)", time.toc());
111 
112  return 0;
113 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Definition: SpeedTestParticleInteractions.cpp:15
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:25
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:49
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:38
#define INFO(i)
Definition: mumps_solver.h:54

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