33 namespace Hamiltonian {
37 assert( cd.
Check() &&
"CoreData not ok in ElasticWall Hamiltonian");
41 void ElasticWall::Initialize(
const CoreData& cd)
43 const auto& p = cd.m_parameters->get_child(
"cell_mechanics");
45 m_elastic_modulus = p.get<
double>(
"elastic_modulus");
46 m_lambda_bend = p.get<
double>(
"lambda_bend");
47 m_lambda_cell_length = p.get<
double>(
"lambda_celllength");
48 m_lambda_length = p.get<
double>(
"lambda_length", 0.0);
49 m_rp_stiffness = p.get<
double>(
"relative_perimeter_stiffness");
50 m_target_node_distance = p.get<
double>(
"target_node_distance");
53 double ElasticWall::operator()(
Cell* cell)
57 if (!cell->IsBoundaryPolygon()) {
62 h += pow(cell->
GetArea() - cell->GetTargetArea(), 2);
67 h += m_elastic_modulus * HHelper::ElasticWallTerm(cell, m_rp_stiffness);
72 if (abs(m_lambda_length) > 1.0e-7) {
74 * HHelper::EdgeTerm(cell, m_rp_stiffness, m_target_node_distance);
80 if (abs(m_lambda_cell_length) > 1.0e-7) {
81 h += m_lambda_cell_length * HHelper::CellLengthTerm(cell);
88 if (abs(m_lambda_bend) > 1.0e-7) {
89 h += m_lambda_bend * HHelper::BendingTerm(cell);
Core data with mesh, parameters, random engine and time data.
A cell contains walls and nodes.
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 Hamiltonian ElasticWall component.
double GetArea() const
Return the area of the cell.
bool Check() const
Verify all pointers non-null.