Skip to content

Commit

Permalink
report failures
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhei committed Jul 18, 2024
1 parent 08132b7 commit 25b9f59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/aspect/simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@ namespace aspect
unsigned int timestep_number;
unsigned int pre_refinement_step;
unsigned int nonlinear_iteration;
unsigned int nonlinear_solver_failures;
/**
* @}
*/
Expand Down
5 changes: 5 additions & 0 deletions source/simulator/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ namespace aspect
old_time_step (numbers::signaling_nan<double>()),
timestep_number (numbers::invalid_unsigned_int),
nonlinear_iteration (numbers::invalid_unsigned_int),
nonlinear_solver_failures (0),

// We need to disable eliminate_refined_boundary_islands as this leads to
// a deadlock for deal.II <= 9.2.0 as described in
Expand Down Expand Up @@ -1981,6 +1982,7 @@ namespace aspect
{
pcout << "\nWARNING: The nonlinear solver in the current timestep failed to converge." << std::endl
<< "Acting according to the parameter 'Nonlinear solver failure strategy'..." << std::endl;
++nonlinear_solver_failures;

switch (parameters.nonlinear_solver_failure_strategy)
{
Expand Down Expand Up @@ -2208,6 +2210,9 @@ namespace aspect
// throwing an exception. Therefore, we have to do this manually here:
computing_timer.print_summary ();

if (nonlinear_solver_failures>0)
pcout << "\nWARNING: During this computation " << nonlinear_solver_failures << " nonlinear solver failures occurred!" << std::endl;

pcout << "-- Total wallclock time elapsed including restarts: "
<< round(wall_timer.wall_time()+total_walltime_until_last_snapshot)
<< 's' << std::endl;
Expand Down

0 comments on commit 25b9f59

Please sign in to comment.