56{
57
58 auto reason = T::checkConvergence(iter);
59
60 auto & fe_problem_base = this->getMooseApp().feProblem();
61
64
65 bool repeat_augmented_lagrange_step = false;
66
67
68 if (reason == Convergence::MooseConvergenceStatus::CONVERGED)
69 {
71 {
72
73 auto & nonlinear_sys = fe_problem_base.currentNonlinearSystem();
74 nonlinear_sys.update();
75
76
77
80 : fe_problem_base.geomSearchData())
81 ._penetration_locators;
82
83
85 std::list<std::shared_ptr<MechanicalContactConstraint>> mccs;
86 for (const auto & pair : penetration_locators)
87 {
88 const auto & boundaries = pair.first;
89
91 continue;
92 const auto & ncs =
94
95 mccs.emplace_back(nullptr);
96 for (const auto & nc : ncs)
98 mooseError(
"AugmentedLagrangianContactProblem: dynamic cast of "
99 "MechanicalContactConstraint object failed.");
100 else
101 {
102
103
104
105
106 if (mcc->secondaryBoundary() != boundaries.second ||
107 mcc->primaryBoundary() != boundaries.first)
108 continue;
109
110
111 if (!mccs.back())
112 mccs.back() = mcc;
113
114
115 if (repeat_augmented_lagrange_step || !mcc->AugmentedLagrangianContactConverged())
116 {
117 repeat_augmented_lagrange_step = true;
118 break;
119 }
120 }
121 }
122
123
124 const auto & pmuos = this->_app.template getInterfaceObjects<AugmentedLagrangeInterface>();
125 for (auto * pmuo : pmuos)
126 {
127
128 if (!repeat_augmented_lagrange_step && !pmuo->isAugmentedLagrangianConverged())
129 repeat_augmented_lagrange_step = true;
130 }
131
132
133
134 this->_communicator.max(repeat_augmented_lagrange_step);
135
136
137 if (repeat_augmented_lagrange_step)
138 {
141 << '\n';
142
143
144
145
146 for (const auto & mcc : mccs)
147 mcc->updateAugmentedLagrangianMultiplier( false);
148
149
150 for (const auto & pmuo : pmuos)
151 pmuo->updateAugmentedLagrangianMultipliers();
152
153
154 for (const auto & pmuo : pmuos)
155 pmuo->augmentedLagrangianSetup();
156
157
158 reason = Convergence::MooseConvergenceStatus::ITERATING;
159 Moose::out << "Augmented Lagrangian Multiplier needs updating.";
160 }
161 else
162 Moose::out << "Augmented Lagrangian contact constraint enforcement is satisfied.";
163 }
164 else
165 {
166
167 Moose::out << "Maximum Augmented Lagrangian contact iterations have been reached.";
168 reason = Convergence::MooseConvergenceStatus::DIVERGED;
169 }
170 }
171
172 return reason;
173}
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