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

A base class for implementing simple updaters. More...

#include <updater.h>

Inheritance diagram for updater:
Inheritance graph
[legend]

Public Member Functions

 updater ()
 by default, updaters are called every timestep with no offset
 
 updater (int _p)
 
virtual void Update (int timestep)
 The fundamental function that a controlling Simulation can call.
 
virtual void performUpdate ()
 The function which performs the update.
 
virtual void set2DModel (shared_ptr< Simple2DModel > _model)
 virtual function to allow the model to be a derived class
 
void setPeriod (int _p)
 set the period
 
void setPhase (int _p)
 set the phase
 
virtual void spatialSorting ()
 allow for spatial sorting to be called if necessary...
 
virtual void setReproducible (bool rep)
 Allow for a reproducibility call to be made.
 
virtual void setGPU ()
 Enforce GPU-only operation. This is the default mode, so this method need not be called most of the time.
 
virtual void setCPU ()
 Enforce CPU-only operation. Derived classes might have to do more work when the CPU mode is invoked.
 
int getNdof ()
 Get the number of degrees of freedom of the equation of motion.
 
void setNdof (int _n)
 Set the number of degrees of freedom of the equation of motion.
 
virtual void setDeltaT (Dscalar dt)
 allow all updaters to potentially implement an internal time scale
 

Public Attributes

shared_ptr< Simple2DModelmodel
 A pointer to a Simple2DModel that the updater acts on.
 

Protected Member Functions

void reIndexArray (GPUArray< int > &array)
 Re-index cell arrays after a spatial sorting has occured.
 
void reIndexArray (GPUArray< Dscalar > &array)
 why use templates when you can type more?
 
void reIndexArray (GPUArray< Dscalar2 > &array)
 why use templates when you can type more?
 

Protected Attributes

int Period
 The period of the updater... the updater will work every Period timesteps.
 
int Phase
 The phase of the updater... the updater will work every Period timesteps offset by a phase.
 
bool GPUcompute
 whether the updater does its work on the GPU or not
 
int Ndof
 The number of degrees of freedom the equations of motion need to know about.
 
vector< int > reIndexing
 a vector of the re-indexing information
 

Detailed Description

A base class for implementing simple updaters.

In cellGPU an updater is some class object that can update something about the underlying state of the system. An example might be an equation of motion, or an updater that periodically subtracts off any center-of-mass motion of a system as it evolves, etc.. A simulation will call all updaters in a loop, e.g. for(each updater i in list) updater[i].Update(Timestep) To facilitate this structure, but acknowledge that any given updater might only need to be called occasionally, the Update function is passed a timestep, and each updaters has a period that should be set.


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