CellGPU
0.8.0
GPU-accelerated simulations of cells
|
A class that ties together all the parts of a simulation. More...
#include <Simulation.h>
Public Member Functions | |
Simulation () | |
Initialize all the shared pointers, etc. More... | |
void | setConfiguration (ForcePtr _config) |
Pass in a reference to the configuration. More... | |
void | computeForces (GPUArray< Dscalar2 > &forces) |
Call the force computer to compute the forces. More... | |
void | moveDegreesOfFreedom (GPUArray< Dscalar2 > &displacements) |
Call the configuration to move particles around. More... | |
void | performTimestep () |
Call every updater to advance one time step. More... | |
shared_ptr< Simulation > | getPointer () |
return a shared pointer to this Simulation | |
void | addUpdater (UpdaterPtr _upd) |
Add an updater. | |
void | addUpdater (UpdaterPtr _upd, ForcePtr _config) |
Add an updater with a reference to a configuration. More... | |
void | clearUpdaters () |
Clear out the vector of updaters. | |
void | setBox (BoxPtr _box) |
This changes the contents of the Box pointed to by Box to match that of _box. More... | |
void | setCellList (cellListGPU &_cl) |
Pass in a reference to the box. | |
void | setIntegrationTimestep (Dscalar dt) |
Set the simulation timestep. More... | |
void | setCPUOperation (bool setcpu) |
turn on CPU-only mode for all components More... | |
void | setReproducible (bool reproducible) |
Enforce reproducible dynamics. More... | |
void | setSortPeriod (int sp) |
Set the time between spatial sorting operations. | |
virtual void | setCurrentTime (Dscalar _cTime) |
reset the simulation clock More... | |
virtual void | setCurrentTimestep (int _cTime) |
reset the simulation clock counter | |
Public Attributes | |
WeakForcePtr | cellConfiguration |
The configuration of cells. | |
vector< WeakUpdaterPtr > | updaters |
A vector of updaters that the simulation will loop through. | |
BoxPtr | Box |
The domain of the simulation. | |
cellListGPU * | cellList |
A neighbor list assisting the simulation. | |
int | integerTimestep |
An integer that keeps track of how often performTimestep has been called. | |
Dscalar | Time |
The current simulation time. | |
Dscalar | integrationTimestep |
The dt of a time step. | |
bool | USE_GPU |
A flag controlling whether to use the GPU. | |
Protected Attributes | |
int | sortPeriod |
Determines how frequently the spatial sorter be called...once per sortPeriod Timesteps. When sortPeriod < 0 no sorting occurs. | |
bool | spatialSortThisStep |
A flag that determins if a spatial sorting is due to occur this Timestep. | |
A class that ties together all the parts of a simulation.
Simulation objects should have a configuration set, and then at least one updater (such as an equation of motion). In addition to being a centralized object controlling the progression of a simulation of cell models, the Simulation class provides some interfaces to cell configuration and updater parameter setters.
Simulation::Simulation | ( | ) |
Initialize all the shared pointers, etc.
Initialize all of the shared points, set default values of things
References Box.
void Simulation::setConfiguration | ( | ForcePtr | _config | ) |
Pass in a reference to the configuration.
Set a pointer to the configuratione, and give the configurationa reference to this
References Box, and cellConfiguration.
void Simulation::computeForces | ( | GPUArray< Dscalar2 > & | forces | ) |
Call the force computer to compute the forces.
Calls the configuration to displace the degrees of freedom
References cellConfiguration, and GPUArray< T >::swap().
void Simulation::moveDegreesOfFreedom | ( | GPUArray< Dscalar2 > & | displacements | ) |
Call the configuration to move particles around.
Calls the configuration to displace the degrees of freedom
References cellConfiguration.
void Simulation::performTimestep | ( | ) |
Call every updater to advance one time step.
Call all relevant functions to advance the system one time step; every sortPeriod also call the spatial sorting routine.
References cellConfiguration, integerTimestep, integrationTimestep, sortPeriod, Time, and updaters.
void Simulation::addUpdater | ( | UpdaterPtr | _upd, |
ForcePtr | _config | ||
) |
Add an updater with a reference to a configuration.
Add a pointer to the list of updaters, and give that updater a reference to the model...
References updaters.
void Simulation::setBox | ( | BoxPtr | _box | ) |
This changes the contents of the Box pointed to by Box to match that of _box.
Set a new Box for the simulation...This is the function that should be called to propagate a change in the box dimensions throughout the simulation...By this time the Box pointed to in the Simulation is the same one pointed to by the BoxPtrs of Simple2DCell (and, in the Voronoi models, by DelaunayLoc and cellListGPU), so when we modify it the changes will run through the rest of the simulation components
Referenced by clearUpdaters().
void Simulation::setIntegrationTimestep | ( | Dscalar | dt | ) |
Set the simulation timestep.
Referenced by setCellList().
void Simulation::setCPUOperation | ( | bool | setcpu | ) |
turn on CPU-only mode for all components
References cellConfiguration, updaters, and USE_GPU.
void Simulation::setReproducible | ( | bool | reproducible | ) |
Enforce reproducible dynamics.
References updaters.
|
virtual |
reset the simulation clock
Referenced by setSortPeriod().