VPTissue Reference Manual
cell_housekeep/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/BoundaryType.h"
23 #include "bio/Cell.h"
24 #include "bio/Mesh.h"
25 #include "math/RandomEngine.h"
26 
27 #include <trng/uniform01_dist.hpp>
28 
29 namespace SimPT_Default {
30 namespace CellHousekeep {
31 
32 using namespace std;
33 using namespace boost::property_tree;
34 
36 {
37  Initialize(cd);
38 }
39 
41 {
42  m_cd = cd;
43 
44  const trng::uniform01_dist<double> dist;
45  m_uniform_generator = m_cd.m_random_engine->GetGenerator(dist);
46 
47  const auto& p = m_cd.m_parameters;
48  m_ga_threshold = p->get<double>("wortel.ga_threshold");
49  m_shy2_threshold = p->get<double>("wortel.shy2_threshold");
50 }
51 
53 {
54  const double chem2 = cell->GetChemical(2);
55  const double chem3 = cell->GetChemical(3);
56  const int celltype = cell->GetCellType();
57  const double t_area = cell->GetTargetArea();
58  const double a_area = cell->GetArea();
59 
60 // if (/*sim->GetSimTime() m_mesh*/m_sim->GetSimTime() == 0)
61 // {
62 // cell->SetChemical(1,0.000);
63 // }
64 
65  // DDV: EXPONENTIAL GROWTH WITH CHEMICAL 1 FOR START/STOP
66 // if ( ( chem1 / a_area ) > 1./*1.0 0.085*/)
67 // {
68 // const double incr = 0.1;
69 // const double update_t_area = t_area + incr;
70 // cell->SetTargetArea(update_t_area);
71 // }
72 
73  if (cell->GetBoundaryType() == BoundaryType::None)
74  {
75  if (celltype != 0 && (chem3 / a_area) >= m_ga_threshold) {
76  if ((chem2 / a_area) < m_shy2_threshold) {
77  const double incr = 0.02 * a_area;
78  const double update_t_area = t_area + incr;
79  cell->SetTargetArea(update_t_area);
80  } else {
81  const double incr = 0.2 * a_area;
82  const double update_t_area = t_area + incr;
83  cell->SetTargetArea(update_t_area);
84  }
85  }
86 
87 /*
88 
89  if (cell->GetBoundary() == BoundaryType::Type::None) {
90  if (cell->GetArea() > threshold * m_cell_base_area) {
91  cell->SetChemical(0, 0);
92  must_divide = true;
93  }
94 
95  // Updates
96  const double incr = m_auxin_dependent_growth ? (chem / (1. + chem)) * rate : rate;
97  const double update_t_area = t_area + incr;
98  const double update_factor = update_t_area / t_area;
99  const double update_t_length = t_length * sqrt(update_factor);
100 
101  cell->SetTargetArea(update_t_area);
102  cell->SetTargetLength(update_t_length);
103  }
104 */
105  }
106 
107 /*
108  static ofstream myfile1;
109  // if ((int)m_mesh->GetSimTime() % 600 == 0)
110  // {
111  myfile1.open("datadumpIUAP_1.txt",std::ios::app);
112  myfile1 << (cell->GetChemical(0)) / (cell->GetArea()) << "\t";
113  myfile1.close();
114 //
115 // auto &transfer_map=m_cd.m_coupled_sim_transfer_data;
116 
117 // double transfer_value=0.0;
118 
119 // auto it=transfer_map.find(cell->GetIndex());
120 // if (it!=transfer_map.end())
121 // {
122 // transfer_value=it->second;
123 // }
124 */
125 
126 }
127 
128 } // namespace
129 } // 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
CellHousekeep for Wortel model.
Interface of RandomEngine.
Namespace for components of the Default model group.
Interface for Cell.
Wortel(const CoreData &cd)
Initializing constructor.
BoundaryType enumeration class.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178
Interface for Mesh.