VPTissue Reference Manual
cell_chemistry/TestCoupling.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 "TestCoupling.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_Default {
31 namespace CellChemistry {
32 
33 TestCoupling::TestCoupling(const CoreData& cd)
34 {
35  Initialize(cd);
36 }
37 
38 void TestCoupling::Initialize(const CoreData& cd)
39 {
40  m_cd = cd;
41  const auto& p = m_cd.m_parameters->get_child("test_coupling");
42  m_ch0_production = p.get<double>("ch0_production");
43  m_ch0_breakdown = p.get<double>("ch0_breakdown");
44  m_ch1_production = p.get<double>("ch1_production");
45  m_ch1_breakdown = p.get<double>("ch1_breakdown");
46 }
47 
48 void TestCoupling::operator()(Cell* cell, double* dchem)
49 {
52 
53  const double chem0 = cell->GetChemical(0);
54  const double chem1 = cell->GetChemical(1);
55 
56  dchem[0] = m_ch0_production - m_ch0_breakdown * chem0; //LEVELS
57  dchem[1] = m_ch1_production - m_ch1_breakdown * chem1; //LEVELS
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
Namespace for miscellaneous utilities.
Definition: PTreeFile.cpp:44
Namespace for components of the Default model group.
Interface for Cell.
BoundaryType enumeration class.
Interface/Implementation for ReduceCellWalls.
CellChemistry component for the TestCoupling model.