VPTissue Reference Manual
cell_chemistry/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/BoundaryType.h"
23 #include "bio/Cell.h"
24 #include "bio/ReduceCellWalls.h"
25 
26 using namespace std;
27 using namespace SimPT_Sim::Util;
28 using boost::property_tree::ptree;
29 
30 namespace SimPT_Blad {
31 namespace CellChemistry {
32 
33 Blad::Blad(const CoreData& cd)
34 {
35  Initialize(cd);
36 }
37 
38 void Blad::Initialize(const CoreData& cd)
39 {
40  m_cd = cd;
41  const auto& p = m_cd.m_parameters->get_child("auxin_transport");
42 
43  const auto& q = m_cd.m_parameters->get_child("blad");
44  m_aux1prod = p.get<double>("aux1prod");
45  m_aux_breakdown = p.get<double>("aux_breakdown");
46  m_grid_size = q.get<int>("grid_size");
47  m_M_degradation = q.get<double>("M_degradation");
48  m_M_duration = q.get<double>("M_duration");
49  m_M_production = q.get<double>("M_production");
50 }
51 
52 void Blad::operator()(Cell* cell, double* dchem)
53 {
54 
55  double time_now = m_cd.m_time_data->m_sim_time;
56  const double chem1 = cell->GetChemical(1);
57  //const double a_area = cell->GetArea();
58 
59  bool produces_M = false;
60  if (m_grid_size == 32) {
61  if(cell->GetIndex() > 15 && cell->GetIndex() < 32) {
62  produces_M = true;
63  }
64  } else if (m_grid_size == 128) {
65  if ((cell->GetIndex() > 15 && cell->GetIndex() < 32)
66  || (cell->GetIndex() > 52 && cell->GetIndex() < 61)
67  || (cell->GetIndex() > 63 && cell->GetIndex() < 72)
68  || (cell->GetIndex() > 81 && cell->GetIndex() < 86)
69  || (cell->GetIndex() > 93 && cell->GetIndex() < 98)
70  || (cell->GetIndex() > 103 && cell->GetIndex() < 128)) {
71  produces_M = true;
72  }
73  } else if (m_grid_size == 512) {
74  if ((cell->GetIndex() > 15 && cell->GetIndex() < 32)
75  || (cell->GetIndex() > 52 && cell->GetIndex() < 61)
76  || (cell->GetIndex() > 63 && cell->GetIndex() < 72)
77  || (cell->GetIndex() > 81 && cell->GetIndex() < 86)
78  || (cell->GetIndex() > 93 && cell->GetIndex() < 98)
79  || (cell->GetIndex() > 103 && cell->GetIndex() < 128)
80  || (cell->GetIndex() > 135 && cell->GetIndex() < 144)
81  || (cell->GetIndex() > 187 && cell->GetIndex() < 196)
82  || (cell->GetIndex() > 207 && cell->GetIndex() < 256)
83  || (cell->GetIndex() > 280 && cell->GetIndex() < 297)
84  || (cell->GetIndex() > 375 && cell->GetIndex() < 392)
85  || (cell->GetIndex() > 395 && cell->GetIndex() < 412)
86  || (cell->GetIndex() > 431 && cell->GetIndex() < 512)) {
87  produces_M = true;
88  }
89  }
90 
91  if( produces_M && time_now < m_M_duration ) {
92  dchem[1] = m_M_production - m_M_degradation * chem1; //Half the production rate w.r.t. reference model
93  } else {
94  dchem[1] = -m_M_degradation * chem1;
95  }
96 }
97 
98 } // namespace
99 } // namespace
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
Interface for Cell.
BoundaryType enumeration class.
CellChemistry for Blad model.
int GetIndex() const
Return the index.
Definition: Cell.h:76
Interface/Implementation for ReduceCellWalls.