CellGPU  0.8.0
GPU-accelerated simulations of cells
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Simulation Class Reference

A class that ties together all the parts of a simulation. More...

#include <Simulation.h>

Inheritance diagram for Simulation:
Inheritance graph
[legend]

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< SimulationgetPointer ()
 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.
 
cellListGPUcellList
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Simulation()

Simulation::Simulation ( )

Initialize all the shared pointers, etc.

Initialize all of the shared points, set default values of things

References Box.

Member Function Documentation

◆ setConfiguration()

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.

◆ computeForces()

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().

◆ moveDegreesOfFreedom()

void Simulation::moveDegreesOfFreedom ( GPUArray< Dscalar2 > &  displacements)

Call the configuration to move particles around.

Calls the configuration to displace the degrees of freedom

References cellConfiguration.

◆ performTimestep()

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.

Postcondition
The simulation is advanced one time step

References cellConfiguration, integerTimestep, integrationTimestep, sortPeriod, Time, and updaters.

◆ addUpdater()

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.

◆ setBox()

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().

◆ setIntegrationTimestep()

void Simulation::setIntegrationTimestep ( Dscalar  dt)

Set the simulation timestep.

Postcondition
the cell configuration and e.o.m. timestep is set to the input value

Referenced by setCellList().

◆ setCPUOperation()

void Simulation::setCPUOperation ( bool  setcpu)

turn on CPU-only mode for all components

Postcondition
the cell configuration and e.o.m. timestep is set to the input value

References cellConfiguration, updaters, and USE_GPU.

◆ setReproducible()

void Simulation::setReproducible ( bool  reproducible)

Enforce reproducible dynamics.

Precondition
the updaters already know if the GPU will be used
Postcondition
the updaters are set to be reproducible if the boolean is true, otherwise the RNG is initialized

References updaters.

◆ setCurrentTime()

void Simulation::setCurrentTime ( Dscalar  _cTime)
virtual

reset the simulation clock

Postcondition
the cell configuration and e.o.m. timestep is set to the input value

Referenced by setSortPeriod().


The documentation for this class was generated from the following files: