36 #include "NagaiHondaDifferentialAdhesionForce.hpp"
37 #include "CellLabel.hpp"
39 template<
unsigned DIM>
42 mNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter(1.0),
43 mNagaiHondaLabelledCellCellAdhesionEnergyParameter(1.0),
44 mNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter(1.0)
48 template<
unsigned DIM>
53 template<
unsigned DIM>
63 std::set<unsigned> shared_elements;
64 std::set_intersection(elements_containing_nodeA.begin(),
65 elements_containing_nodeA.end(),
66 elements_containing_nodeB.begin(),
67 elements_containing_nodeB.end(),
68 std::inserter(shared_elements, shared_elements.begin()));
71 assert(!shared_elements.empty());
74 if (shared_elements.size() == 1)
76 unsigned element_index = *(shared_elements.begin());
81 if (p_cell->template HasCellProperty<CellLabel>())
84 return this->GetNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter();
89 return this->GetNagaiHondaCellBoundaryAdhesionEnergyParameter();
95 unsigned num_labelled_cells = 0;
96 for (std::set<unsigned>::iterator iter = shared_elements.begin();
97 iter != shared_elements.end();
100 unsigned element_index = *(iter);
105 if (p_cell->template HasCellProperty<CellLabel>())
107 num_labelled_cells++;
111 if (num_labelled_cells == 2)
114 return this->GetNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter();
116 else if (num_labelled_cells == 1)
119 return this->GetNagaiHondaLabelledCellCellAdhesionEnergyParameter();
124 assert(num_labelled_cells == 0);
125 return this->GetNagaiHondaCellCellAdhesionEnergyParameter();
130 template<
unsigned DIM>
133 return mNagaiHondaLabelledCellCellAdhesionEnergyParameter;
136 template<
unsigned DIM>
139 return mNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter;
142 template<
unsigned DIM>
145 return mNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter;
148 template<
unsigned DIM>
151 mNagaiHondaLabelledCellCellAdhesionEnergyParameter = labelledCellCellAdhesionEnergyParameter;
154 template<
unsigned DIM>
157 mNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter = labelledCellLabelledCellAdhesionEnergyParameter;
160 template<
unsigned DIM>
163 mNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter = labelledCellBoundaryAdhesionEnergyParameter;
166 template<
unsigned DIM>
170 *rParamsFile <<
"\t\t\t<NagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter>" << mNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter <<
"</NagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter> \n";
171 *rParamsFile <<
"\t\t\t<NagaiHondaLabelledCellCellAdhesionEnergyParameter>" << mNagaiHondaLabelledCellCellAdhesionEnergyParameter <<
"</NagaiHondaLabelledCellCellAdhesionEnergyParameter> \n";
172 *rParamsFile <<
"\t\t\t<NagaiHondaLabelledCellBoundaryAdhesionEnergyParameter>" << mNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter <<
"</NagaiHondaLabelledCellBoundaryAdhesionEnergyParameter> \n";
NagaiHondaDifferentialAdhesionForce()
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
void OutputForceParameters(out_stream &rParamsFile)
std::set< unsigned > & rGetContainingElementIndices()
void SetNagaiHondaLabelledCellCellAdhesionEnergyParameter(double labelledCellCellAdhesionEnergyParameter)
virtual ~NagaiHondaDifferentialAdhesionForce()
void OutputForceParameters(out_stream &rParamsFile)
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
double GetNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter()
void SetNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter(double labelledCellLabelledCellAdhesionEnergyParameter)
void SetNagaiHondaLabelledCellBoundaryAdhesionEnergyParameter(double labelledCellBoundaryAdhesionEnergyParameter)
double GetNagaiHondaLabelledCellLabelledCellAdhesionEnergyParameter()
double GetNagaiHondaLabelledCellCellAdhesionEnergyParameter()
virtual double GetAdhesionParameter(Node< DIM > *pNodeA, Node< DIM > *pNodeB, VertexBasedCellPopulation< DIM > &rVertexCellPopulation)