![]() |
.Simulation
|
The Simulation class is the environment in which the simulation occurs. More...
#include <Simulation.h>
Public Member Functions | |
Simulation (const InfoStruct &info, const std::string &outDir="", const bool save=true) | |
A templatized version of the constructor that takes a particle factory as a type. More... | |
void | PurgeEvents () |
Prints all the events in the calendar to standard out if we are in debug mode. | |
bool | HasRebounded () const |
Returns whether or not the bubble wall has rebounded yet. More... | |
EventType | NextStep () |
Advance the simulation by one step. More... | |
std::vector< Particle > ::const_iterator | begin () |
Beginning iterator for the particles in the system. More... | |
std::vector< Particle > ::const_iterator | end () |
Ending iterator used to determine the stopping criteria for the particle iterator. | |
double | GetCurrentTime () const |
unsigned long long | GetCollisionCount () const |
Get the collision count from the simulation. | |
unsigned long long | GetCellCrossingCount () const |
Get the number of cell crossing events so far. | |
unsigned long long | GetWallCollisionCount () const |
Get the number of cell wall events so far. | |
unsigned long long | GetConeBoundaryCount () const |
Get the number of cone boundary events so far. | |
template<typename Writer > | |
void | Serialize (Writer &writer) const |
Serialize the simulation to the writer being given. | |
int | GetParticleCount () const |
Get the current number of particles in the system. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Simulation &sim) |
The Simulation class is the environment in which the simulation occurs.
It internally tracks all of the relevant information to the system and provides an interface for accessing this information for analysis purposes.
|
explicit |
A templatized version of the constructor that takes a particle factory as a type.
This makes it fairly easy to swap out particle generators for testing purposes.
info | The info struct providing needed constants and other configurable parameters of the simulation. |
outDir | The path where generated output will be saved to. |
n | The number of particle to generate. |
std::vector< Particle >::const_iterator MDSimulation::Simulation::begin | ( | ) |
Beginning iterator for the particles in the system.
This is just a standard iterator over a vector of particles.
double MDSimulation::Simulation::GetCurrentTime | ( | ) | const |
bool MDSimulation::Simulation::HasRebounded | ( | ) | const |
Returns whether or not the bubble wall has rebounded yet.
This is useful for determining when to stop advancing the simulation.
EventType MDSimulation::Simulation::NextStep | ( | ) |
Advance the simulation by one step.
This mean executing one event and then updating the calendar and cell list appropriately.