VPTissue Reference Manual
hamiltonian/ModifiedGC.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 "ModifiedGC.h"
21 
22 #include "HHelper.h"
23 #include "bio/Cell.h"
24 #include "sim/CoreData.h"
25 
26 #include <cassert>
27 
28 using namespace std;
29 using namespace boost::property_tree;
30 using namespace SimPT_Sim;
31 
32 namespace SimPT_Default {
33 namespace Hamiltonian {
34 
35 ModifiedGC::ModifiedGC(const CoreData& cd)
36 {
37  assert( cd.Check() && "CoreData not ok in ModifiedGC Hamiltonian");
38  Initialize(cd);
39 }
40 
41 void ModifiedGC::Initialize(const CoreData& cd)
42 {
43  const auto& p = cd.m_parameters->get_child("cell_mechanics");
44 
45  m_lambda_bend = p.get<double>("lambda_bend");
46  m_lambda_cell_length = p.get<double>("lambda_celllength");
47  m_lambda_length = p.get<double>("lambda_length");
48  m_rp_stiffness = p.get<double>("relative_perimeter_stiffness");
49  m_target_node_distance = p.get<double>("target_node_distance");
50 
51 }
52 
53 double ModifiedGC::operator()(Cell* cell)
54 {
55  double h = 0.0;
56 
57  if (!cell->IsBoundaryPolygon()) {
58 
59  // --------------------------------------------------------------------------------------------
60  // Cell area:
61  // --------------------------------------------------------------------------------------------
62  // TODO: DDV: hidden factor 1000
63  h += 1000.0 * pow((cell->GetArea() - cell->GetTargetArea()) / cell->GetArea(), 2);
64 
65  // --------------------------------------------------------------------------------------------
66  // Wall length:
67  // --------------------------------------------------------------------------------------------
68  h += m_lambda_length
69  * HHelper::WallLengthTerm(cell, m_rp_stiffness, m_target_node_distance);
70  }
71 
72  return h;
73 }
74 
75 } // namespace
76 } // 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.
Interface/Implementation for Hamiltonian::HHelper.
Namespace for components of the Default model group.
Namespace for the core simulator.
Interface for Cell.
Interface for Hamiltonian::ModifiedGC.
double GetArea() const
Return the area of the cell.
Definition: Cell.cpp:178
bool Check() const
Verify all pointers non-null.
Definition: CoreData.h:53