VPTissue Reference Manual
AreaThresholdBased.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 "AreaThresholdBased.h"
21 
22 #include "bio/BoundaryType.h"
23 #include "bio/Cell.h"
24 #include "sim/CoreData.h"
25 
26 #include <boost/property_tree/ptree.hpp>
27 
28 namespace SimPT_Default {
29 namespace CellSplit {
30 
31 using namespace std;
32 using namespace SimPT_Sim::Util;
33 using namespace boost::property_tree;
34 
36 {
37  Initialize(cd);
38 }
39 
41 {
42  m_cd = cd;
43  auto& p = m_cd.m_parameters;
44 
45  m_base_area = p->get<double>("cell_mechanics.base_area");
46  m_division_ratio = p->get<double>("cell_mechanics.division_ratio");
47  m_div_area = m_division_ratio * m_base_area;
48 }
49 
50 tuple<bool, bool, array<double, 3>> AreaThresholdBased::operator()(Cell* cell)
51 {
52  bool must_divide = false;
53 
54  // Only trigger division for cells with a regular boundary
55  if (cell->GetBoundaryType() == BoundaryType::None && cell->GetArea() > m_div_area) {
56  must_divide = true;
57  }
58 
59  return make_tuple(must_divide, false, array<double, 3>());
60 }
61 
62 } // namespace
63 } // namespace
64 
void Initialize(const CoreData &cd)
Initialize or re-initialize.
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
Core data used during model execution.
Namespace for miscellaneous utilities.
Definition: PTreeFile.cpp:44
Namespace for components of the Default model group.
AreaThresholdBased(const CoreData &cd)
Initializing constructor.
Interface for Cell.
std::tuple< bool, bool, std::array< double, 3 > > operator()(Cell *cell)
Execute.
BoundaryType enumeration class.
CellSplit for AreaThresholdBased model.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178