VPTissue Reference Manual
cell_housekeep/WrapperModel.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 "WrapperModel.h"
21 
22 #include "bio/BoundaryType.h"
23 #include "bio/Cell.h"
24 #include "bio/Mesh.h"
25 #include "sim/CoreData.h"
26 
27 #include <boost/property_tree/ptree.hpp>
28 
29 namespace SimPT_Default {
30 namespace CellHousekeep {
31 
32 using boost::property_tree::ptree;
33 
35 {
36  Initialize(cd);
37 }
38 
40 {
41  m_cd = cd;
42 
43  const auto& p = m_cd.m_parameters->get_child("wrapper_model");
44  m_ch0_threshold = p.get<double>("ch0_threshold");
45  m_expansion_rate = p.get<double>("expansion_rate");
46 }
47 
49 {
50  const double t_area = cell->GetTargetArea();
51  const double a_area = cell->GetArea();
52 
53  // Prevent the 8 upper cells from expanding. They are used as a boundary
54  // layer and are not supposed to grow / divide akin to regular cells.
55  if (cell->GetIndex() > 7) {
56  if ((cell->GetChemical(0) / a_area) > m_ch0_threshold /*|| (c->Chemical(6) / c->Area()) > 0.5 */) {
57  const double incr = m_expansion_rate * a_area; //Time step dependent
58  const double update_t_area = t_area + incr;
59  cell->SetTargetArea(update_t_area);
60  }
61  }
62 }
63 
64 } // namespace
65 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
A cell contains walls and nodes.
Definition: Cell.h:48
Core data used during model execution.
CellHousekeep for Wrapper model.
Namespace for components of the Default model group.
Interface for Cell.
BoundaryType enumeration class.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
int GetIndex() const
Return the index.
Definition: Cell.h:76
WrapperModel(const CoreData &cd)
Initializing constructor.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178
Interface for Mesh.