VPTissue Reference Manual
cell_split/Wortel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "Wortel.h"
21 
22 #include "bio/Cell.h"
23 #include "math/RandomEngine.h"
24 
25 #include <trng/uniform01_dist.hpp>
26 #include <cmath>
27 #include <iostream>
28 
29 namespace SimPT_Default {
30 namespace CellSplit {
31 
32 using namespace std;
33 using namespace boost::property_tree;
34 
36 {
37  Initialize(cd);
38 }
39 
41 {
42  m_cd = cd;
43  const trng::uniform01_dist<double> dist;
44  m_uniform_generator = m_cd.m_random_engine->GetGenerator(dist);
45 
46  const auto& p = m_cd.m_parameters;
47  m_ga_threshold = p->get<double>("wortel.ga_threshold");
48  m_shy2_threshold = p->get<double>("wortel.shy2_threshold");
49  //m_cell_base_area = p->get<double>("cell_mechanics.base_area");
50  //m_division_ratio = p->get<double>("cell_mechanics.division_ratio");
51  m_fixed_division_axis = p->get<bool>("cell_mechanics.fixed_division_axis", false);
52 
53  //m_div_area = m_division_ratio * m_cell_base_area;
54 }
55 
56 std::tuple<bool, bool, std::array<double, 3>> Wortel::operator()(Cell* cell)
57 {
58  const double chem2 = cell->GetChemical(2);
59  const double chem3 = cell->GetChemical(3);
60  const int celltype = cell->GetCellType();
61  const double a_area = cell->GetArea();
62  bool must_divide = false;
63 
64  double time_now = m_cd.m_time_data->m_sim_time;
65  double time_start = 0;//DDV: How fetch from xml file?
66 
67  if (cell->GetBoundaryType() == BoundaryType::None) {
68  double CCnoise = 1 + (m_uniform_generator() - 0.5) / 5;
69 
70  if ( cell->GetIndex() > 60 ) {
71  if ( (( chem2 / a_area ) < m_shy2_threshold) && (( chem3 / a_area ) >= m_ga_threshold)) {
72  if ( ( celltype > 2 && celltype < 8 ) && ( a_area >= ( 200. * CCnoise) )
73  // JB: changed 10. to 40. to reflect change in time management
74  && ( ( time_now - time_start ) >= 40. ) ) {
75  must_divide = true;
76  }
77  if ( celltype != 0 && ( celltype > 7 || celltype < 3 ) && ( a_area >= ( 400.* CCnoise) )
78  // JB: changed 10. to 40. to reflect change in time management
79  && ( ( time_now - time_start ) >= 40.) ) {
80  must_divide = true;
81  }
82  }
83  }
84  }
85 
86  return std::make_tuple(must_divide, true, array<double, 3> {{1.0, 0.0, 0.0}});
87 
88 }
89 
90 } // namespace
91 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
STL namespace.
A cell contains walls and nodes.
Definition: Cell.h:48
std::tuple< bool, bool, std::array< double, 3 > > operator()(Cell *cell)
Execute.
Interface of RandomEngine.
Namespace for components of the Default model group.
Interface for Cell.
int GetIndex() const
Return the index.
Definition: Cell.h:76
void Initialize(const CoreData &cd)
Initialize or re-initialize.
Wortel(const CoreData &cd)
Initializing constructor.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178
CellSplit for Wortel model.