VPTissue Reference Manual
cell_chemistry/WrapperModel.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 "WrapperModel.h"
21 
22 #include "bio/BoundaryType.h"
23 #include "bio/Cell.h"
24 #include "bio/ReduceCellWalls.h"
25 #include "sim/CoreData.h"
26 
27 #include <boost/property_tree/ptree.hpp>
28 
29 using namespace std;
30 using boost::property_tree::ptree;
31 
32 namespace SimPT_Default {
33 namespace CellChemistry {
34 
35 WrapperModel::WrapperModel(const CoreData& cd)
36 {
37  Initialize(cd);
38 }
39 
40 void WrapperModel::Initialize(const CoreData& cd)
41 {
42  m_cd = cd;
43  const auto& p = m_cd.m_parameters->get_child("wrapper_model");
44 
45  m_ch0_production = p.get<double>("ch0_production");
46  m_ch0_breakdown = p.get<double>("ch0_breakdown");
47  m_ch1_production = p.get<double>("ch1_production");
48  m_ch1_breakdown = p.get<double>("ch1_breakdown");
49 }
50 
51 void WrapperModel::operator()(Cell* cell, double* dchem)
52 {
55 
56  const double chem0 = cell->GetChemical(0);
57  const double chem1 = cell->GetChemical(1);
58  const double a_area = cell->GetArea();
59 
60  dchem[0] = m_ch0_production * a_area - m_ch0_breakdown * chem0;//LEVELS
61  dchem[1] = m_ch1_production * a_area - m_ch1_breakdown * chem1;//LEVELS
62 
63  // Force upper four cell's du/dt to 0, their values are set from outside by
64  // a coupled model.
65  if (cell->GetIndex() < 4) {
66  dchem[0] = 0.0;
67  dchem[1] = 0.0;
68  }
69 }
70 
71 } // namespace
72 } // 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.
Namespace for components of the Default model group.
Interface for Cell.
CellChemistry for the Wrapper model.
BoundaryType enumeration class.
int GetIndex() const
Return the index.
Definition: Cell.h:76
Interface/Implementation for ReduceCellWalls.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178