36 #include "CryptSimulation2d.hpp"
37 #include "WntConcentration.hpp"
38 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.hpp"
39 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo.hpp"
40 #include "CellBetaCateninWriter.hpp"
41 #include "MeshBasedCellPopulation.hpp"
45 bool deleteCellPopulationInDestructor,
48 deleteCellPopulationInDestructor,
50 mUsingMeshBasedCellPopulation(false)
59 EXCEPTION(
"CryptSimulation2d is to be used with MeshBasedCellPopulation or VertexBasedCellPopulation (or subclasses) only");
84 c_vector<double, 2> parent_coords =
mrCellPopulation.GetLocationOfCellCentre(pParentCell);
85 c_vector<double, 2> daughter_coords;
92 c_vector<double, 2> random_vector;
100 random_angle *= 2.0*M_PI;
102 random_vector(0) = 0.5*separation*cos(random_angle);
103 random_vector(1) = 0.5*separation*sin(random_angle);
105 c_vector<double, 2> proposed_new_parent_coords = parent_coords - random_vector;
106 c_vector<double, 2> proposed_new_daughter_coords = parent_coords + random_vector;
108 if ((proposed_new_parent_coords(1) >= 0.0) && (proposed_new_daughter_coords(1) >= 0.0))
111 parent_coords = proposed_new_parent_coords;
112 daughter_coords = proposed_new_daughter_coords;
116 proposed_new_daughter_coords = parent_coords + 2.0*random_vector;
117 while (proposed_new_daughter_coords(1) < 0.0)
120 random_angle *= 2.0*M_PI;
122 random_vector(0) = separation*cos(random_angle);
123 random_vector(1) = separation*sin(random_angle);
124 proposed_new_daughter_coords = parent_coords + random_vector;
126 daughter_coords = proposed_new_daughter_coords;
129 assert(daughter_coords(1) >= 0.0);
130 assert(parent_coords(1) >= 0.0);
135 unsigned node_index =
mrCellPopulation.GetLocationIndexUsingCell(pParentCell);
138 return daughter_coords;
146 c_vector<double, 2> axis_of_division = p_vertex_population->
147 GetVertexBasedDivisionRule()->CalculateCellDivisionVector(pParentCell, *p_vertex_population);
151 if (!is_wnt_included)
156 axis_of_division(0) = 1.0;
157 axis_of_division(1) = 0.0;
160 return axis_of_division;
175 if (dynamic_cast<AbstractVanLeeuwen2009WntSwatCellCycleModel*>(this->
mrCellPopulation.Begin()->GetCellCycleModel()))
180 if (dynamic_cast<AbstractVanLeeuwen2009WntSwatCellCycleModel*>(
mrCellPopulation.Begin()->GetCellCycleModel()))
199 double threshold_height = 1.0;
202 threshold_height = 0.5;
210 if (
mrCellPopulation.GetLocationOfCellCentre(*cell_iter)[1] < threshold_height)
213 cell_iter->SetAncestor(p_cell_ancestor);
223 *rParamsFile <<
"\t\t<CryptCircumference>" << width <<
"</CryptCircumference>\n";
224 *rParamsFile <<
"\t\t<UseJiggledBottomCells>" << use_jiggled_bottom_cells <<
"</UseJiggledBottomCells>\n";
bool mDeleteCellPopulationInDestructor
virtual void SetupSolve()
#define EXCEPTION(message)
std::vector< boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, ELEMENT_DIM > > > mBoundaryConditions
bool mUsingMeshBasedCellPopulation
out_stream mpVizSetupFile
CryptSimulation2d(AbstractCellPopulation< 2 > &rCellPopulation, bool deleteCellPopulationInDestructor=false, bool initialiseCells=true)
static WntConcentration * Instance()
void UseJiggledBottomCells()
static RandomNumberGenerator * Instance()
void OutputSimulationParameters(out_stream &rParamsFile)
void SetBottomCellAncestors()
c_vector< double, 2 > CalculateCellDivisionVector(CellPtr pParentCell)
#define CHASTE_CLASS_EXPORT(T)
virtual ~CryptSimulation2d()
#define MAKE_PTR_ARGS(TYPE, NAME, ARGS)
virtual void OutputSimulationParameters(out_stream &rParamsFile)
void AddCellPopulationBoundaryCondition(boost::shared_ptr< AbstractCellPopulationBoundaryCondition< ELEMENT_DIM, ELEMENT_DIM > > pBoundaryCondition)
AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > & mrCellPopulation