39 namespace DeltaHamiltonian {
43 assert( cd.
Check() &&
"CoreData not ok in Maxwell DeltaHamiltonian");
49 m_mesh = cd.m_mesh.get();
50 const auto& p = cd.m_parameters->get_child(
"cell_mechanics");
52 m_elastic_modulus = p.get<
double>(
"elastic_modulus");
53 m_lambda_alignment = p.get<
double>(
"lambda_alignment");
54 m_lambda_bend = p.get<
double>(
"lambda_bend");
55 m_lambda_cell_length = p.get<
double>(
"lambda_celllength");
56 m_lambda_length = p.get<
double>(
"lambda_length", 0.0);
57 m_rp_stiffness = p.get<
double>(
"relative_perimeter_stiffness");
58 m_target_node_distance = p.get<
double>(
"target_node_distance");
66 const auto& nb1 = nb.
GetNb1();
67 const auto& nb2 = nb.
GetNb2();
68 const array<double, 3> now_p = *n;
69 const array<double, 3> mov_p = now_p + move;
70 const array<double, 3> nb1_p = *nb1;
71 const array<double, 3> nb2_p = *nb2;
73 if (!cell->IsBoundaryPolygon()) {
78 const auto del_area = 0.5 * ((mov_p[0] - now_p[0]) * (nb1_p[1] - nb2_p[1])
79 + (mov_p[1] - now_p[1]) * (nb2_p[0] - nb1_p[0]));
81 dh += cell->GetSolute() * log(cell->
GetArea() / (cell->
GetArea() - del_area));
86 dh += m_elastic_modulus * DHelper::ElasticWallTerm(
87 cell, n, m_mesh->GetNodeOwningWalls(n), m_rp_stiffness, nb1_p, nb2_p, now_p, mov_p);
92 if (abs(m_lambda_length) > 1.0e-7) {
93 const bool at_b = n->IsAtBoundary();
94 const double w1 = (at_b && nb1->IsAtBoundary()) ? m_rp_stiffness : 1.0;
95 const double w2 = (at_b && nb2->IsAtBoundary()) ? m_rp_stiffness : 1.0;
96 const double old1 = Norm(now_p - nb1_p) - m_target_node_distance;
97 const double old2 = Norm(now_p - nb2_p) - m_target_node_distance;
98 const double new1 = Norm(mov_p - nb1_p) - m_target_node_distance;
99 const double new2 = Norm(mov_p - nb2_p) - m_target_node_distance;
101 dh += m_lambda_length * (w1 * (new1 * new1 - old1 * old1) + w2 * (new2 * new2 - old2 * old2));
107 if ((abs(m_lambda_cell_length) > 1.0e-7) || (abs(m_lambda_alignment) > 1.0e-7)) {
109 const auto new_geo = ModifyForMove(old_geo, nb1_p, nb2_p, now_p, mov_p);
110 const auto old_tup = old_geo.GetEllipseAxes();
111 const auto new_tup = new_geo.GetEllipseAxes();
116 if (abs(m_lambda_cell_length) > 1.0e-7) {
117 const double t_old = cell->GetTargetLength() - get<0>(old_tup);
118 const double t_new = cell->GetTargetLength() - get<0>(new_tup);
120 dh += m_lambda_cell_length * (t_new * t_new - t_old * t_old);
126 if (abs(m_lambda_alignment) > 1.0e-7) {
127 dh += m_lambda_alignment * DHelper::AlignmentTerm(get<1>(old_tup), get<1>(new_tup));
135 if (abs(m_lambda_bend) > 1.0e-7) {
136 dh += m_lambda_bend * DHelper::BendingTerm(nb1_p, nb2_p, now_p, mov_p);
Core data with mesh, parameters, random engine and time data.
A cell contains walls and nodes.
Cell * GetCell() const
Return the cell of this Neighbor pair.
Core data used during model execution.
Combo header for circular iterator.
Interface for NeighborNodes.
Interface/Implementation for GeoData.
Namespace for components of the Default model group.
Node * GetNb1() const
Return first node of this Neighbor pair.
Structure of neighboring nodes: two neighboring nodes from standpoint of a given cell with an orderin...
Node * GetNb2() const
Return second node of this Neighbor pair.
Interface/Implementation for DeltaHamiltonian::DHelper.
GeoData GetGeoData() const
Return GeData (area, centroid, area moment of inertia).
double GetArea() const
Return the area of the cell.
bool Check() const
Verify all pointers non-null.
Interface for DeltaHamiltonian::Maxwell.