66{
67
68 auto reason = T::checkConvergence(iter);
69
70 auto & fe_problem_base = this->getMooseApp().feProblem();
71
72 bool repeat_augmented_lagrange_step = false;
73
74
75 if (reason == Convergence::MooseConvergenceStatus::CONVERGED)
76 {
78 {
79
80 auto & nonlinear_sys = fe_problem_base.currentNonlinearSystem();
81 nonlinear_sys.update();
82
83
84
87 : fe_problem_base.geomSearchData())
88 ._penetration_locators;
89
90
92 std::list<std::shared_ptr<MechanicalContactConstraint>> mccs;
93 for (const auto & pair : penetration_locators)
94 {
95 const auto & boundaries = pair.first;
96
98 continue;
99 const auto & ncs =
101
102 mccs.emplace_back(nullptr);
103 for (const auto & nc : ncs)
105 mooseError(
"AugmentedLagrangianContactProblem: dynamic cast of "
106 "MechanicalContactConstraint object failed.");
107 else
108 {
109
110
111
112
113 if (mcc->secondaryBoundary() != boundaries.second ||
114 mcc->primaryBoundary() != boundaries.first)
115 continue;
116
117
118 if (!mccs.back())
119 mccs.back() = mcc;
120
121
122 if (repeat_augmented_lagrange_step || !mcc->AugmentedLagrangianContactConverged())
123 {
124 repeat_augmented_lagrange_step = true;
125 break;
126 }
127 }
128 }
129
130
131 const auto & pmuos = this->_app.template getInterfaceObjects<AugmentedLagrangeInterface>();
132 for (auto * pmuo : pmuos)
133 {
134
135 if (!repeat_augmented_lagrange_step && !pmuo->isAugmentedLagrangianConverged())
136 repeat_augmented_lagrange_step = true;
137 }
138
139
140
141 this->_communicator.max(repeat_augmented_lagrange_step);
142
143
144 if (repeat_augmented_lagrange_step)
145 {
148 << '\n';
149
150
151
152
153 for (const auto & mcc : mccs)
154 mcc->updateAugmentedLagrangianMultiplier( false);
155
156
157 for (const auto & pmuo : pmuos)
158 pmuo->updateAugmentedLagrangianMultipliers();
159
160
161 for (const auto & pmuo : pmuos)
162 pmuo->augmentedLagrangianSetup();
163
164
165 reason = Convergence::MooseConvergenceStatus::ITERATING;
166 Moose::out << "Augmented Lagrangian Multiplier needs updating.";
167 }
168 else
169 Moose::out << "Augmented Lagrangian contact constraint enforcement is satisfied.";
170 }
171 else
172 {
173
174 Moose::out << "Maximum Augmented Lagrangian contact iterations have been reached.";
175 reason = Convergence::MooseConvergenceStatus::DIVERGED;
176 }
177 }
178
179 return reason;
180}
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
void mooseError(Args &&... args)
std::shared_ptr< DisplacedProblem > displaced_problem
const std::vector< std::shared_ptr< NodeFaceConstraint > > & getActiveNodeFaceConstraints(BoundaryID boundary_id, bool displaced) const
bool hasActiveNodeFaceConstraints(BoundaryID boundary_id, bool displaced) const