VPTissue Reference Manual
cell2cell_transport/Meinhardt.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 "Meinhardt.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  ptree const& arr_D = p->get_child("auxin_transport.D.value_array");
43  unsigned int c = 0;
44  m_D.clear();
45  for (auto it = arr_D.begin(); it != arr_D.end(); it++) {
46  if (c == m_chemical_count) {
47  break;
48  }
49  m_D.push_back(it->second.get_value<double>());
50  c++;
51  }
52  // Defensive: if fewer than chemical_count parameters were specified, fill up.
53  for (unsigned int i = c; i < m_chemical_count; i++) {
54  m_D.push_back(0.0);
55  }
56 }
57 
58 void Meinhardt::operator()(Wall* w, double* dchem_c1, double* dchem_c2)
59 {
60  // No flux boundaries for all chemicals, except activator: boundary is sink
61  if (w->GetC1()->IsBoundaryPolygon() || w->GetC2()->IsBoundaryPolygon()) {
62 
63 
64  if (w->GetC1()->IsBoundaryPolygon()) {
65  dchem_c2[1] -= w->GetLength() * m_D[1] * (w->GetC2()->GetChemical(1));
66  } else {
67  dchem_c1[1] -= w->GetLength() * m_D[1] * (w->GetC1()->GetChemical(1));
68  }
69 
70  return;
71  }
72 
73  // Passive fluxes (Fick's law)
74  for (unsigned int i = 0; i < m_chemical_count; i++) {
75  const double phi = w->GetLength() * m_D[i]
76  * (w->GetC2()->GetChemical(i) - w->GetC1()->GetChemical(i));
77  dchem_c1[i] += phi;
78  dchem_c2[i] -= phi;
79  }
80 }
81 
82 } // namespace
83 } // namespace
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
STL namespace.
void operator()(Wall *w, double *dchem_c1, double *dchem_c2)
Execute.
Namespace for components of the Default model group.
void Initialize(const CoreData &cd)
Initialize or re-initialize.
Interface for Cell.
Meinhardt(const CoreData &cd)
Initializing constructor.
double GetLength() const
Returns (and calculates, if length marked as dirty) the length along all nodes.
Definition: Wall.cpp:97
CellToCellTransport for Meinhardt model.
A cell wall, runs between cell corner points and consists of wall elements.
Definition: Wall.h:48
Interface for Wall.