VPTissue Reference Manual
cell2cell_transport/Source.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 "Source.h"
21 
22 #include "bio/Cell.h"
23 #include "bio/Wall.h"
24 
25 namespace SimPT_Default {
26 namespace CellToCellTransport {
27 
28 using namespace std;
29 using namespace boost::property_tree;
30 
32 {
33  Initialize(cd);
34 }
35 
37 {
38  m_cd = cd;
39  auto& p = m_cd.m_parameters;
40 
41  m_chemical_count = p->get<unsigned int>("model.cell_chemical_count");
42  m_ka = p->get<double>("auxin_transport.ka");
43  m_tip_source = p->get<double>("auxin_transport.leaf_tip_source");
44  m_transport = p->get<double>("auxin_transport.transport");
45 
46  m_D.assign(m_chemical_count, 0.0);
47  boost::optional<ptree&> arr_D = p->get_child_optional("auxin_transport.D.value_array");
48  if (arr_D) {
49  m_D[0] = arr_D->begin()->second.get_value<double>();
50  }
51 }
52 
53 void Source::operator()(Wall* w, double* dchem_c1, double* dchem_c2)
54 {
55  double const phi = w->GetLength() * m_D[0]
56  * (w->GetC2()->GetChemical(0) - w->GetC1()->GetChemical(0));
57  dchem_c1[0] += phi;
58  dchem_c2[0] -= phi;
59 
60  // Active fluxes (PIN1 mediated transport)(Transporters measured in moles, here)
61  double const trans12 = m_transport * w->GetTransporters1(1) * w->GetC1()->GetChemical(0)
62  / (m_ka + w->GetC1()->GetChemical(0));
63  double const trans21 = m_transport * w->GetTransporters2(1) * w->GetC2()->GetChemical(0)
64  / (m_ka + w->GetC2()->GetChemical(0));
65 
66  dchem_c1[0] += trans21 - trans12;
67  dchem_c2[0] += trans12 - trans21;
68 
69  // Influx at leaf "AuxinSource" (as specified in initial condition)
70  if (w->IsAuxinSource()) {
71  double const aux_flux = m_tip_source * w->GetLength();
72  dchem_c1[0] += aux_flux;
73  dchem_c2[0] += aux_flux;
74  }
75 }
76 
77 } // namespace
78 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
STL namespace.
Source CellToCellTransport component.
Source(const CoreData &cd)
Initializing constructor.
void operator()(Wall *w, double *dchem_c1, double *dchem_c2)
Execute.
Namespace for components of the Default model group.
Interface for Cell.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
double GetLength() const
Returns (and calculates, if length marked as dirty) the length along all nodes.
Definition: Wall.cpp:97
A cell wall, runs between cell corner points and consists of wall elements.
Definition: Wall.h:48
Interface for Wall.