CellGPU
0.8.0
GPU-accelerated simulations of cells
|
A base class for implementing simple equations of motion. More...
#include <simpleEquationOfMotion.h>
Public Member Functions | |
simpleEquationOfMotion () | |
base constructor sets default time step size | |
virtual void | integrateEquationsOfMotion () |
the fundamental function that models will call, using vectors of different data structures | |
int | getTimestep () |
get the number of timesteps run | |
Dscalar | getTime () |
get the current simulation time | |
virtual void | setDeltaT (Dscalar dt) |
Set the simulation time stepsize. | |
virtual void | performUpdate () |
performUpdate just maps to integrateEquationsOfMotion | |
virtual void | setReproducible (bool rep) |
Set whether the source of noise should always use the same random numbers. | |
void | reIndexRNG (GPUArray< curandState > &array) |
re-index the any RNGs associated with the e.o.m. | |
virtual void | Update (int timestep) |
The fundamental function that a controlling Simulation can call. | |
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 | 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. | |
Public Attributes | |
shared_ptr< Simple2DModel > | model |
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 | Timestep |
Count the number of integration timesteps. | |
Dscalar | deltaT |
The time stepsize of the simulation. | |
GPUArray< Dscalar2 > | displacements |
an internal GPUArray for holding displacements | |
noiseSource | noise |
A source of noise for the equation of motion. | |
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 | |
A base class for implementing simple equations of motion.
In cellGPU a "simple" equation of motion is one that can take a GPUArray of forces and return a set of displacements. A derived class of this might be the self-propelled particle equations of motion, or simple Brownian dynamics. Derived classes must implement the integrateEquationsOfMotion function. Additionally, equations of motion act on a cell configuration, and in general require that the configuration, C, passed in to the equation of motion provides access to the following: C->getNumberOfDegreesOfFreedom() should return the number of degrees of freedom (up to a factor of dimension) C->computeForces() should calculate the negative gradient of the energy in whatever model T implements C->getForces(f) is able to be called after T.computeForces(), and copies the forces to the variable f C->moveDegreesOfFreedom(disp) moves the degrees of freedom according to the GPUArray of displacements C->enforceTopology() takes care of any business the model that T implements needs after the positions of the underlying degrees of freedom have been updated