73 typedef typename if_< is_same<T1, T2>, integral_c<unsigned, 1>, integral_c<unsigned, 0> >::type selector_t;
117 std::vector<CellPtr>& rCells,
119 const std::vector<unsigned> locationIndices,
120 bool randomBirthTimes,
125 bool initialiseCells)
135 unsigned num_cells = locationIndices.empty() ? pMesh->
GetNumNodes() : locationIndices.size();
136 rCells.reserve(num_cells);
140 mesh_size =
static_cast<PottsMesh<2>*
>(pMesh)->GetNumElements();
141 rCells.reserve(mesh_size);
148 rCells.reserve(mesh_size);
154 for (
unsigned i=0; i<mesh_size; i++)
160 if (locationIndices.empty())
162 y = pMesh->
GetNode(i)->GetPoint().rGetLocation()[1];
165 else if (std::find(locationIndices.begin(), locationIndices.end(), i) != locationIndices.end())
167 y = pMesh->
GetNode(i)->GetPoint().rGetLocation()[1];
172 y =
static_cast<PottsMesh<2>*
>(pMesh)->GetCentroidOfElement(i)[1];
182 CELL_CYCLE_MODEL* p_cell_cycle_model =
new CELL_CYCLE_MODEL;
183 p_cell_cycle_model->SetDimension(2);
185 double typical_transit_cycle_time = p_cell_cycle_model->GetAverageTransitCellCycleTime();
186 double typical_stem_cycle_time = p_cell_cycle_model->GetAverageStemCellCycleTime();
188 double birth_time = 0.0;
189 if (randomBirthTimes)
191 birth_time = -p_random_num_gen->
ranf();
195 unsigned generation = 4;
218 CellPtr p_cell(
new Cell(p_state, p_cell_cycle_model));
228 if (y >= y3 && p_cell_cycle_model->CanCellTerminallyDifferentiate())
237 p_cell->InitialiseCellCycleModel();
243 birth_time *= typical_stem_cycle_time;
247 birth_time *= typical_transit_cycle_time;
249 p_cell->SetBirthTime(birth_time);
251 if (locationIndices.empty())
253 rCells.push_back(p_cell);
255 else if (std::find(locationIndices.begin(), locationIndices.end(), i) != locationIndices.end())
257 rCells.push_back(p_cell);
void Generate(std::vector< CellPtr > &rCells, AbstractMesh< 2, 2 > *pMesh, const std::vector< unsigned > locationIndices, bool randomBirthTimes, double y0=0.3, double y1=2.0, double y2=3.0, double y3=4.0, bool initialiseCells=false)