Skip to content
Snippets Groups Projects
Commit faf52d83 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Add a warning for when we do not converge

parent d4f16349
No related branches found
No related tags found
No related merge requests found
......@@ -257,10 +257,9 @@ int main(int argc, char *argv[]) {
if (ignoreNodes[i].count() == dim)
dirichletFunction.evaluate(time, u_diff[i][0]);
for (size_t state_fpi = 0;
state_fpi <
parset.get<size_t>("solver.tnnmg.fixed_point_iterations");
++state_fpi) {
auto const state_fpi_max =
parset.get<size_t>("solver.tnnmg.fixed_point_iterations");
for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) {
auto myGlobalNonlinearity =
assemble_nonlinearity<MatrixType, VectorType>(
parset.sub("boundary.friction"), *nodalIntegrals, alpha, tau);
......@@ -306,6 +305,10 @@ int main(int argc, char *argv[]) {
if (energyNorm.diff(u_diff_saved, u_diff) <
parset.get<double>("solver.tnnmg.fixed_point_tolerance"))
break;
if (state_fpi == state_fpi_max)
std::cerr << "FPI did not converge after " << state_fpi_max
<< " iterations" << std::endl;
}
// Record the state, (scaled) displacement, and Neumann
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment