CompuCell3D::Potts3D Class Reference

#include <Potts3D.h>

Inheritance diagram for CompuCell3D::Potts3D:

Inheritance graph
[legend]
Collaboration diagram for CompuCell3D::Potts3D:

Collaboration graph
[legend]

List of all members.

Public Types

typedef unsigned int(Potts3D::* metropolisFcnPtr_t )(const unsigned int, const double)

Public Member Functions

 Potts3D ()
 Potts3D (const Dim3D dim)
virtual ~Potts3D ()
void createCellField (const Dim3D dim)
unsigned int getCurrentAttempt ()
unsigned int getNumberOfAttempts ()
unsigned int getNumberOfAttemptedEnergyCalculations ()
unsigned int getNumberOfAcceptedSpinFlips ()
std::set< Point3D > * getBoundaryPixelSetPtr ()
LatticeType getLatticeType ()
double getDepth ()
void setDepth (double _depth)
void setNeighborOrder (unsigned int _neighborOrder)
void initializeCellTypeMotility (std::vector< CellTypeMotilityData > &_cellTypeMotilityVector)
void setCellTypeMotilityVec (std::vector< float > &_cellTypeMotilityVec)
const std::vector< float > & getCellTypeMotilityVec ()
void setDebugOutputFrequency (unsigned int _freq)
void setSimulator (Simulator *_sim)
void setFrozenTypeVector (std::vector< unsigned char > &_frozenTypeVec)
const std::vector< unsigned
char > & 
getFrozenTypeVector ()
Point3D getFlipNeighbor ()
void setBoundaryXName (std::string const &_xName)
void setBoundaryYName (std::string const &_yName)
void setBoundaryZName (std::string const &_zName)
std::string const & getBoundaryXName () const
std::string const & getBoundaryYName () const
std::string const & getBoundaryZName () const
void setMinCoordinates (Point3D _minCoord)
void setMaxCoordinates (Point3D _maxCoord)
Point3D getMinCoordinates () const
Point3D getMaxCoordinates () const
TypeTransitiongetTypeTransition ()
virtual void createEnergyFunction (std::string _energyFunctionType)
EnergyFunctionCalculatorgetEnergyFunctionCalculator ()
CellInventorygetCellInventory ()
virtual void registerAttributeAdder (AttributeAdder *_attrAdder)
virtual void registerEnergyFunction (EnergyFunction *function)
 Add an energy function to the list.
virtual void registerEnergyFunctionWithName (EnergyFunction *_function, std::string _functionName)
virtual void unregisterEnergyFunction (std::string _functionName)
double getNewNumber ()
virtual void registerAutomaton (Automaton *autom)
 Add the automaton.
virtual AutomatongetAutomaton ()
 Return the automaton for this simulation.
virtual void registerAcceptanceFunction (AcceptanceFunction *function)
virtual void setAcceptanceFunctionByName (std::string _acceptanceFunctionName)
virtual AcceptanceFunctiongetAcceptanceFunction ()
virtual void registerCellGChangeWatcher (CellGChangeWatcher *_watcher)
 Add a cell field update watcher.
virtual void registerClassAccessor (BasicClassAccessorBase *_accessor)
 Register accessor to a class with a cellGroupFactory. Accessor will access a class which is a mamber of a BasicClassGroup.
virtual void registerStepper (Stepper *stepper)
 Add a potts stepper to be called after each potts step.
virtual void registerFixedStepper (FixedStepper *fixedStepper)
double getEnergy ()
virtual CellGcreateCellG (const Point3D pt)
virtual void destroyCellG (CellG *cell, bool _removeFromInventory=true)
BasicClassGroupFactorygetCellFactoryGroupPtr ()
virtual unsigned int getNumCells ()
 dealocate a BasicClassGroup
virtual double totalEnergy ()
virtual double changeEnergy (Point3D pt, const CellG *newCell, const CellG *oldCell)
virtual unsigned int metropolis (const unsigned int steps, const double temp)
unsigned int metropolisList (const unsigned int steps, const double temp)
unsigned int metropolisFast (const unsigned int steps, const double temp)
unsigned int metropolisBoundaryWalker (const unsigned int steps, const double temp)
void setMetropolisAlgorithm (std::string _algName)
virtual Field3D< CellG * > * getCellFieldG ()
virtual Field3DImpl< CellG * > * getCellFieldGImpl ()
virtual void update (CC3DXMLElement *_xmlData, bool _fullInitFlag=false)
virtual std::string steerableName ()

Public Attributes

metropolisFcnPtr_t metropolisFcnPtr

Private Member Functions

bool checkIfFrozen (unsigned char _type)

Private Attributes

WatchableField3D< CellG * > * cellFieldG
 The potts field of cell spins.
AttributeAdderattrAdder
EnergyFunctionCalculatorenergyCalculator
BasicClassGroupFactory cellFactoryGroup
 Cell class aggregator and allocator.
std::vector< EnergyFunction * > energyFunctions
 An array of energy functions to be evaluated to determine energy costs.
std::map< std::string,
EnergyFunction * > 
nameToEnergyFuctionMap
std::set< Point3DboundaryPixelSet
TypeTransitiontypeTransition
std::vector< Stepper * > steppers
 An array of potts steppers. These are called after each potts step.
std::vector< FixedStepper * > fixedSteppers
Automatonautomaton
 The automaton to use. Assuming one automaton per simulation.
DefaultAcceptanceFunction defaultAcceptanceFunction
FirstOrderExpansionAcceptanceFunction firstOrderExpansionAcceptanceFunction
AcceptanceFunctionacceptanceFunction
 Used to determine the probablity that a pixel flip should be taken.
double energy
 The current total energy of the system.
std::string boundary_x
std::string boundary_y
std::string boundary_z
CellInventory cellInventory
Point3D flipNeighbor
double depth
std::vector< Point3Dneighbors
std::vector< unsigned char > frozenTypeVec
unsigned int sizeFrozenTypeVec
 lists types which will remain frozen throughout the simulation
long recentlyCreatedCellId
unsigned int currentAttempt
unsigned int numberOfAttempts
unsigned int maxNeighborIndex
unsigned int debugOutputFrequency
Simulatorsim
Point3D minCoordinates
Point3D maxCoordinates
unsigned int attemptedEC
unsigned int flips
std::vector< float > cellTypeMotilityVec


Detailed Description

A generic implementation of the potts model in 3D.

See http://scienceworld.wolfram.com/physics/PottsModel.html for more information about the potts model.

Definition at line 87 of file Potts3D.h.


Member Typedef Documentation

typedef unsigned int(Potts3D::* CompuCell3D::Potts3D::metropolisFcnPtr_t)(const unsigned int, const double)


Constructor & Destructor Documentation

Potts3D::Potts3D (  ) 

Potts3D::Potts3D ( const Dim3D  dim  ) 

Potts3D::~Potts3D (  )  [virtual]

Definition at line 102 of file Potts3D.cpp.

References cellFieldG, energyCalculator, and typeTransition.


Member Function Documentation

bool Potts3D::checkIfFrozen ( unsigned char  _type  )  [private]

Definition at line 832 of file Potts3D.cpp.

References frozenTypeVec.

Referenced by metropolisBoundaryWalker(), metropolisFast(), and metropolisList().

void Potts3D::createCellField ( const Dim3D  dim  ) 

Create the cell field.

Parameters:
dim The field dimensions.

Definition at line 191 of file Potts3D.cpp.

References ASSERT_OR_THROW, and cellFieldG.

Referenced by CompuCell3D::Simulator::initializePottsCC3D(), and Potts3D().

unsigned int CompuCell3D::Potts3D::getCurrentAttempt (  )  [inline]

Definition at line 165 of file Potts3D.h.

Referenced by CompuCell3D::PDESolverCallerPlugin::step().

unsigned int CompuCell3D::Potts3D::getNumberOfAttempts (  )  [inline]

Definition at line 166 of file Potts3D.h.

Referenced by CompuCell3D::PDESolverCallerPlugin::step().

unsigned int CompuCell3D::Potts3D::getNumberOfAttemptedEnergyCalculations (  )  [inline]

Definition at line 167 of file Potts3D.h.

unsigned int CompuCell3D::Potts3D::getNumberOfAcceptedSpinFlips (  )  [inline]

Definition at line 168 of file Potts3D.h.

std::set<Point3D>* CompuCell3D::Potts3D::getBoundaryPixelSetPtr (  )  [inline]

Definition at line 169 of file Potts3D.h.

Referenced by CompuCell3D::GlobalBoundaryPixelTrackerPlugin::update().

LatticeType Potts3D::getLatticeType (  ) 

double CompuCell3D::Potts3D::getDepth (  )  [inline]

Definition at line 173 of file Potts3D.h.

void Potts3D::setDepth ( double  _depth  ) 

void Potts3D::setNeighborOrder ( unsigned int  _neighborOrder  ) 

void Potts3D::initializeCellTypeMotility ( std::vector< CellTypeMotilityData > &  _cellTypeMotilityVector  ) 

void Potts3D::setCellTypeMotilityVec ( std::vector< float > &  _cellTypeMotilityVec  ) 

Definition at line 799 of file Potts3D.cpp.

References cellTypeMotilityVec.

const std::vector<float>& CompuCell3D::Potts3D::getCellTypeMotilityVec (  )  [inline]

Definition at line 179 of file Potts3D.h.

void CompuCell3D::Potts3D::setDebugOutputFrequency ( unsigned int  _freq  )  [inline]

Definition at line 181 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D(), and update().

void CompuCell3D::Potts3D::setSimulator ( Simulator _sim  )  [inline]

Definition at line 182 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::Simulator().

void Potts3D::setFrozenTypeVector ( std::vector< unsigned char > &  _frozenTypeVec  ) 

Definition at line 844 of file Potts3D.cpp.

References frozenTypeVec, and sizeFrozenTypeVec.

Referenced by CompuCell3D::CellTypePlugin::update().

const std::vector<unsigned char>& CompuCell3D::Potts3D::getFrozenTypeVector (  )  [inline]

Definition at line 185 of file Potts3D.h.

Referenced by CompuCell3D::BoxWatcher::extraInit().

Point3D CompuCell3D::Potts3D::getFlipNeighbor (  )  [inline]

void CompuCell3D::Potts3D::setBoundaryXName ( std::string const &  _xName  )  [inline]

Definition at line 189 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D().

void CompuCell3D::Potts3D::setBoundaryYName ( std::string const &  _yName  )  [inline]

Definition at line 190 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D().

void CompuCell3D::Potts3D::setBoundaryZName ( std::string const &  _zName  )  [inline]

Definition at line 191 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D().

std::string const& CompuCell3D::Potts3D::getBoundaryXName (  )  const [inline]

std::string const& CompuCell3D::Potts3D::getBoundaryYName (  )  const [inline]

std::string const& CompuCell3D::Potts3D::getBoundaryZName (  )  const [inline]

void CompuCell3D::Potts3D::setMinCoordinates ( Point3D  _minCoord  )  [inline]

Definition at line 196 of file Potts3D.h.

Referenced by CompuCell3D::BoxWatcher::adjustBox().

void CompuCell3D::Potts3D::setMaxCoordinates ( Point3D  _maxCoord  )  [inline]

Definition at line 197 of file Potts3D.h.

Referenced by CompuCell3D::BoxWatcher::adjustBox().

Point3D CompuCell3D::Potts3D::getMinCoordinates (  )  const [inline]

Definition at line 198 of file Potts3D.h.

Point3D CompuCell3D::Potts3D::getMaxCoordinates (  )  const [inline]

Definition at line 199 of file Potts3D.h.

TypeTransition* CompuCell3D::Potts3D::getTypeTransition (  )  [inline]

Definition at line 200 of file Potts3D.h.

Referenced by CompuCell3D::PIFInitializer::start().

void Potts3D::createEnergyFunction ( std::string  _energyFunctionType  )  [virtual]

EnergyFunctionCalculator* CompuCell3D::Potts3D::getEnergyFunctionCalculator (  )  [inline]

Definition at line 203 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D().

CellInventory& CompuCell3D::Potts3D::getCellInventory (  )  [inline]

void Potts3D::registerAttributeAdder ( AttributeAdder _attrAdder  )  [virtual]

Definition at line 199 of file Potts3D.cpp.

References attrAdder.

void Potts3D::registerEnergyFunction ( EnergyFunction function  )  [virtual]

void Potts3D::registerEnergyFunctionWithName ( EnergyFunction _function,
std::string  _functionName 
) [virtual]

void Potts3D::unregisterEnergyFunction ( std::string  _functionName  )  [virtual]

double CompuCell3D::Potts3D::getNewNumber (  )  [inline]

Definition at line 214 of file Potts3D.h.

void Potts3D::registerAutomaton ( Automaton autom  )  [virtual]

Automaton * Potts3D::getAutomaton (  )  [virtual]

void Potts3D::registerAcceptanceFunction ( AcceptanceFunction function  )  [virtual]

Set the acceptance function. This is DefaultAcceptanceFunction by default.

Definition at line 245 of file Potts3D.cpp.

References acceptanceFunction, and ASSERT_OR_THROW.

void Potts3D::setAcceptanceFunctionByName ( std::string  _acceptanceFunctionName  )  [virtual]

virtual AcceptanceFunction* CompuCell3D::Potts3D::getAcceptanceFunction (  )  [inline, virtual]

Definition at line 229 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::initializePottsCC3D(), and update().

void Potts3D::registerCellGChangeWatcher ( CellGChangeWatcher _watcher  )  [virtual]

void Potts3D::registerClassAccessor ( BasicClassAccessorBase _accessor  )  [virtual]

Register accessor to a class with a cellGroupFactory. Accessor will access a class which is a mamber of a BasicClassGroup.

Definition at line 262 of file Potts3D.cpp.

References ASSERT_OR_THROW, cellFactoryGroup, and BasicClassGroupFactory::registerClass().

void Potts3D::registerStepper ( Stepper stepper  )  [virtual]

Add a potts stepper to be called after each potts step.

Definition at line 269 of file Potts3D.cpp.

References ASSERT_OR_THROW, and steppers.

Referenced by CompuCell3D::VolumeTrackerPlugin::init(), CompuCell3D::MitosisPlugin::init(), CompuCell3D::GrowthPlugin::init(), and CompuCell3D::ConcentrationPlugin::init().

void Potts3D::registerFixedStepper ( FixedStepper fixedStepper  )  [virtual]

Definition at line 275 of file Potts3D.cpp.

References ASSERT_OR_THROW, and fixedSteppers.

Referenced by CompuCell3D::PDESolverCallerPlugin::init().

double Potts3D::getEnergy (  ) 

Returns:
Current energy.

Definition at line 233 of file Potts3D.cpp.

References energy.

Referenced by CompuCell3D::Simulator::start(), and CompuCell3D::Simulator::step().

CellG * Potts3D::createCellG ( const Point3D  pt  )  [virtual]

void Potts3D::destroyCellG ( CellG cell,
bool  _removeFromInventory = true 
) [virtual]

BasicClassGroupFactory* CompuCell3D::Potts3D::getCellFactoryGroupPtr (  )  [inline]

virtual unsigned int CompuCell3D::Potts3D::getNumCells (  )  [inline, virtual]

dealocate a BasicClassGroup

Deallocate a cell.

Parameters:
cell The cell to destroy.
Returns:
The current number of cells in the field.

Definition at line 279 of file Potts3D.h.

Referenced by CompuCell3D::Simulator::start(), and CompuCell3D::Simulator::step().

double Potts3D::totalEnergy (  )  [virtual]

Returns:
The current size in bytes of a cell. Calculate the current total energy of the system.

The freshly calculated energy.

Definition at line 321 of file Potts3D.cpp.

References cellFieldG, TypeChangeWatcherExample::dim, energy, energyFunctions, CompuCell3D::Point3D::x, CompuCell3D::Point3D::y, and CompuCell3D::Point3D::z.

double Potts3D::changeEnergy ( Point3D  pt,
const CellG newCell,
const CellG oldCell 
) [virtual]

Calculate the energy change of a proposed flip.

Parameters:
pt The point to flip.
newCell The new spin.
oldCell The old spin.
Returns:
The energy change.

Definition at line 337 of file Potts3D.cpp.

References energyFunctions.

unsigned int Potts3D::metropolis ( const unsigned int  steps,
const double  temp 
) [virtual]

Run the potts metropolis algorithm.

Parameters:
steps The numer of flip attempts to make.
temp The current temperature.
Returns:
The total number of accepted flips.

Definition at line 347 of file Potts3D.cpp.

References metropolisFcnPtr.

Referenced by CompuCell3D::Simulator::step().

unsigned int Potts3D::metropolisList ( const unsigned int  steps,
const double  temp 
)

Dim3D dim = cellField->getDim();

Cell *cell = cellField->get(pt);

must also make sure that cell ptr is different 0; Will never freeze medium

must also make sure that cell ptr is different 0; Will never freeze medium

change takes place at change pixel and pt is a neighbor of changePixel

cout<<"This is change: "<<change<<endl;

Definition at line 351 of file Potts3D.cpp.

References CompuCell3D::AcceptanceFunction::accept(), acceptanceFunction, ASSERT_OR_THROW, attemptedEC, cellFieldG, cellTypeMotilityVec, CompuCell3D::EnergyFunctionCalculator::changeEnergy(), checkIfFrozen(),