VPTissue Reference Manual
cell_split/Geometric.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 "Geometric.h"
21 
22 #include "bio/Cell.h"
23 #include "math/RandomEngine.h"
24 #include "sim/CoreData.h"
25 
26 #include <cmath>
27 #include <iostream>
28 #include <trng/uniform01_dist.hpp>
29 
30 namespace SimPT_Default {
31 namespace CellSplit {
32 
33 using namespace std;
34 using namespace boost::property_tree;
35 
37 {
38  Initialize(cd);
39 }
40 
42 {
43  const trng::uniform01_dist<double> dist;
44  m_uniform_generator = cd.m_random_engine->GetGenerator(dist);
45 
46  auto& p = cd.m_parameters;
47  m_cell_base_area = p->get<double>("cell_mechanics.base_area");
48  m_division_ratio = p->get<double>("cell_mechanics.division_ratio");
49  m_fixed_division_axis = p->get<bool>("cell_mechanics.fixed_division_axis", false);
50  m_div_area = m_division_ratio * m_cell_base_area;
51 }
52 
53 std::tuple<bool, bool, std::array<double, 3>> Geometric::operator()(Cell* cell)
54 {
55  const double CCnoise = 1 + 0.*(m_uniform_generator() - 0.5) / 5;
56  const bool must_divide = (cell->GetArea() > m_div_area * CCnoise);
57  return std::make_tuple(must_divide, m_fixed_division_axis, std::array<double, 3> {{1.0, 0.0, 0.0}});
58 }
59 
60 } // namespace
61 } // 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
Core data used during model execution.
std::tuple< bool, bool, std::array< double, 3 > > operator()(Cell *cell)
Execute.
Interface of RandomEngine.
Geometric(const CoreData &cd)
Initializing constructor.
Namespace for components of the Default model group.
Interface for Cell.
CellSplit for Geometric model.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178