36 #include "AbstractOnLatticeCellPopulation.hpp"
38 template<
unsigned DIM>
40 std::vector<CellPtr>& rCells,
41 const std::vector<unsigned> locationIndices,
44 mDeleteMesh(deleteMesh),
45 mUpdateNodesInRandomOrder(true),
46 mIterateRandomlyOverUpdateRuleCollection(false)
48 std::list<CellPtr>::iterator it = this->
mCells.begin();
49 for (
unsigned i=0; it != this->
mCells.end(); ++it, ++i)
51 unsigned index = locationIndices.empty() ? i : locationIndices[i];
56 template<
unsigned DIM>
60 mUpdateNodesInRandomOrder(true),
61 mIterateRandomlyOverUpdateRuleCollection(false)
65 template<
unsigned DIM>
70 template<
unsigned DIM>
73 return mUpdateNodesInRandomOrder;
76 template<
unsigned DIM>
79 mUpdateNodesInRandomOrder = updateNodesInRandomOrder;
82 template<
unsigned DIM>
85 mIterateRandomlyOverUpdateRuleCollection = iterateRandomly;
88 template<
unsigned DIM>
91 return mIterateRandomlyOverUpdateRuleCollection;
94 template<
unsigned DIM>
97 EXCEPTION(
"SetNode() cannot be called on a subclass of AbstractOnLatticeCellPopulation.");
100 template<
unsigned DIM>
103 EXCEPTION(
"Cannot call GetNeighbouringNodeIndices() on a subclass of AbstractOnLatticeCellPopulation, need to go through the PottsMesh instead");
104 std::set<unsigned> neighbouring_node_indices;
105 return neighbouring_node_indices;
108 template<
unsigned DIM>
111 *rParamsFile <<
"\t\t<UpdateNodesInRandomOrder>" << mUpdateNodesInRandomOrder <<
"</UpdateNodesInRandomOrder>\n";
112 *rParamsFile <<
"\t\t<IterateRandomlyOverUpdateRuleCollection>" << mIterateRandomlyOverUpdateRuleCollection <<
"</IterateRandomlyOverUpdateRuleCollection>\n";
118 template<
unsigned DIM>
124 template<
unsigned DIM>
127 return mUpdateRuleCollection;
130 template<
unsigned DIM>
133 mUpdateRuleCollection.clear();
bool GetUpdateNodesInRandomOrder()
void SetUpdateNodesInRandomOrder(bool updateNodesInRandomOrder)
void SetIterateRandomlyOverUpdateRuleCollection(bool iterateRandomly)
virtual void OutputCellPopulationParameters(out_stream &rParamsFile)=0
#define EXCEPTION(message)
std::set< unsigned > GetNeighbouringNodeIndices(unsigned index)
void SetNode(unsigned index, ChastePoint< DIM > &rNewLocation)
virtual void OutputCellPopulationParameters(out_stream &rParamsFile)
AbstractOnLatticeCellPopulation(AbstractMesh< DIM, DIM > &rMesh)
virtual void RemoveAllUpdateRules()
virtual ~AbstractOnLatticeCellPopulation()
std::list< CellPtr > mCells
virtual const std::vector< boost::shared_ptr< AbstractUpdateRule< DIM > > > GetUpdateRuleCollection() const
virtual double GetDefaultTimeStep()
bool GetIterateRandomlyOverUpdateRuleCollection()
virtual void AddCellUsingLocationIndex(unsigned index, CellPtr pCell)