CellGPU
0.8.0
GPU-accelerated simulations of cells
|
A class that implements simple self-propelled particle dynamics in 2D. More...
#include <selfPropelledCellVertexDynamics.h>
Public Member Functions | |
selfPropelledCellVertexDynamics (int Ncells, int Nvertices) | |
base constructor sets default time step size More... | |
virtual void | integrateEquationsOfMotion () |
the fundamental function that models will call, using vectors of different data structures More... | |
virtual void | integrateEquationsOfMotionCPU () |
call the CPU routine to integrate the e.o.m. More... | |
virtual void | integrateEquationsOfMotionGPU () |
call the GPU routine to integrate the e.o.m. More... | |
int | getNvertices () |
Get the number of vertices. | |
int | getNcells () |
Get the number of cells. | |
void | setNcells (int _n) |
Set the number of cells. | |
void | setNvertices (int _n) |
Set the number of vertices. | |
Dscalar | getMu () |
Get the inverse friction constant, mu. | |
void | setMu (Dscalar _mu) |
Set the number of degrees of freedom of the equation of motion. | |
virtual void | spatialSorting () |
call the Simple2DCell spatial vertex sorter, and re-index arrays of cell activity More... | |
virtual void | set2DModel (shared_ptr< Simple2DModel > _model) |
set the active model More... | |
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. | |
void | setPeriod (int _p) |
set the period | |
void | setPhase (int _p) |
set the phase | |
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 | |
int | Ncells |
In the mixed cell-vertex model, the equations of motion need to know the number of cells. | |
int | Nvertices |
In the mixed cell-vertex model, the equations of motion need to know the number of vertices (dof) | |
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 | |
shared_ptr< Simple2DActiveCell > | activeModel |
A shared pointer to a simple active model. | |
Dscalar | mu |
The value of the inverse friction constant. | |
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 class that implements simple self-propelled particle dynamics in 2D.
implements dr/dt = mu*F = 1/3 Sum(v_i {n}_i, where {n}_i = (cos(theta),sin(theta)), and d theta/dt = (brownian noise), and the sum is over the cells that neighbor the vertex
selfPropelledCellVertexDynamics::selfPropelledCellVertexDynamics | ( | int | _Ncells, |
int | _Nvertices | ||
) |
base constructor sets default time step size
An extremely simple constructor that does nothing, but enforces default GPU operation
the | number of points in the system (cells or particles) |
References simpleEquationOfMotion::deltaT, simpleEquationOfMotion::displacements, updater::GPUcompute, noiseSource::initialize(), selfPropelledParticleDynamics::mu, Ncells, updater::Ndof, updaterWithNoise::noise, Nvertices, GPUArray< T >::resize(), and simpleEquationOfMotion::Timestep.
|
virtual |
the fundamental function that models will call, using vectors of different data structures
Advances self-propelled dynamics with random noise in the director by one time step
Reimplemented from selfPropelledParticleDynamics.
References selfPropelledParticleDynamics::activeModel, simpleEquationOfMotion::displacements, updater::GPUcompute, noiseSource::initialize(), integrateEquationsOfMotionCPU(), integrateEquationsOfMotionGPU(), Ncells, updaterWithNoise::noise, Nvertices, GPUArray< T >::resize(), and simpleEquationOfMotion::Timestep.
|
virtual |
call the CPU routine to integrate the e.o.m.
Move every vertex according to the net force on it and its motility...CPU routine
Reimplemented from selfPropelledParticleDynamics.
References selfPropelledParticleDynamics::activeModel, simpleEquationOfMotion::displacements, access_location::host, access_mode::overwrite, access_mode::read, and access_mode::readwrite.
Referenced by integrateEquationsOfMotion().
|
virtual |
call the GPU routine to integrate the e.o.m.
The straightforward GPU implementation
Reimplemented from selfPropelledParticleDynamics.
References selfPropelledParticleDynamics::activeModel, ArrayHandle< T >::data, simpleEquationOfMotion::deltaT, access_location::device, simpleEquationOfMotion::displacements, gpu_spp_cellVertex_eom_integration(), selfPropelledParticleDynamics::mu, Ncells, updaterWithNoise::noise, Nvertices, access_mode::overwrite, access_mode::read, access_mode::readwrite, noiseSource::RNGs, and simpleEquationOfMotion::Timestep.
Referenced by integrateEquationsOfMotion().
|
virtualinherited |
call the Simple2DCell spatial vertex sorter, and re-index arrays of cell activity
When spatial sorting is performed, re-index the array of cuda RNGs... This function is currently commented out, for greater flexibility (i.e., to not require that the indexToTag (or Itt) be the re-indexing array), since that assumes cell and not particle-based dynamics
Reimplemented from updater.
|
virtualinherited |
set the active model
Set the shared pointer of the base class to passed variable; cast it as an active cell model
Reimplemented from updater.
References selfPropelledParticleDynamics::activeModel, and updater::model.