VPTissue Reference Manual
cell_split/Blad.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 "Blad.h"
21 
22 #include "bio/Cell.h"
23 
24 #include <cmath>
25 #include <iostream>
26 
27 namespace SimPT_Blad {
28 namespace CellSplit {
29 
30 using namespace std;
31 using namespace SimPT_Sim::Util;
32 using namespace boost::property_tree;
33 
34 Blad::Blad(const CoreData& cd)
35 {
36  Initialize(cd);
37 }
38 
39 void Blad::Initialize(const CoreData& cd)
40 {
41  m_cd = cd;
42  const auto& p = m_cd.m_parameters->get_child("blad");
43  m_M_threshold_division = p.get<double>("M_threshold_division");
44  m_size_threshold_division = p.get<double>("size_threshold_division");
45 }
46 
47 std::tuple<bool, bool, std::array<double, 3>> Blad::operator()(Cell* cell)
48 {
49  const double chem1 = cell->GetChemical(1);
50  const double a_area = cell->GetArea();
51 
52  bool must_divide = false;
53 
54  if (cell->GetBoundaryType() == BoundaryType::None) {
55  if ( ( chem1 / a_area ) >= m_M_threshold_division ) {
56  if ( a_area >= m_size_threshold_division) {
57  must_divide = true;
58  }
59  }
60  }
61 
62  return std::make_tuple(must_divide, false, std::array<double, 3>());
63 }
64 
65 } // namespace
66 } // namespace
67 
Namespace for components of the Blad model group.
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
Namespace for miscellaneous utilities.
Definition: PTreeFile.cpp:44
std::tuple< bool, bool, std::array< double, 3 > > operator()(Cell *cell)
Execute.
CellSplit for Blad model.
Interface for Cell.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178
void Initialize(const CoreData &cd)
Initialize or re-initialize.
Blad(const CoreData &cd)
Initializing constructor.