AdvectionCaUpdateRule< DIM > Class Template Reference

#include <AdvectionCaUpdateRule.hpp>

Inherits AbstractCaUpdateRule< DIM >.

Collaboration diagram for AdvectionCaUpdateRule< DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AdvectionCaUpdateRule (unsigned advectionDirection, double advectionSpeed)
 AdvectionCaUpdateRule ()
 ~AdvectionCaUpdateRule ()
unsigned GetNewLocationOfCell (unsigned currentLocationIndex, CaBasedCellPopulation< DIM > &rCellPopulation, double dt)
unsigned GetAdvectionDirection ()
double GetAdvectionSpeed ()
void OutputUpdateRuleParameters (out_stream &rParamsFile)

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)

Private Attributes

unsigned mAdvectionDirection
double mAdvectionSpeed

Friends

class boost::serialization::access

Detailed Description

template<unsigned DIM>
class AdvectionCaUpdateRule< DIM >

An update rule class to model uniform steady advection. This class is currently implemented in 2D only.

The constructor must be passed an unsigned that corresponds to one of the eight possible flow directions in 2D (N, NW, W,SW, S, SE, E, NE) and a double that gives the speed of the flow. At each time step, a uniform random number r_i is generated for each cell i that has a free neighbour in the direction of the imposed flow; if r_i < s*dt, where s denotes the flow speed and dt denotes the time step, then the cell is moved. This ensures that the mean speed of an advected cell is equal to the flow speed, independent of the time step used.

Definition at line 52 of file AdvectionCaUpdateRule.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
AdvectionCaUpdateRule< DIM >::AdvectionCaUpdateRule ( unsigned  advectionDirection,
double  advectionSpeed 
) [inline]

Constructor.

Parameters:
advectionDirection the direction of the flow (must take one of the values 0 to 7 inclusive)
advectionSpeed the speed of the flow

Definition at line 34 of file AdvectionCaUpdateRule.cpp.

template<unsigned DIM>
AdvectionCaUpdateRule< DIM >::AdvectionCaUpdateRule (  )  [inline]

Alternative constructor, for use in archiving.

Definition at line 42 of file AdvectionCaUpdateRule.cpp.

template<unsigned DIM>
AdvectionCaUpdateRule< DIM >::~AdvectionCaUpdateRule (  )  [inline]

Destructor.

Definition at line 48 of file AdvectionCaUpdateRule.cpp.


Member Function Documentation

template<unsigned DIM>
unsigned AdvectionCaUpdateRule< DIM >::GetAdvectionDirection (  )  [inline]
Returns:
mAdvectionDirection.

Definition at line 168 of file AdvectionCaUpdateRule.cpp.

References AdvectionCaUpdateRule< DIM >::mAdvectionDirection.

template<unsigned DIM>
double AdvectionCaUpdateRule< DIM >::GetAdvectionSpeed (  )  [inline]
Returns:
mAdvectionSpeed.

Definition at line 174 of file AdvectionCaUpdateRule.cpp.

References AdvectionCaUpdateRule< DIM >::mAdvectionSpeed.

template<unsigned DIM>
unsigned AdvectionCaUpdateRule< DIM >::GetNewLocationOfCell ( unsigned  currentLocationIndex,
CaBasedCellPopulation< DIM > &  rCellPopulation,
double  dt 
) [inline, virtual]

Overridden GetNewLocationOfCell() method.

This moves the cell in the prescribed direction mAdvectionDirection to its nearest neighbour if this is free, with a probability that scales to ensure that the average speed is mAdvectionSpeed.

Parameters:
currentLocationIndex the current location index of a cell
rCellPopulation reference to the cell population
dt timestep of the simulation to calculate probability of movement in current timestep

For now this is accepting an unsigned flow input. Ultimately we want to have this accepting a std::vector<unsigned> so a flow field can be read in.

Implements AbstractCaUpdateRule< DIM >.

Definition at line 58 of file AdvectionCaUpdateRule.cpp.

References EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), RandomNumberGenerator::Instance(), CaBasedCellPopulation< DIM >::IsEmptySite(), AdvectionCaUpdateRule< DIM >::mAdvectionDirection, AdvectionCaUpdateRule< DIM >::mAdvectionSpeed, NEVER_REACHED, and CaBasedCellPopulation< DIM >::rGetMesh().

template<unsigned DIM>
void AdvectionCaUpdateRule< DIM >::OutputUpdateRuleParameters ( out_stream &  rParamsFile  )  [inline, virtual]

Overridden OutputUpdateRuleParameters() method.

Parameters:
rParamsFile the file stream to which the parameters are output

Implements AbstractCaUpdateRule< DIM >.

Definition at line 180 of file AdvectionCaUpdateRule.cpp.

References AdvectionCaUpdateRule< DIM >::mAdvectionDirection, and AdvectionCaUpdateRule< DIM >::mAdvectionSpeed.

template<unsigned DIM>
template<class Archive >
void AdvectionCaUpdateRule< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Serialize the object and its member variables.

Parameters:
archive the archive
version the current version of this class

Reimplemented from AbstractCaUpdateRule< DIM >.

Definition at line 77 of file AdvectionCaUpdateRule.hpp.

References AdvectionCaUpdateRule< DIM >::mAdvectionDirection, and AdvectionCaUpdateRule< DIM >::mAdvectionSpeed.


Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from AbstractCaUpdateRule< DIM >.

Definition at line 69 of file AdvectionCaUpdateRule.hpp.


Member Data Documentation

template<unsigned DIM>
unsigned AdvectionCaUpdateRule< DIM >::mAdvectionDirection [private]

Unsigned that describes the direction of the flow. We use the following convention to encode direction: 0=N, 1=NW, 2=W, 3=SW, 4=S, 5=SE, 6=E, 7=NE.

Definition at line 61 of file AdvectionCaUpdateRule.hpp.

Referenced by AdvectionCaUpdateRule< DIM >::GetAdvectionDirection(), AdvectionCaUpdateRule< DIM >::GetNewLocationOfCell(), AdvectionCaUpdateRule< DIM >::OutputUpdateRuleParameters(), and AdvectionCaUpdateRule< DIM >::serialize().

template<unsigned DIM>
double AdvectionCaUpdateRule< DIM >::mAdvectionSpeed [private]

The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:01:47 2011 for Chaste by  doxygen 1.6.3